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()
File
getInputStream
in interface File
public ZonedDateTime getLastModificationDate()
File
getLastModificationDate
in interface File
public void setLastModificationDate(ZonedDateTime lastModificationDate)
File
setLastModificationDate
in interface File
lastModificationDate
- the last modification date to setpublic long getLength()
File
public String getMimeType()
File
getMimeType
in interface File
public void setMimeType(String mimeType)
File
setMimeType
in interface File
mimeType
- the mime type to setpublic String getPath()
File
private ModifiableResource _getResource() throws AmetysRepositoryException, UnknownAmetysObjectException