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 TypeMethodDescriptionvoidconnect(com.google.api.client.auth.oauth2.Credential credential) voidconvertFile(String fileId, File dest) createFolder(String name) voiddeleteFile(String fileId) voiddownloadFile(String fileId, File dest) static GDriveClientget(long userId) com.google.api.client.auth.oauth2.Credentialcom.google.api.services.drive.model.FilelongbooleanList<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.PersistenceExceptioncom.logicaldoc.gui.common.client.ServerExceptioncom.logicaldoc.util.security.StringEncrypter.EncryptionExceptionIOException
-
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()
-