java.lang.Object
org.apache.commons.io.monitor.FileEntry
????????:
Serializable

public class FileEntry extends Object implements Serializable
The state of a file or directory, capturing the following File attributes at a point in time.

Custom Implementations

If the state of additional File attributes is required then create a custom FileEntry with properties for those attributes. Override the newChildInstance(File) to return a new instance of the appropriate type. You may also want to override the refresh(File) method.

???????:
2.0
????:
  • ???????

    • FileEntry

      public FileEntry(File file)
      Construct a new monitor for a specified File.
      ??:
      file - The file being monitored
    • FileEntry

      public FileEntry(FileEntry parent, File file)
      Construct a new monitor for a specified File.
      ??:
      parent - The parent
      file - The file being monitored
  • ??????

    • refresh

      public boolean refresh(File file)
      Refresh the attributes from the File, indicating whether the file has changed.

      This implementation refreshes the name, exists, directory, lastModified and length properties.

      The exists, directory, lastModified and length properties are compared for changes

      ??:
      file - the file instance to compare to
      ??:
      true if the file has changed, otherwise false
    • newChildInstance

      Create a new child instance.

      Custom implementations should override this method to return a new instance of the appropriate type.

      ??:
      file - The child file
      ??:
      a new child instance
    • getParent

      public FileEntry getParent()
      Return the parent entry.
      ??:
      the parent entry
    • getLevel

      public int getLevel()
      Return the level
      ??:
      the level
    • getChildren

      public FileEntry[] getChildren()
      Return the directory's files.
      ??:
      This directory's files or an empty array if the file is not a directory or the directory is empty
    • setChildren

      public void setChildren(FileEntry... children)
      Set the directory's files.
      ??:
      children - This directory's files, may be null
    • getFile

      public File getFile()
      Return the file being monitored.
      ??:
      the file being monitored
    • getName

      public String getName()
      Return the file name.
      ??:
      the file name
    • setName

      public void setName(String name)
      Set the file name.
      ??:
      name - the file name
    • getLastModified

      public long getLastModified()
      Return the last modified time from the last time it was checked.
      ??:
      the last modified time
    • setLastModified

      public void setLastModified(long lastModified)
      Return the last modified time from the last time it was checked.
      ??:
      lastModified - The last modified time
    • getLength

      public long getLength()
      Return the length.
      ??:
      the length
    • setLength

      public void setLength(long length)
      Set the length.
      ??:
      length - the length
    • isExists

      public boolean isExists()
      Indicate whether the file existed the last time it was checked.
      ??:
      whether the file existed
    • setExists

      public void setExists(boolean exists)
      Set whether the file existed the last time it was checked.
      ??:
      exists - whether the file exists or not
    • isDirectory

      public boolean isDirectory()
      Indicate whether the file is a directory or not.
      ??:
      whether the file is a directory or not
    • setDirectory

      public void setDirectory(boolean directory)
      Set whether the file is a directory or not.
      ??:
      directory - whether the file is a directory or not