Class TypedFile

java.lang.Object
de.xima.fc.common.io.TypedFile
All Implemented Interfaces:
Serializable

public final class TypedFile extends Object implements Serializable
Represents a File with a content type (MIME type).
Since:
8.3.0
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • TypedFile

      public TypedFile(Path file, String contentType)
      Creates a new typed file with the specified data and content type.
      Parameters:
      file - The file with the data.
      contentType - The content type. Defaults to "application/octet-stream" if blank.
    • TypedFile

      public TypedFile(File file, String contentType)
      Creates a new typed file with the specified data and content type.
      Parameters:
      file - The file with the data.
      contentType - The content type. Defaults to "application/octet-stream" if blank.
  • Method Details

    • contentType

      public String contentType()
      Gets the content type of the file.
      Returns:
      The content type.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • file

      public File file()
      Gets the file with the data
      Returns:
      The file with the data.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object