Class RestWebServiceDocument
- java.lang.Object
-
- net.webpdf.wsclient.session.documents.AbstractDocument
-
- net.webpdf.wsclient.session.rest.documents.RestWebServiceDocument
-
- All Implemented Interfaces:
Document,RestDocument
public class RestWebServiceDocument extends AbstractDocument implements RestDocument
An instance of
RestWebServiceDocumentrepresents a document, that has been uploaded to a webPDF server.
-
-
Method Summary
-
Methods inherited from class net.webpdf.wsclient.session.documents.AbstractDocument
getSource, isFileSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.webpdf.wsclient.session.documents.Document
getSource, isFileSource
-
-
-
-
Method Detail
-
getDocumentId
@NotNull public @NotNull String getDocumentId()
Returns the document ID of the managedRestDocument.- Specified by:
getDocumentIdin interfaceRestDocument- Returns:
- The document ID of the managed
RestDocument.
-
getDocumentFile
@NotNull public @NotNull DocumentFile getDocumentFile()
Returns theDocumentFileof the managedRestDocument.- Specified by:
getDocumentFilein interfaceRestDocument- Returns:
- The
DocumentFileof the managedRestDocument.
-
getHistory
@NotNull public @NotNull List<HistoryEntry> getHistory()
Returns theHistoryEntrys of the managedRestDocument.- Specified by:
getHistoryin interfaceRestDocument- Returns:
- The
HistoryEntrys of the managedRestDocument.
-
getHistoryEntry
@NotNull public @NotNull HistoryEntry getHistoryEntry(int historyId) throws ResultException
Returns aHistoryEntryfrom the internal history map, by given history ID.- Specified by:
getHistoryEntryin interfaceRestDocument- Parameters:
historyId- The history ID of theHistoryEntrythat shall be returned.- Returns:
- A
HistoryEntryrepresenting a historic state of the uploaded resource. - Throws:
ResultException- Shall be thrown, should accessing the document history fail.
-
downloadDocument
public void downloadDocument(@NotNull @NotNull OutputStream target) throws ResultExceptionThis is a shortcut forDocumentManager.downloadDocument(String, OutputStream)and Attempts to download and write theRestDocumentto the givenOutputStream.- Specified by:
downloadDocumentin interfaceRestDocument- Parameters:
target- The targetOutputStreamtheRestDocumentshall be written to.- Throws:
ResultException- Shall be thrown, should writing the result document fail.
-
downloadDocument
public void downloadDocument(@NotNull @NotNull File target) throws ResultExceptionThis is a shortcut forDocumentManager.downloadDocument(String, OutputStream)and Attempts to download write theRestDocumentto the givenFile.- Specified by:
downloadDocumentin interfaceRestDocument- Parameters:
target- The targetFiletheRestDocumentshall be written to.- Throws:
ResultException- Shall be thrown, should writing the result document fail.
-
deleteDocument
public void deleteDocument() throws ResultExceptionThis is a shortcut forDocumentManager.deleteDocument(java.lang.String)and deletes theRestDocument.- Specified by:
deleteDocumentin interfaceRestDocument- Throws:
ResultException- Shall be thrown, should deleting the document fail.
-
renameDocument
@NotNull public @NotNull RestDocument renameDocument(@NotNull @NotNull String fileName) throws ResultException
This is a shortcut forDocumentManager.renameDocument(java.lang.String, java.lang.String)and renames theRestDocument.- Specified by:
renameDocumentin interfaceRestDocument- Parameters:
fileName- The new name for theRestDocument.- Returns:
- The resulting
RestDocumenthandle. - Throws:
ResultException- Shall be thrown, should renaming the document have failed.
-
updateDocumentSecurity
public RestDocument updateDocumentSecurity(@NotNull @NotNull PdfPasswordType passwordType) throws ResultException
This is a shortcut forDocumentManager.renameDocument(java.lang.String, java.lang.String)and updates the security information theRestDocument.- Specified by:
updateDocumentSecurityin interfaceRestDocument- Parameters:
passwordType- The security information to update the document with- Returns:
- The updated
RestDocument. - Throws:
ResultException- Shall be thrown, should updating the document security have failed.
-
getDocumentInfo
public DocumentInfo getDocumentInfo(@NotNull @NotNull DocumentInfoType infoType) throws ResultException
This is a shortcut forDocumentManager.renameDocument(java.lang.String, java.lang.String)and returnsDocumentInfoabout theRestDocument.- Specified by:
getDocumentInfoin interfaceRestDocument- Parameters:
infoType- Detailed information for the document referenced by the unique documentId in the server“s document storage.- Returns:
- The requested document
DocumentInfo - Throws:
ResultException- Shall be thrown, should fetching the document info have failed.
-
extractDocument
public List<RestWebServiceDocument> extractDocument(@NotNull @NotNull DocumentFileExtract fileExtract) throws ResultException
This is a shortcut forDocumentManager.extractDocument(java.lang.String, net.webpdf.wsclient.openapi.DocumentFileExtract)and extracts theRestDocument.- Specified by:
extractDocumentin interfaceRestDocument- Parameters:
fileExtract-DocumentFileExtractsettings for unpacking the archive document.- Returns:
- A list of the extracted
RestDocuments. - Throws:
ResultException- Shall be thrown, should the extraction have failed.
-
-