Interface File
-
- All Superinterfaces:
BaseAsset
,FolderContainedAsset
,MetadataAwareAsset
,NamedAsset
,PermissionsCapableAsset
,PublishableAsset
public interface File extends PublishableAsset
Represents a file asset.- Since:
- 4.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
getData()
Get the file's data as a byte array.ImageDimensions
getDimensions()
java.lang.Long
getFileSize()
Similar to calling {@link #getData().length} but will execute much faster and take much less memory.java.lang.String
getText()
Returns the file's data in form of a String.void
setData(byte[] data)
Set the file's data as a byte array.-
Methods inherited from interface com.hannonhill.cascade.api.asset.common.BaseAsset
getAssetId, getAssetType, getIdentifer
-
Methods inherited from interface com.hannonhill.cascade.api.asset.home.FolderContainedAsset
getCreatedBy, getCreatedOn, getFolderOrder, getIdentifier, getLastModified, getLastModifiedBy, getParentFolder, getParentFolderIdentifier, getPath, getSite, getSiteId, getSiteName, getTags, isHideSystemName, setHideSystemName, setParentFolder, setParentFolderIdentifier
-
Methods inherited from interface com.hannonhill.cascade.api.asset.home.MetadataAwareAsset
getLabel, getLinkingAssets, getMetadata, getMetadataSet, getMetadataSetId
-
Methods inherited from interface com.hannonhill.cascade.api.asset.common.NamedAsset
getName, setName
-
Methods inherited from interface com.hannonhill.cascade.api.asset.common.PermissionsCapableAsset
isCurrentUserCanRead, isCurrentUserCanWrite, isUserCanRead, isUserCanWrite
-
Methods inherited from interface com.hannonhill.cascade.api.asset.home.PublishableAsset
getLastPublishedBy, getLastPublishedOn, getLink, getShouldBeIndexed, getShouldBePublished, setIncludeWhenIndexing, setIncludeWhenPublishing
-
-
-
-
Method Detail
-
getData
byte[] getData()
Get the file's data as a byte array.- Returns:
- the byte data of the file
-
setData
void setData(byte[] data)
Set the file's data as a byte array.- Parameters:
data
- the byte data for the file
-
getText
java.lang.String getText()
Returns the file's data in form of a String.- Returns:
-
getFileSize
java.lang.Long getFileSize()
Similar to calling {@link #getData().length} but will execute much faster and take much less memory.- Returns:
-
getDimensions
ImageDimensions getDimensions()
- Returns:
- returns an
ImageDimensions
representing the height and width of an image file. This method can return null if image dimensions are not applicable for the file or if the image file does not have any dimensions populated.
-
-