Package com.logicaldoc.zoho
Class ZohoClient
java.lang.Object
com.logicaldoc.zoho.ZohoClient
Facade for Zoho Docs.
- Since:
- 8.7
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Callback URI that Zoho will redirect to after successful authentication -
Method Summary
Modifier and TypeMethodDescriptioncreateDocument
(String folderId, String filename) Creates a new document in Zoho.createFolder
(String parentId, String name) void
void
static ZohoClient
get
(long userId) getDocument
(String docId) Gets the details of a document stored in Zoholong
Lists the files inside a given folderlistFolders
(String parentId) void
obtainAccessToken
(String grantCode) void
void
setClientId
(String clientId) void
setClientSecret
(String clientSecret) Upload an existing file to the Zohoupload
(String filename, InputStream content, String folderId) Upload an existing file to the Zoho
-
Field Details
-
CALLBACK_PATH
Callback URI that Zoho will redirect to after successful authentication- See Also:
-
-
Method Details
-
get
- Throws:
ZohoException
-
saveSettings
- Throws:
ZohoException
-
loadSettings
- Throws:
ZohoException
-
buildAuthorizationUrl
- Throws:
ZohoException
-
obtainAccessToken
- Throws:
ZohoException
-
listFiles
public List<com.logicaldoc.util.Pair<String,String>> listFiles(String folderId) throws ZohoException Lists the files inside a given folder- Parameters:
folderId
- identifier of the folder or null for the root- Returns:
- List of pairs docId-fileName
- Throws:
ZohoException
- A generic exception communicating with Zoho
-
listFolders
public List<com.logicaldoc.util.Pair<String,String>> listFolders(String parentId) throws ZohoException - Throws:
ZohoException
-
createFolder
public com.logicaldoc.util.Pair<String,String> createFolder(String parentId, String name) throws ZohoException - Throws:
ZohoException
-
delete
- Throws:
ZohoException
-
createDocument
public com.logicaldoc.util.Pair<String,String> createDocument(String folderId, String filename) throws ZohoException Creates a new document in Zoho.- Parameters:
filename
- The file namefolderId
- The parent folder ID- Returns:
- the ID of the new document and the URL to open
- Throws:
ZohoException
- error in the Zoho server
-
download
- Throws:
ZohoException
-
upload
public com.logicaldoc.util.Pair<String,String> upload(String filename, File file, String folderId) throws ZohoException Upload an existing file to the Zoho- Parameters:
filename
- name of the file to uploadfile
- the file to uploadfolderId
- identifier of the target folder- Returns:
- a pair document ID - document name
- Throws:
ZohoException
- An error communicating with Zoho
-
upload
public com.logicaldoc.util.Pair<String,String> upload(String filename, InputStream content, String folderId) throws ZohoException Upload an existing file to the Zoho- Parameters:
filename
- name of the file to uploadcontent
- the file's contentfolderId
- identifier of the target folder- Returns:
- a pair document ID - document name
- Throws:
ZohoException
- An error communicating with Zoho
-
getDocument
Gets the details of a document stored in Zoho- Parameters:
docId
- identifier of the document in Zoho- Returns:
- a pair document ID - document name
- Throws:
ZohoException
- An error communicating with Zoho
-
getUserId
public long getUserId() -
getClientId
-
setClientId
-
getClientSecret
-
setClientSecret
-
getAccessToken
-