public class ExplorerFile extends Object implements File
| Modifier and Type | Field and Description |
|---|---|
private AmetysObjectResolver |
_resolver |
private ModifiableResource |
_resource |
private String |
_resourceId |
private Session |
_session |
| Constructor and Description |
|---|
ExplorerFile(AmetysObjectResolver resolver,
String resourceId)
Constructor of the explorer file
|
ExplorerFile(AmetysObjectResolver resolver,
String resourceId,
Session session)
Constructor of the explorer file
|
| Modifier and Type | Method and Description |
|---|---|
private ModifiableResource |
_getResource() |
InputStream |
getInputStream()
Returns the data stream.
|
ZonedDateTime |
getLastModificationDate()
Returns the last modification date.
|
long |
getLength()
Returns the length of the data stream.
|
String |
getMimeType()
Returns the data mime-type.
|
String |
getName()
Retrieves the file's name
|
String |
getPath()
Returns the path of this resource in its hierarchy (which is a subset of the whole repository).
|
String |
getResourceId()
Retrieves the resource's identifier
|
void |
setLastModificationDate(ZonedDateTime lastModificationDate)
Sets the last modification date of the file's data
|
void |
setMimeType(String mimeType)
Sets the mime type of the file's data
|
private AmetysObjectResolver _resolver
private String _resourceId
private ModifiableResource _resource
public ExplorerFile(AmetysObjectResolver resolver, String resourceId)
resolver - resolver used to get the resource from its identifierresourceId - resource's identifierpublic ExplorerFile(AmetysObjectResolver resolver, String resourceId, Session session)
resolver - resolver used to get the resource from its identifierresourceId - resource's identifiersession - the current session. If null, a new session will be used to retrieve the resource's datapublic String getResourceId()
public InputStream getInputStream()
FilegetInputStream in interface Filepublic ZonedDateTime getLastModificationDate()
FilegetLastModificationDate in interface Filepublic void setLastModificationDate(ZonedDateTime lastModificationDate)
FilesetLastModificationDate in interface FilelastModificationDate - the last modification date to setpublic long getLength()
Filepublic String getMimeType()
FilegetMimeType in interface Filepublic void setMimeType(String mimeType)
FilesetMimeType in interface FilemimeType - the mime type to setpublic String getPath()
Fileprivate ModifiableResource _getResource() throws AmetysRepositoryException, UnknownAmetysObjectException