DocumentsResource
Lists, uploads and links to the project's documents.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.24+fa54770
public final class DocumentsResourceLists, uploads and links to the project's documents. Get it from Ovok.documents().
Methods
list
public JsonNode list() throws IOException, InterruptedExceptionLists documents (GET /document).
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode list(Map<String, ?> parameters) throws IOException, InterruptedExceptionLists documents (GET /document?...).
Parameters:
parameters: query parameters added to the URL
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode list(
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionLists documents (GET /document?...).
Parameters:
parameters: query parameters added to the URLoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
createUpload
public JsonNode createUpload(Object body) throws IOException, InterruptedExceptionCreates a document and its upload (POST /document).
Parameters:
body: the document metadata, serialized as JSON
Returns: the created document with its upload details
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode createUpload(
Object body,
RequestOptions options) throws IOException, InterruptedExceptionCreates a document and its upload (POST /document).
Parameters:
body: the document metadata, serialized as JSONoptions: per-request options, such as the timeout
Returns: the created document with its upload details
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
replaceUpload
public JsonNode replaceUpload(
String documentId,
Object body) throws IOException, InterruptedExceptionStarts a new upload that replaces a document's file (POST /document/{documentId}).
Parameters:
documentId: the document idbody: the upload metadata, serialized as JSON
Returns: the document with its upload details
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode replaceUpload(
String documentId,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionStarts a new upload that replaces a document's file (POST /document/{documentId}).
Parameters:
documentId: the document idbody: the upload metadata, serialized as JSONoptions: per-request options, such as the timeout
Returns: the document with its upload details
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
updateMetadata
public JsonNode updateMetadata(
String documentId,
Object body) throws IOException, InterruptedExceptionUpdates a document's metadata (PATCH /document/{documentId}).
Parameters:
documentId: the document idbody: the fields to change, serialized as JSON
Returns: the updated document
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode updateMetadata(
String documentId,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionUpdates a document's metadata (PATCH /document/{documentId}).
Parameters:
documentId: the document idbody: the fields to change, serialized as JSONoptions: per-request options, such as the timeout
Returns: the updated document
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
delete
public JsonNode delete(String documentId) throws IOException, InterruptedExceptionDeletes a document (DELETE /document/{documentId}).
Parameters:
documentId: the document id
Returns: the response body, or null when it is empty
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode delete(
String documentId,
RequestOptions options) throws IOException, InterruptedExceptionDeletes a document (DELETE /document/{documentId}).
Parameters:
documentId: the document idoptions: per-request options, such as the timeout
Returns: the response body, or null when it is empty
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
downloadUrl
public String downloadUrl(String documentId)Builds the download URL of a document (GET /document/{documentId}); no request is sent.
Parameters:
documentId: the document id
Returns: the absolute URL
public String downloadUrl(String documentId, Map<String, ?> parameters)Builds the download URL of a document (GET /document/{documentId}?...); no request is sent.
Parameters:
documentId: the document idparameters: query parameters added to the URL
Returns: the absolute URL
publicDownloadUrl
public String publicDownloadUrl(String publicToken)Builds the public download URL for a share token (GET /document/public/{publicToken}); no request is sent.
Parameters:
publicToken: the document's public share token
Returns: the absolute URL
public String publicDownloadUrl(String publicToken, Map<String, ?> parameters)Builds the public download URL for a share token (GET /document/public/{publicToken}?...); no request is sent.
Parameters:
publicToken: the document's public share tokenparameters: query parameters added to the URL
Returns: the absolute URL
Last updated on