Class ImageFileAttributes

Object
ImageFileAttributes

public class ImageFileAttributes extends Object
Timestamps and other metadata associated with an image file-path, but not with the file's contents.
Author:
Owen Feehan
  • Constructor Details

    • ImageFileAttributes

      public ImageFileAttributes(Path path, ZonedDateTime creationTime, ZonedDateTime modificationTime)
      Creates a new ImageFileAttributes instance.
      Parameters:
      path - The path on the file-system.
      creationTime - The creation timestamp on the file the image was loaded from.
      modificationTime - The last modified timestamp on the file the image was loaded from.
  • Method Details

    • fromPath

      public static ImageFileAttributes fromPath(Path path) throws IOException
      Reads ImageFileAttributes from a path.
      Parameters:
      path - the path.
      Returns:
      newly created ImageFileAttributes.
      Throws:
      IOException - if the timestamps cannot be read.
    • extension

      public Optional<String> extension()
      The file extension of the file-path.
      Returns:
      the extension, always in lower-case.
    • getCreationTime

      public ZonedDateTime getCreationTime()
      The creation timestamp on the file the image was loaded from.
    • getModificationTime

      public ZonedDateTime getModificationTime()
      The last modified timestamp on the file the image was loaded from.