Class FileHandle
- java.lang.Object
-
- com.composum.sling.clientlibs.handle.FileHandle
-
- Direct Known Subclasses:
ImageHandle
public class FileHandle extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceHandle
content
static Map<String,Object>
CRUD_CONTENT_PROPS
static Map<String,Object>
CRUD_FILE_PROPS
protected String
encoding
protected String
extension
protected Calendar
lastModified
protected String
mimeType
protected String
name
protected ResourceHandle
resource
-
Constructor Summary
Constructors Constructor Description FileHandle(@Nullable org.apache.sling.api.resource.Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceHandle
getContent()
Handle to the content node of the file; not null.String
getEncoding()
String
getExtension()
Calendar
getLastModified()
String
getMimeType()
String
getName()
String
getPath()
ResourceHandle
getResource()
Handle to the main node of the file; not null.Long
getSize()
InputStream
getStream()
boolean
isValid()
protected ResourceHandle
retrieveContent()
protected void
retrieveNameAndExt()
void
storeContent(InputStream stream)
String
toString()
void
updateLastModified()
Updates the last modified value, if the mix:lastModified is present.
-
-
-
Field Detail
-
resource
protected final ResourceHandle resource
-
content
protected final ResourceHandle content
-
name
protected transient String name
-
extension
protected transient String extension
-
mimeType
protected transient String mimeType
-
encoding
protected transient String encoding
-
lastModified
protected transient Calendar lastModified
-
-
Method Detail
-
getContent
public ResourceHandle getContent()
Handle to the content node of the file; not null.
-
getResource
public ResourceHandle getResource()
Handle to the main node of the file; not null.
-
isValid
public boolean isValid()
-
getPath
public String getPath()
-
getName
public String getName()
-
getExtension
public String getExtension()
-
getMimeType
public String getMimeType()
-
getEncoding
public String getEncoding()
-
getLastModified
public Calendar getLastModified()
-
getSize
public Long getSize()
-
getStream
public InputStream getStream()
-
storeContent
public void storeContent(InputStream stream)
-
updateLastModified
public void updateLastModified()
Updates the last modified value, if the mix:lastModified is present.
-
retrieveContent
protected ResourceHandle retrieveContent()
-
retrieveNameAndExt
protected void retrieveNameAndExt()
-
-