public class DropBoxFileSystem extends FileSystem
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
DropBoxFileSystem()
Enables access to DropBox with the access token supplied through a
CredentialsResolver (see setCredentialsResolver(CredentialsResolver)). |
DropBoxFileSystem(String token) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the DropBox connection.
|
List<Metadata> |
listFolder(String folderName)
Returns an list of all DropBox files and folders belonging to the
folderName. |
List<Metadata> |
listRootFolder()
Returns a
List of all DropBox files and folders in the root folder. |
void |
open()
Opens a connection to the DropBox file system.
|
InputStream |
readFile(String fileName)
Reads the file in the DropBox root folder.
|
InputStream |
readFile(String folderName,
String fileName)
Reads the file in the specified DropBox folder.
|
DropBoxFileSystem |
setCredentialsResolver(CredentialsResolver credentialsResolver)
Sets the resolver supplying this file system's access token (
Credentials.TOKEN) —
resolved on each open(), never at construction, so rotated tokens are picked up on
the next connection. |
OutputStream |
writeFile(String fileName)
Writes the file to the DropBox File System.
|
OutputStream |
writeFile(String folderName,
String fileName)
Writes the file to the specified folder in the DropBox File System.
|
credentialValue, getCredentialsResolver, getCurrentCredentials, refreshCredentials, resolveCredentialsaddElapsedtime, addExceptionProperties, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getNestedEndpoint, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getRootEndpoint, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription, toStringpublic DropBoxFileSystem(String token)
public DropBoxFileSystem()
CredentialsResolver (see setCredentialsResolver(CredentialsResolver)).public DropBoxFileSystem setCredentialsResolver(CredentialsResolver credentialsResolver)
Credentials.TOKEN) —
resolved on each open(), never at construction, so rotated tokens are picked up on
the next connection. When the resolved credentials don't contain a token, the
constructor-supplied token is used.setCredentialsResolver in class FileSystempublic void open()
throws DataException
open in class EndpointDataExceptionpublic void close()
throws DataException
close in class FileSystemDataExceptionpublic InputStream readFile(String folderName, String fileName) throws Throwable
folderName - the name of the folderfileName - the file name to read.InputStreamThrowablepublic InputStream readFile(String fileName) throws Throwable
fileName - the file name to read.InputStreamThrowablepublic List<Metadata> listFolder(String folderName) throws Throwable
folderName.
To specify a nested folder, use "/" as separator.folderName - the folder name to readListThrowablepublic List<Metadata> listRootFolder() throws Throwable
List of all DropBox files and folders in the root folder.ListThrowablepublic OutputStream writeFile(String fileName) throws Throwable
DataException if the file already exists.fileName - the name of the fileOutputStream for writingThrowablepublic OutputStream writeFile(String folderName, String fileName) throws Throwable
DataException if
the file already exists.folderName - the destination folder of the file being writtenfileName - the name of the fileOutputStream for writingThrowableCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.