Package org.ametys.cms.data
Class ExplorerFile
java.lang.Object
org.ametys.cms.data.ExplorerFile
- All Implemented Interfaces:
File
Class representing a file from explorer
-
Constructor Summary
ConstructorsConstructorDescriptionExplorerFile(AmetysObjectResolver resolver, String resourceId) Constructor of the explorer fileExplorerFile(AmetysObjectResolver resolver, String resourceId, javax.jcr.Session session) Constructor of the explorer file -
Method Summary
Modifier and TypeMethodDescriptionReturns the data stream.Returns the last modification date.longReturns the length of the data stream.Returns the data mime-type.getName()Retrieves the file's nameRetrieves the file resourceRetrieves the resource's identifiervoidsetLastModificationDate(ZonedDateTime lastModificationDate) Sets the last modification date of the file's datavoidsetMimeType(String mimeType) Sets the mime type of the file's data
-
Constructor Details
-
ExplorerFile
Constructor of the explorer file- Parameters:
resolver- resolver used to get the resource from its identifierresourceId- resource's identifier
-
ExplorerFile
Constructor of the explorer file- Parameters:
resolver- resolver used to get the resource from its identifierresourceId- resource's identifiersession- the current session. Ifnull, 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:FileReturns the data stream.- Specified by:
getInputStreamin interfaceFile- Returns:
- the data stream.
-
getLastModificationDate
Description copied from interface:FileReturns the last modification date.- Specified by:
getLastModificationDatein interfaceFile- Returns:
- the last modification date.
-
setLastModificationDate
Description copied from interface:FileSets the last modification date of the file's data- Specified by:
setLastModificationDatein interfaceFile- Parameters:
lastModificationDate- the last modification date to set
-
getLength
Description copied from interface:FileReturns the length of the data stream. -
getMimeType
Description copied from interface:FileReturns the data mime-type.- Specified by:
getMimeTypein interfaceFile- Returns:
- the data mime-type.
-
setMimeType
Description copied from interface:FileSets the mime type of the file's data- Specified by:
setMimeTypein interfaceFile- Parameters:
mimeType- the mime type to set
-
getName
Description copied from interface:FileRetrieves the file's name -
getResource
Retrieves the file resource- Returns:
- the file resource
- Throws:
AmetysRepositoryException- if an error occurs while resolving the resource by its idUnknownAmetysObjectException- if the resource does not exist
-