Package com.onfido
Class DocumentManager
- java.lang.Object
-
- com.onfido.api.ResourceManager
-
- com.onfido.DocumentManager
-
public class DocumentManager extends ResourceManager
Manager class for the Document resource type. Contains resource-specific methods for interacting with the API.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDocumentManager(Config config, okhttp3.OkHttpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileDownloaddownload(String documentId)Downloads specific documents belonging to an applicant.Documentfind(String documentId)Retrieves a single document.List<Document>list(String applicantId)Lists all documents belonging to an applicant.Documentupload(InputStream inputStream, String fileName, Document.Request request)Uploads a document as part of a multipart request.-
Methods inherited from class com.onfido.api.ResourceManager
addFormDataParam, deleteRequest, downloadRequest, get, post, put, readInputStream, uploadRequest
-
-
-
-
Constructor Detail
-
DocumentManager
protected DocumentManager(Config config, okhttp3.OkHttpClient client)
-
-
Method Detail
-
upload
public Document upload(InputStream inputStream, String fileName, Document.Request request) throws IOException, OnfidoException
Uploads a document as part of a multipart request.- Parameters:
inputStream- the content from the desired file as an InputStreamfileName- the file name, including the file extensionrequest- the request body- Returns:
- the Document
- Throws:
IOException- the io exceptionOnfidoException- the onfido exception
-
download
public FileDownload download(String documentId) throws OnfidoException
Downloads specific documents belonging to an applicant.- Parameters:
documentId- the document id- Returns:
- the downloaded file as a FileDownload
- Throws:
OnfidoException- the onfido exception
-
find
public Document find(String documentId) throws OnfidoException
Retrieves a single document.- Parameters:
documentId- the document id- Returns:
- the Document
- Throws:
OnfidoException- the onfido exception
-
list
public List<Document> list(String applicantId) throws OnfidoException
Lists all documents belonging to an applicant.- Parameters:
applicantId- the applicant id- Returns:
- the list of Documents
- Throws:
OnfidoException- the onfido exception
-
-