public class DocumentManager extends Object
| Constructor and Description |
|---|
DocumentManager(@NotNull RestSession session)
Initializes a document manager for the given
RestSession. |
| Modifier and Type | Method and Description |
|---|---|
RestDocument |
activateHistory(@NotNull String documentId,
int historyId)
Activates a history entry for the
RestDocument |
void |
deleteDocument(@NotNull String documentId)
Deletes the given
RestDocument from the webPDF server by given documentId. |
void |
downloadDocument(@Nullable RestDocument document,
@Nullable OutputStream outputStream)
Deprecated.
|
void |
downloadDocument(@NotNull String documentId,
@Nullable OutputStream outputStream)
Downloads
RestDocument referenced by document id from server and stores the content in the OutputStream |
@NotNull RestDocument |
findDocument(@NotNull String documentId)
Returns the
RestDocument from the internal document map, by given documentId. |
@NotNull RestDocument |
getDocument(@Nullable DocumentFileBean documentFileBean)
Deprecated.
|
@NotNull List<RestDocument> |
getDocuments()
Gets a copy of all
List<RestDocument> from the internal document map. |
boolean |
hasDocument(@NotNull String documentId)
Checks, if a
RestDocument with a given id exists in the list of documents |
boolean |
isUseHistory()
checks if the creation of a document history is active
|
@NotNull RestDocument |
renameDocument(@NotNull String documentId,
@Nullable String fileName)
Renames the
RestDocument on the webPDF server, by given documentId, to the given filename. |
void |
setUseHistory(boolean useHistory)
De/Activates the creation of a document history
|
void |
sync()
Syncs the list of
RestDocument with the server. |
void |
updateHistoryForDocument(@NotNull String documentId)
Updates the history entries for the
RestDocument referenced by the document id |
RestDocument |
updateHistoryOperation(@NotNull String documentId,
int historyId,
@NotNull String operation)
Updates the operation value for a history entry in a
RestDocument |
@NotNull RestDocument |
uploadDocument(@Nullable File file)
Uploads the given
File to the server and returns the RestDocument reference
to the uploaded resource. |
public DocumentManager(@NotNull
@NotNull RestSession session)
RestSession.session - The RestSession a document manager shall be created for.@Deprecated public void downloadDocument(@Nullable @Nullable RestDocument document, @Nullable @Nullable OutputStream outputStream) throws ResultException
SoapDocument or RestDocument to target pathdocument - SoapDocument or RestDocument instanceoutputStream - OutputStream for downloaded contentResultException - a ResultExceptionpublic void downloadDocument(@NotNull
@NotNull String documentId,
@Nullable
@Nullable OutputStream outputStream)
throws ResultException
RestDocument referenced by document id from server and stores the content in the OutputStreamdocumentId - The document id of the RestDocumentoutputStream - OutputStream for downloaded contentResultException - a ResultException@NotNull public @NotNull RestDocument uploadDocument(@Nullable @Nullable File file) throws IOException
File to the server and returns the RestDocument reference
to the uploaded resource.file - The file, that shall be uploaded for further processing.RestDocument referencing the uploaded document.IOException - an IOException@NotNull public @NotNull RestDocument findDocument(@NotNull @NotNull String documentId) throws ResultException
RestDocument from the internal document map, by given documentId.documentId - The document id of the RestDocument that shall be returned.RestDocument referencing the uploaded resource.ResultException - if RestDocument wasn't found in the internal document mappublic boolean hasDocument(@NotNull
@NotNull String documentId)
RestDocument with a given id exists in the list of documentsdocumentId - id to search in the list of RestDocument@NotNull @Deprecated public @NotNull RestDocument getDocument(@Nullable @Nullable DocumentFileBean documentFileBean) throws ResultException
RestDocument from the internal document map, by given DocumentFileBean or if the
Document doesn't exist create a new entry from the given DocumentFileBeandocumentFileBean - The DocumentFileBean, that shall be returned or added for further processing.RestDocument referencing the uploaded resource.ResultException - a ResultExceptionpublic void deleteDocument(@NotNull
@NotNull String documentId)
throws ResultException
RestDocument from the webPDF server by given documentId.documentId - The document id of the RestDocument that shall be deleted.ResultException - If document does not exist@NotNull public @NotNull RestDocument renameDocument(@NotNull @NotNull String documentId, @Nullable @Nullable String fileName) throws IOException
RestDocument on the webPDF server, by given documentId, to the given filename.documentId - The document id of the RestDocument that shall be renamed.fileName - The new file nameRestDocument referencing the renamed resource.ResultException - a ResultExceptionIOExceptionpublic void updateHistoryForDocument(@NotNull
@NotNull String documentId)
throws ResultException
RestDocument referenced by the document iddocumentId - The document id of the RestDocumentResultException - When a document with the given document id does not existpublic RestDocument activateHistory(@NotNull @NotNull String documentId, int historyId) throws ResultException
RestDocumentdocumentId - unique document idhistoryId - unique history id to activateResultException - unable to change historypublic RestDocument updateHistoryOperation(@NotNull @NotNull String documentId, int historyId, @NotNull @NotNull String operation) throws ResultException
RestDocumentdocumentId - unique document idhistoryId - unique history id to activateResultException - unable to change historypublic void sync()
throws ResultException
RestDocument with the server. Clears the internal lists and loads all RestDocument
again from the sever. This is e.g. used, when calling a login on RestSession with an existing TokenResultException - a ResultException@NotNull public @NotNull List<RestDocument> getDocuments()
List<RestDocument> from the internal document map.List referencing the RestDocuments.public boolean isUseHistory()
public void setUseHistory(boolean useHistory)
useHistory - De/Activates the creation of a document historyCopyright © 2017–2020 SoftVision Development GmbH, Fulda, Germany. All rights reserved.