public interface Document extends FileableCmisObject, DocumentProperties
Modifier and Type | Method and Description |
---|---|
Document |
appendContentStream(ContentStream contentStream,
boolean isLastChunk)
Appends a content stream to the content stream of the document and
refreshes this object afterwards.
|
ObjectId |
appendContentStream(ContentStream contentStream,
boolean isLastChunk,
boolean refresh)
Appends a content stream to the content stream of the document.
|
void |
cancelCheckOut()
If this is a PWC (private working copy) the check out will be reversed.
|
ObjectId |
checkIn(boolean major,
Map<String,?> properties,
ContentStream contentStream,
String checkinComment)
If this is a PWC (private working copy) it performs a check in.
|
ObjectId |
checkIn(boolean major,
Map<String,?> properties,
ContentStream contentStream,
String checkinComment,
List<Policy> policies,
List<Ace> addAces,
List<Ace> removeAces)
If this is a PWC (private working copy) it performs a check in.
|
ObjectId |
checkOut()
Checks out the document and returns the object ID of the PWC (private
working copy).
|
Document |
copy(ObjectId targetFolderId)
Creates a copy of this document, including content.
|
Document |
copy(ObjectId targetFolderId,
Map<String,?> properties,
VersioningState versioningState,
List<Policy> policies,
List<Ace> addACEs,
List<Ace> removeACEs,
OperationContext context)
Creates a copy of this document, including content.
|
OutputStream |
createAppendOutputStream()
Creates an
OutputStream stream object that can be used to append
content the current content of the document. |
OutputStream |
createAppendOutputStream(int bufferSize)
Creates an
OutputStream stream object that can be used to append
content the current content of the document. |
OutputStream |
createOverwriteOutputStream(String filename,
String mimeType)
Creates an
OutputStream stream object that can be used to
overwrite the current content of the document. |
OutputStream |
createOverwriteOutputStream(String filename,
String mimeType,
int bufferSize)
Creates an
OutputStream stream object that can be used to
overwrite the current content of the document. |
void |
deleteAllVersions()
Deletes this document and all its versions.
|
Document |
deleteContentStream()
Removes the current content stream from the document and refreshes this
object afterwards.
|
ObjectId |
deleteContentStream(boolean refresh)
Removes the current content stream from the document.
|
List<Document> |
getAllVersions()
Fetches all versions of this document.
|
List<Document> |
getAllVersions(OperationContext context)
Fetches all versions of this document using the given
OperationContext . |
ContentStream |
getContentStream()
Retrieves the content stream of this document.
|
ContentStream |
getContentStream(BigInteger offset,
BigInteger length)
Retrieves the content stream of this document.
|
ContentStream |
getContentStream(String streamId)
Retrieves the content stream that is associated with the given stream ID.
|
ContentStream |
getContentStream(String streamId,
BigInteger offset,
BigInteger length)
Retrieves the content stream that is associated with the given stream ID.
|
String |
getContentUrl()
Returns the content URL of the document if the binding supports content
URLs.
|
String |
getContentUrl(String streamId)
Returns the content URL of the document or a rendition if the binding
supports content URLs.
|
DocumentType |
getDocumentType()
Returns the object type as a document type.
|
Document |
getObjectOfLatestVersion(boolean major)
Fetches the latest major or minor version of this document.
|
Document |
getObjectOfLatestVersion(boolean major,
OperationContext context)
Fetches the latest major or minor version of this document using the
given
OperationContext . |
boolean |
isVersionable()
Returns whether the document is versionable or not.
|
Boolean |
isVersionSeriesPrivateWorkingCopy()
Determines whether this document is the PWC in the version series or not.
|
Document |
setContentStream(ContentStream contentStream,
boolean overwrite)
Sets a new content stream for the document and refreshes this object
afterwards.
|
ObjectId |
setContentStream(ContentStream contentStream,
boolean overwrite,
boolean refresh)
Sets a new content stream for the document.
|
addToFolder, getParents, getParents, getPaths, move, move, removeFromFolder
addAcl, applyAcl, applyPolicy, applyPolicy, delete, delete, getAcl, getAdapter, getAllowableActions, getExtensions, getPermissionsForPrincipal, getPolicies, getPolicyIds, getRefreshTimestamp, getRelationships, getRenditions, hasAllowableAction, refresh, refreshIfOld, removeAcl, removePolicy, removePolicy, rename, rename, setAcl, updateProperties, updateProperties, updateProperties, updateProperties
findObjectType, getBaseType, getBaseTypeId, getChangeToken, getCreatedBy, getCreationDate, getDescription, getLastModificationDate, getLastModifiedBy, getName, getProperties, getProperty, getPropertyValue, getSecondaryTypes, getType
getCheckinComment, getContentStreamFileName, getContentStreamHashes, getContentStreamId, getContentStreamLength, getContentStreamMimeType, getLatestAccessibleStateId, getVersionLabel, getVersionSeriesCheckedOutBy, getVersionSeriesCheckedOutId, getVersionSeriesId, isImmutable, isLatestMajorVersion, isLatestVersion, isMajorVersion, isPrivateWorkingCopy, isVersionSeriesCheckedOut
DocumentType getDocumentType()
ClassCastException
- if the object type is not a document typeboolean isVersionable()
true
if the document is versionable, false
if the
document is not versionable or if it's unknownBoolean isVersionSeriesPrivateWorkingCopy()
cmis:isVersionSeriesCheckedOut
,
cmis:isPrivateWorkingCopy
, and
cmis:versionSeriesCheckedOutId
and works for all CMIS versions.true
if it is the PWC, false
if it is not the
PWC, or null
if it can't be determinedDocumentProperties.isPrivateWorkingCopy()
void deleteAllVersions()
ContentStream getContentStream()
null
if the document has no
contentContentStream getContentStream(BigInteger offset, BigInteger length)
offset
- the offset of the stream or null
to read the stream
from the beginninglength
- the maximum length of the stream or null
to read to
the end of the streamnull
if the document has no
contentContentStream getContentStream(String streamId)
streamId
- the stream IDnull
if no content is associated
with this stream IDContentStream getContentStream(String streamId, BigInteger offset, BigInteger length)
streamId
- the stream IDoffset
- the offset of the stream or null
to read the stream
from the beginninglength
- the maximum length of the stream or null
to read to
the end of the streamnull
if no content is associated
with this stream IDString getContentUrl()
null
if the binding
does not support content URLsString getContentUrl(String streamId)
streamId
- the ID of the rendition or null
for the documentnull
if
the binding does not support content URLsDocument setContentStream(ContentStream contentStream, boolean overwrite)
The stream in contentStream
is consumed but not closed by this
method.
contentStream
- the content streamoverwrite
- if this parameter is set to false
and the document
already has content, the repository throws a
CmisContentAlreadyExistsException
null
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
ObjectId setContentStream(ContentStream contentStream, boolean overwrite, boolean refresh)
The stream in contentStream
is consumed but not closed by this
method.
contentStream
- the content streamoverwrite
- if this parameter is set to false
and the document
already has content, the repository throws a
CmisContentAlreadyExistsException
refresh
- if this parameter is set to true
, this object will be
refreshed after the new content has been setnull
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
Document appendContentStream(ContentStream contentStream, boolean isLastChunk)
The stream in contentStream
is consumed but not closed by this
method.
contentStream
- the content streamisLastChunk
- indicates if this stream is the last chunk of the contentnull
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
ObjectId appendContentStream(ContentStream contentStream, boolean isLastChunk, boolean refresh)
The stream in contentStream
is consumed but not closed by this
method.
contentStream
- the content streamisLastChunk
- indicates if this stream is the last chunk of the contentrefresh
- if this parameter is set to true
, this object will be
refreshed after the content stream has been appendednull
if the repository did not
return an object IDDocument deleteContentStream()
null
if the repository did not
return an object IDObjectId deleteContentStream(boolean refresh)
refresh
- if this parameter is set to true
, this object will be
refreshed after the content stream has been deletednull
if the repository did not
return an object IDOutputStream createOverwriteOutputStream(String filename, String mimeType)
OutputStream
stream object that can be used to
overwrite the current content of the document.filename
- the file namemimeType
- the MIME typeOutputStream createOverwriteOutputStream(String filename, String mimeType, int bufferSize)
OutputStream
stream object that can be used to
overwrite the current content of the document.filename
- the file namemimeType
- the MIME typebufferSize
- buffer size in bytesOutputStream createAppendOutputStream()
OutputStream
stream object that can be used to append
content the current content of the document.OutputStream createAppendOutputStream(int bufferSize)
OutputStream
stream object that can be used to append
content the current content of the document.bufferSize
- buffer size in bytesObjectId checkOut()
void cancelCheckOut()
ObjectId checkIn(boolean major, Map<String,?> properties, ContentStream contentStream, String checkinComment, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces)
contentStream
is consumed but not closed by this
method.ObjectId checkIn(boolean major, Map<String,?> properties, ContentStream contentStream, String checkinComment)
contentStream
is consumed but not closed by this
method.Document getObjectOfLatestVersion(boolean major)
major
- if true
the latest major version will be returned,
otherwise the very last version will be returnedDocument getObjectOfLatestVersion(boolean major, OperationContext context)
OperationContext
.major
- if true
the latest major version will be returned,
otherwise the very last version will be returnedList<Document> getAllVersions()
The behavior of this method is undefined if the document is not versionable and can be different for each repository.
cmis:creationDate
descending and preceded by the PWC, if
one exists, not null
List<Document> getAllVersions(OperationContext context)
OperationContext
.
The behavior of this method is undefined if the document is not versionable and can be different for each repository.
cmis:creationDate
descending and preceded by the PWC, if
one exists, not null
Document copy(ObjectId targetFolderId)
targetFolderId
- the ID of the target folder, null
to create an unfiled
documentDocument copy(ObjectId targetFolderId, Map<String,?> properties, VersioningState versioningState, List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs, OperationContext context)
targetFolderId
- the ID of the target folder, null
to create an unfiled
documentnull
if the parameter
context
was set to null
Copyright © 2009–2017 The Apache Software Foundation. All rights reserved.