public class DropboxV2 extends Object implements DropboxAdapter
Modifier and Type | Method and Description |
---|---|
boolean |
changeWorkingDirectory(String relativePath) |
void |
cleanWorkingFolder() |
boolean |
connect() |
static Secret |
convertAuthorizationToAccessCode(Secret secretAuthorizationCode) |
static com.google.gson.Gson |
createGson() |
boolean |
disconnect() |
int |
getTimeout() |
boolean |
isConnected() |
FolderMetadata |
makeDirectory(String path) |
void |
pruneFolder(String path,
int pruneRootDays) |
void |
setTimeout(int timeout)
Change the timeout value, values lower then 1000 are ignored and reset to default.
|
void |
storeFile(String name,
InputStream content,
long length) |
public DropboxV2(String accessToken)
public static com.google.gson.Gson createGson()
public void setTimeout(int timeout)
setTimeout
in interface DropboxAdapter
timeout
- timeout in milisecondspublic int getTimeout()
getTimeout
in interface DropboxAdapter
public boolean connect() throws RestException
connect
in interface DropboxAdapter
RestException
public boolean isConnected()
isConnected
in interface DropboxAdapter
public boolean disconnect()
disconnect
in interface DropboxAdapter
public boolean changeWorkingDirectory(@Nonnull String relativePath) throws RestException
changeWorkingDirectory
in interface DropboxAdapter
RestException
public FolderMetadata makeDirectory(@Nonnull String path) throws RestException
makeDirectory
in interface DropboxAdapter
RestException
public void cleanWorkingFolder() throws RestException
cleanWorkingFolder
in interface DropboxAdapter
RestException
public void pruneFolder(@Nonnull String path, int pruneRootDays) throws RestException
pruneFolder
in interface DropboxAdapter
RestException
public void storeFile(@Nonnull String name, @Nonnull InputStream content, long length) throws RestException
storeFile
in interface DropboxAdapter
name
- name of the new file to store the content incontent
- data stream of the contentlength
- content size in bytesRestException
public static Secret convertAuthorizationToAccessCode(Secret secretAuthorizationCode) throws RestException
RestException
Copyright © 2016–2021. All rights reserved.