Class File

All Implemented Interfaces:
Serializable, Comparable<File>, Mutable

public final class File extends File implements Mutable
A reference to an existing file
See Also:
  • Constructor Details

    • File

      public File(URI uri)
      Creates a reference to a file specified by a URI
      Parameters:
      uri - the file's URI
    • File

      public File(String pathname)
      Creates a reference to a file specified by a path string
      Parameters:
      pathname - the path string
    • File

      public File(Path path)
      Creates a reference to a file specified by a Path object
      Parameters:
      path - the path to the file
  • Method Details

    • digest

      public String digest(String algorithm)
      Generates a digest of the file's contents
      Parameters:
      algorithm - the message digest algorithm
      Returns:
      a hexadecimal string representation of the file's message digest
      See Also:
    • modified

      public boolean modified()
      Description copied from interface: Mutable
      Checks if the resource has been modified since this reference was created
      Specified by:
      modified in interface Mutable
      Returns:
      true if the resource has been modified
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class File