Package com.logicaldoc.google
Class DriveClient
java.lang.Object
com.logicaldoc.google.GoogleClient
com.logicaldoc.google.DriveClient
Facade for Google Drive.
To handle the API: https://console.developers.google.com
- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(com.google.api.client.auth.oauth2.Credential credential) Connects to remote APIvoid
convertFile
(String fileId, File dest) createFolder
(String name) void
deleteFile
(String fileId) void
downloadFile
(String fileId, File dest) static DriveClient
get
(long userId) com.google.api.services.drive.model.File
boolean
Checks if the client is connected to the remote APIList
<com.google.api.services.drive.model.File> uploadFile
(com.google.api.client.http.AbstractInputStreamContent mediaContent, String fileName, boolean convert) uploadFile
(File file, String fileName, boolean convert) uploadFile
(InputStream is, String fileName, boolean convert) Methods inherited from class com.logicaldoc.google.GoogleClient
getUserId, loadSettings
-
Method Details
-
get
public static DriveClient get(long userId) throws com.logicaldoc.core.PersistenceException, com.logicaldoc.util.security.StringEncrypter.EncryptionException, IOException - Throws:
com.logicaldoc.core.PersistenceException
com.logicaldoc.util.security.StringEncrypter.EncryptionException
IOException
-
isConnected
public boolean isConnected()Description copied from class:GoogleClient
Checks if the client is connected to the remote API- Specified by:
isConnected
in classGoogleClient
- Returns:
- true only if it is connected
-
getFile
- Throws:
IOException
-
uploadFile
- Throws:
IOException
-
uploadFile
- Throws:
IOException
-
uploadFile
public String uploadFile(com.google.api.client.http.AbstractInputStreamContent mediaContent, String fileName, boolean convert) throws IOException - Throws:
IOException
-
create
- Throws:
IOException
-
createFolder
- Throws:
IOException
-
downloadFile
- Throws:
IOException
-
convertFile
- Throws:
IOException
-
deleteFile
- Throws:
IOException
-
search
- Throws:
IOException
-
connect
public void connect(com.google.api.client.auth.oauth2.Credential credential) Description copied from class:GoogleClient
Connects to remote API- Specified by:
connect
in classGoogleClient
- Parameters:
credential
- the credentials to use
-