Package com.logicaldoc.dropbox
Class Dropbox
- java.lang.Object
-
- com.logicaldoc.dropbox.Dropbox
-
public class Dropbox extends Object
Our Dropbox facade- Since:
- 7.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description Dropbox()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandownloadFile(String path, File out)List<com.dropbox.core.v2.files.FileMetadata>find(String basePath, String query)StringfinishAuthorization(String authorizationCode)Finishes the authorization process.com.dropbox.core.v2.files.Metadataget(String path)StringgetAccessToken()StringgetAccountName()List<com.dropbox.core.v2.files.Metadata>list(String path)List<com.dropbox.core.v2.files.FileMetadata>listFilesInTree(String basePath)booleanlogin(String accessToken)StringstartAuthorization(Locale locale)Generates the authorization URL where the user has to allow LogicalDOC and gets an authorization code to be used then with finishAuthorization.booleanuploadFile(File inputFile, String path)
-
-
-
Method Detail
-
login
public boolean login(String accessToken)
-
startAuthorization
public String startAuthorization(Locale locale)
Generates the authorization URL where the user has to allow LogicalDOC and gets an authorization code to be used then with finishAuthorization.- Parameters:
locale- the user's locale- Returns:
- The page to be shown to the user to allow the app to access
-
finishAuthorization
public String finishAuthorization(String authorizationCode)
Finishes the authorization process. The returned access token can be saved for future use.- Parameters:
authorizationCode- The authorization code that the user see in the authorization page- Returns:
- The access token
-
list
public List<com.dropbox.core.v2.files.Metadata> list(String path) throws com.dropbox.core.v2.files.ListFolderErrorException, com.dropbox.core.DbxException
- Throws:
com.dropbox.core.v2.files.ListFolderErrorExceptioncom.dropbox.core.DbxException
-
listFilesInTree
public List<com.dropbox.core.v2.files.FileMetadata> listFilesInTree(String basePath) throws com.dropbox.core.DbxException
- Throws:
com.dropbox.core.DbxException
-
find
public List<com.dropbox.core.v2.files.FileMetadata> find(String basePath, String query) throws com.dropbox.core.DbxException
- Throws:
com.dropbox.core.DbxException
-
get
public com.dropbox.core.v2.files.Metadata get(String path) throws com.dropbox.core.DbxException
- Throws:
com.dropbox.core.DbxException
-
downloadFile
public boolean downloadFile(String path, File out) throws IOException
- Throws:
IOException
-
uploadFile
public boolean uploadFile(File inputFile, String path) throws IOException
- Throws:
IOException
-
getAccountName
public String getAccountName()
-
getAccessToken
public String getAccessToken()
-
-