Class ExplorerFile

java.lang.Object
org.ametys.cms.data.ExplorerFile
All Implemented Interfaces:
File

public class ExplorerFile extends Object implements File
Class representing a file from explorer
  • Constructor Details

    • ExplorerFile

      public ExplorerFile(AmetysObjectResolver resolver, String resourceId)
      Constructor of the explorer file
      Parameters:
      resolver - resolver used to get the resource from its identifier
      resourceId - resource's identifier
    • ExplorerFile

      public ExplorerFile(AmetysObjectResolver resolver, String resourceId, javax.jcr.Session session)
      Constructor of the explorer file
      Parameters:
      resolver - resolver used to get the resource from its identifier
      resourceId - resource's identifier
      session - the current session. If null, a new session will be used to retrieve the resource's data
  • Method Details

    • getResourceId

      Retrieves the resource's identifier
      Returns:
      the resource's identifier
    • getInputStream

      Description copied from interface: File
      Returns the data stream.
      Specified by:
      getInputStream in interface File
      Returns:
      the data stream.
    • getLastModificationDate

      Description copied from interface: File
      Returns the last modification date.
      Specified by:
      getLastModificationDate in interface File
      Returns:
      the last modification date.
    • setLastModificationDate

      public void setLastModificationDate(ZonedDateTime lastModificationDate)
      Description copied from interface: File
      Sets the last modification date of the file's data
      Specified by:
      setLastModificationDate in interface File
      Parameters:
      lastModificationDate - the last modification date to set
    • getLength

      public long getLength()
      Description copied from interface: File
      Returns the length of the data stream.
      Specified by:
      getLength in interface File
      Returns:
      the length of the data stream.
    • getMimeType

      public String getMimeType()
      Description copied from interface: File
      Returns the data mime-type.
      Specified by:
      getMimeType in interface File
      Returns:
      the data mime-type.
    • setMimeType

      public void setMimeType(String mimeType)
      Description copied from interface: File
      Sets the mime type of the file's data
      Specified by:
      setMimeType in interface File
      Parameters:
      mimeType - the mime type to set
    • getName

      public String getName()
      Description copied from interface: File
      Retrieves the file's name
      Specified by:
      getName in interface File
      Returns:
      the file's name