Package com.logicaldoc.gdrive
Class GDriveClient
java.lang.Object
com.logicaldoc.gdrive.GDriveClient
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) void
convertFile
(String fileId, File dest) createFolder
(String name) void
deleteFile
(String fileId) void
downloadFile
(String fileId, File dest) static GDriveClient
get
(long userId) com.google.api.client.auth.oauth2.Credential
com.google.api.services.drive.model.File
long
boolean
List<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)
-
Method Details
-
get
public static GDriveClient get(long userId) throws com.logicaldoc.core.PersistenceException, com.logicaldoc.gui.common.client.ServerException, com.logicaldoc.util.security.StringEncrypter.EncryptionException, IOException - Throws:
com.logicaldoc.core.PersistenceException
com.logicaldoc.gui.common.client.ServerException
com.logicaldoc.util.security.StringEncrypter.EncryptionException
IOException
-
isConnected
public boolean isConnected() -
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
-
getCredential
public com.google.api.client.auth.oauth2.Credential getCredential() -
connect
public void connect(com.google.api.client.auth.oauth2.Credential credential) -
getUserId
public long getUserId()
-