Class JCRLocalDropboxDrive.FileAPI
- java.lang.Object
-
- org.exoplatform.clouddrive.dropbox.JCRLocalDropboxDrive.FileAPI
-
- All Implemented Interfaces:
org.exoplatform.services.cms.clouddrives.CloudFileAPI
- Enclosing class:
- JCRLocalDropboxDrive
protected class JCRLocalDropboxDrive.FileAPI extends Object
CloudFileAPIimplementation for Dropbox synchronization.
-
-
Field Summary
Fields Modifier and Type Field Description protected DropboxAPIapiInternal API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JCRLocalDropboxDrive.MetadataInfocopy(javax.jcr.Node sourceNode, javax.jcr.Node destNode)Copy.org.exoplatform.services.cms.clouddrives.CloudFilecopyFile(javax.jcr.Node srcFileNode, javax.jcr.Node destFileNode)org.exoplatform.services.cms.clouddrives.CloudFilecopyFolder(javax.jcr.Node srcFolderNode, javax.jcr.Node destFolderNode)org.exoplatform.services.cms.clouddrives.CloudFilecreateFile(javax.jcr.Node fileNode, Calendar created, Calendar modified, String mimeType, InputStream content)org.exoplatform.services.cms.clouddrives.CloudFilecreateFolder(javax.jcr.Node folderNode, Calendar created)protected StringgetRev(javax.jcr.Node fileNode)Gets the rev.booleanisTrashSupported()protected JCRLocalDropboxDrive.MetadataInfomove(javax.jcr.Node node)Move remote file to hierarchy of given node.booleanremoveFile(String id)booleanremoveFolder(String id)protected voidresetSharing(javax.jcr.Node fileNode)Reset Dropbox file direct/shared link to force generation of a new one within new dbxPath.org.exoplatform.services.cms.clouddrives.CloudFilerestore(String id, String nodePath)booleantrashFile(String id)booleantrashFolder(String id)org.exoplatform.services.cms.clouddrives.CloudFileuntrashFile(javax.jcr.Node fileNode)org.exoplatform.services.cms.clouddrives.CloudFileuntrashFolder(javax.jcr.Node folderNode)org.exoplatform.services.cms.clouddrives.CloudFileupdateFile(javax.jcr.Node fileNode, Calendar modified)org.exoplatform.services.cms.clouddrives.CloudFileupdateFileContent(javax.jcr.Node fileNode, Calendar modified, String mimeType, InputStream content)org.exoplatform.services.cms.clouddrives.CloudFileupdateFolder(javax.jcr.Node folderNode, Calendar modified)protected voidupdateSubtree(javax.jcr.Node folderNode)Update subtree for Dropbox properties saved in the nodes.protected org.exoplatform.services.cms.clouddrives.CloudFileuploadFile(javax.jcr.Node fileNode, Calendar created, Calendar modified, String mimeType, InputStream content, boolean update)Upload file.
-
-
-
Field Detail
-
api
protected final DropboxAPI api
Internal API.
-
-
Method Detail
-
createFile
public org.exoplatform.services.cms.clouddrives.CloudFile createFile(javax.jcr.Node fileNode, Calendar created, Calendar modified, String mimeType, InputStream content) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
createFolder
public org.exoplatform.services.cms.clouddrives.CloudFile createFolder(javax.jcr.Node folderNode, Calendar created) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
updateFile
public org.exoplatform.services.cms.clouddrives.CloudFile updateFile(javax.jcr.Node fileNode, Calendar modified) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
updateFolder
public org.exoplatform.services.cms.clouddrives.CloudFile updateFolder(javax.jcr.Node folderNode, Calendar modified) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
updateFileContent
public org.exoplatform.services.cms.clouddrives.CloudFile updateFileContent(javax.jcr.Node fileNode, Calendar modified, String mimeType, InputStream content) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
copyFile
public org.exoplatform.services.cms.clouddrives.CloudFile copyFile(javax.jcr.Node srcFileNode, javax.jcr.Node destFileNode) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
copyFolder
public org.exoplatform.services.cms.clouddrives.CloudFile copyFolder(javax.jcr.Node srcFolderNode, javax.jcr.Node destFolderNode) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
removeFile
public boolean removeFile(String id) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
removeFolder
public boolean removeFolder(String id) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
trashFile
public boolean trashFile(String id) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
trashFolder
public boolean trashFolder(String id) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
untrashFile
public org.exoplatform.services.cms.clouddrives.CloudFile untrashFile(javax.jcr.Node fileNode) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
untrashFolder
public org.exoplatform.services.cms.clouddrives.CloudFile untrashFolder(javax.jcr.Node folderNode) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
isTrashSupported
public boolean isTrashSupported()
-
restore
public org.exoplatform.services.cms.clouddrives.CloudFile restore(String id, String nodePath) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryException
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveExceptionjavax.jcr.RepositoryException
-
getRev
protected String getRev(javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
Gets the rev.- Parameters:
fileNode- the file node- Returns:
- the rev
- Throws:
javax.jcr.RepositoryException- the repository exception
-
uploadFile
protected org.exoplatform.services.cms.clouddrives.CloudFile uploadFile(javax.jcr.Node fileNode, Calendar created, Calendar modified, String mimeType, InputStream content, boolean update) throws org.exoplatform.services.cms.clouddrives.CloudDriveException, javax.jcr.RepositoryExceptionUpload file.- Parameters:
fileNode- the file nodecreated- the createdmodified- the modifiedmimeType- the mime typecontent- the contentupdate- the update- Returns:
- the cloud file
- Throws:
org.exoplatform.services.cms.clouddrives.CloudDriveException- the cloud drive exceptionjavax.jcr.RepositoryException- the repository exception
-
move
protected JCRLocalDropboxDrive.MetadataInfo move(javax.jcr.Node node) throws javax.jcr.RepositoryException, DropboxException, org.exoplatform.services.cms.clouddrives.RefreshAccessException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.NotAcceptableException, org.exoplatform.services.cms.clouddrives.RetryLaterException
Move remote file to hierarchy of given node.- Parameters:
node- the node- Returns:
- the
JCRLocalDropboxDrive.MetadataInfoinstance - Throws:
javax.jcr.RepositoryException- the repository exceptionDropboxException- the dropbox exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.NotAcceptableException- the not acceptable exceptionorg.exoplatform.services.cms.clouddrives.RetryLaterException- the retry later exception
-
updateSubtree
protected void updateSubtree(javax.jcr.Node folderNode) throws javax.jcr.RepositoryExceptionUpdate subtree for Dropbox properties saved in the nodes.- Parameters:
folderNode- the folder node- Throws:
javax.jcr.RepositoryException- the repository exception
-
resetSharing
protected void resetSharing(javax.jcr.Node fileNode) throws javax.jcr.RepositoryExceptionReset Dropbox file direct/shared link to force generation of a new one within new dbxPath. It is a required step when copying or moving file - Dropbox maintains links respectively the file location.- Parameters:
fileNode- the file node- Throws:
javax.jcr.RepositoryException- the repository exception
-
copy
protected JCRLocalDropboxDrive.MetadataInfo copy(javax.jcr.Node sourceNode, javax.jcr.Node destNode) throws javax.jcr.RepositoryException, DropboxException, org.exoplatform.services.cms.clouddrives.RefreshAccessException, org.exoplatform.services.cms.clouddrives.ConflictException, org.exoplatform.services.cms.clouddrives.NotFoundException, org.exoplatform.services.cms.clouddrives.RetryLaterException, org.exoplatform.services.cms.clouddrives.NotAcceptableException
Copy.- Parameters:
sourceNode- the source nodedestNode- the dest node- Returns:
- the dbx entry
- Throws:
javax.jcr.RepositoryException- the repository exceptionDropboxException- the dropbox exceptionorg.exoplatform.services.cms.clouddrives.RefreshAccessException- the refresh access exceptionorg.exoplatform.services.cms.clouddrives.ConflictException- the conflict exceptionorg.exoplatform.services.cms.clouddrives.NotFoundException- the not found exceptionorg.exoplatform.services.cms.clouddrives.RetryLaterException- the retry later exceptionorg.exoplatform.services.cms.clouddrives.NotAcceptableException- the not acceptable exception
-
-