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 TypeMethodDescriptionvoidconnect(com.google.api.client.auth.oauth2.Credential credential) Connects to remote APIvoidconvertFile(String fileId, File dest) createFolder(String name) voiddeleteFile(String fileId) voiddownloadFile(String fileId, File dest) static DriveClientget(long userId) com.google.api.services.drive.model.FilebooleanChecks 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.PersistenceExceptioncom.logicaldoc.util.security.StringEncrypter.EncryptionExceptionIOException
-
isConnected
public boolean isConnected()Description copied from class:GoogleClientChecks if the client is connected to the remote API- Specified by:
isConnectedin 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:GoogleClientConnects to remote API- Specified by:
connectin classGoogleClient- Parameters:
credential- the credentials to use
-