Class JCRLocalDropboxDrive.DropboxDrive
- java.lang.Object
-
- org.exoplatform.clouddrive.dropbox.JCRLocalDropboxDrive.DropboxDrive
-
- Enclosing class:
- JCRLocalDropboxDrive
protected class JCRLocalDropboxDrive.DropboxDrive extends Object
The Class DropboxDrive.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJCRLocalDropboxDrive.DropboxDrive.LocalItem
-
Constructor Summary
Constructors Modifier Constructor Description protectedDropboxDrive(DropboxAPI api, javax.jcr.Node rootNode)Instantiates a new drive tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidclose()Close the tree and cleanup its temporal resources.JCRLocalDropboxDrive.DropboxDrive.LocalItemfindByLocalPath(String jcrPath)Find local item by its path in the storage (JCR).protected javax.jcr.NodefindDropboxNode(String dbxPath)Deprecated.JCRLocalDropboxDrive.DropboxDrive.LocalItemgetItem(String dbxPath)Gets the local item.StringgetLocalPath(String dbxPath)Construct a JCR path of an item from given Dropbox path.StringgetRemotePath(String jcrPath)Construct a Dropbox path of an item from given JCR path.protected JCRLocalDropboxDrive.DropboxDrive.LocalItemreadItem(String dbxPath)Read item from local storage.javax.jcr.Noderestore(javax.jcr.Node node)Restore given node at a Dropbox path saved in it or remove the node if it's a connected cloud file.
-
-
-
Field Detail
-
api
protected final DropboxAPI api
Cloud drive API.
-
rootNode
protected final javax.jcr.Node rootNode
The root node of the tree.
-
-
Constructor Detail
-
DropboxDrive
protected DropboxDrive(DropboxAPI api, javax.jcr.Node rootNode)
Instantiates a new drive tree.- Parameters:
api- the apirootNode- the root node
-
-
Method Detail
-
close
protected void close()
Close the tree and cleanup its temporal resources.
-
getRemotePath
public String getRemotePath(String jcrPath) throws javax.jcr.RepositoryException
Construct a Dropbox path of an item from given JCR path.- Parameters:
jcrPath- the JCR path- Returns:
- the remote path
- Throws:
javax.jcr.RepositoryException- the repository exception
-
getLocalPath
public String getLocalPath(String dbxPath) throws javax.jcr.RepositoryException
Construct a JCR path of an item from given Dropbox path.- Parameters:
dbxPath- the dbx path- Returns:
- the local path
- Throws:
javax.jcr.RepositoryException- the repository exception
-
findByLocalPath
public JCRLocalDropboxDrive.DropboxDrive.LocalItem findByLocalPath(String jcrPath) throws javax.jcr.RepositoryException
Find local item by its path in the storage (JCR). If given path outside the drive root node thennullwill be returned.- Parameters:
jcrPath- the JCR path- Returns:
- the local item or
nullof path outside the drive root node - Throws:
javax.jcr.RepositoryException- the repository exception
-
getItem
public JCRLocalDropboxDrive.DropboxDrive.LocalItem getItem(String dbxPath) throws javax.jcr.RepositoryException
Gets the local item.- Parameters:
dbxPath- the Dropbox path- Returns:
- the local item of type
JCRLocalDropboxDrive.DropboxDrive.LocalItem, nevernull - Throws:
javax.jcr.RepositoryException- the repository exception
-
readItem
protected JCRLocalDropboxDrive.DropboxDrive.LocalItem readItem(String dbxPath) throws javax.jcr.RepositoryException
Read item from local storage.- Parameters:
dbxPath- the Dropbox path- Returns:
- the node location
- Throws:
javax.jcr.RepositoryException- the repository exception
-
findDropboxNode
@Deprecated protected javax.jcr.Node findDropboxNode(String dbxPath) throws javax.jcr.RepositoryException
Deprecated.Find node by Dropbox dbxPath property.- Parameters:
dbxPath- the Dropbox dbxPath- Returns:
- the node
- Throws:
javax.jcr.RepositoryException- the repository exception
-
restore
public javax.jcr.Node restore(javax.jcr.Node node) throws javax.jcr.RepositoryExceptionRestore given node at a Dropbox path saved in it or remove the node if it's a connected cloud file.- Parameters:
node- the node- Returns:
- the node or
nullif node cannot be found or was removed - Throws:
javax.jcr.RepositoryException- the repository exception
-
-