Class FileEntity


  • public class FileEntity
    extends Entity
    Local entity based on a regular File.
    • Field Detail

      • file

        private final java.io.File file
        The underlying regular file.
    • Constructor Detail

      • FileEntity

        public FileEntity​(java.io.File file,
                          MetadataService metadataService)
        Constructor.
        Parameters:
        file - The underlying file.
        metadataService - The metadata service to use.
    • Method Detail

      • exists

        public boolean exists()
        Description copied from class: Entity
        Indicates if the entity does exist.
        Specified by:
        exists in class Entity
        Returns:
        True if the entity does exists.
      • getChildren

        public java.util.List<Entity> getChildren()
        Description copied from class: Entity
        Returns the list of contained entities if the current entity is a directory, null otherwise.
        Specified by:
        getChildren in class Entity
        Returns:
        The list of contained entities.
      • getFile

        public java.io.File getFile()
        Returns the underlying regular file.
        Returns:
        The underlying regular file.
      • getName

        public java.lang.String getName()
        Description copied from class: Entity
        Returns the name.
        Specified by:
        getName in class Entity
        Returns:
        The name.
      • getParent

        public Entity getParent()
        Description copied from class: Entity
        Returns the parent directory (if any).
        Specified by:
        getParent in class Entity
        Returns:
        The parent directory, null otherwise.
      • getRepresentation

        public Representation getRepresentation​(MediaType defaultMediaType,
                                                int timeToLive)
        Description copied from class: Entity
        Returns a representation of this local entity.
        Specified by:
        getRepresentation in class Entity
        Returns:
        A representation of this entity.
      • isDirectory

        public boolean isDirectory()
        Description copied from class: Entity
        Indicates if the entity is a directory.
        Specified by:
        isDirectory in class Entity
        Returns:
        True if the entity is a directory.
      • isNormal

        public boolean isNormal()
        Description copied from class: Entity
        Indicates if the entity is a normal entity, especially if it is not a directory.
        Specified by:
        isNormal in class Entity
        Returns:
        True if the entity is a normal entity.
        See Also:
        File.isFile(), File.isDirectory()