Interface IResource
- All Superinterfaces:
IEntity
public interface IResource extends IEntity
The
IResource interface represents a resource located in the
repository.-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPE_DEFAULTThe default content type - text/plain. -
Method Summary
Modifier and Type Method Description byte[]getContent()Returns the content of the resource as a byte array.StringgetContentType()Getter for the content type.booleanisBinary()Getter for binary flag.voidsetContent(byte[] content)Sets this resource's content.voidsetContent(byte[] content, boolean isBinary, String contentType)Sets this resource's content.
-
Field Details
-
CONTENT_TYPE_DEFAULT
The default content type - text/plain.- See Also:
- Constant Field Values
-
-
Method Details
-
getContent
Returns the content of the resource as a byte array.- Returns:
- the raw content
- Throws:
RepositoryReadException- in case the content cannot be retrieved
-
setContent
Sets this resource's content.- Parameters:
content- the raw content- Throws:
RepositoryWriteException- the repository write exception
-
setContent
void setContent(byte[] content, boolean isBinary, String contentType) throws RepositoryWriteExceptionSets this resource's content.- Parameters:
content- the raw contentisBinary- whether it is binarycontentType- the type of the content- Throws:
RepositoryWriteException- in case the content of theIResourcecannot be retrieved
-
isBinary
boolean isBinary()Getter for binary flag.- Returns:
- whether it is binary
-
getContentType
String getContentType()Getter for the content type.- Returns:
- the type of the content
-