public class CloudStoreRESTClient extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_KEY_SOCKET_CONNECT_TIMEOUT
The
key for the connection timeout used with Config.getPropertyAsInt(String, int) . |
static String |
CONFIG_KEY_SOCKET_READ_TIMEOUT
The
key for the read timeout used with Config.getPropertyAsInt(String, int) . |
Constructor and Description |
---|
CloudStoreRESTClient(String url)
Create a new client.
|
CloudStoreRESTClient(URL url)
Create a new client.
|
Modifier and Type | Method and Description |
---|---|
void |
beginPutFile(String repositoryName,
String path) |
void |
copy(String repositoryName,
String fromPath,
String toPath) |
void |
delete(String repositoryName,
String path) |
void |
endPutFile(String repositoryName,
String path,
DateTime lastModified,
long length,
String sha1) |
void |
endSyncFromRepository(String repositoryName) |
void |
endSyncToRepository(String repositoryName,
long fromLocalRevision) |
String |
getBaseURL()
Get the server's base-URL.
|
ChangeSetDTO |
getChangeSet(String repositoryName,
boolean localSync) |
CredentialsProvider |
getCredentialsProvider() |
EncryptedSignedAuthToken |
getEncryptedSignedAuthToken(String repositoryName,
UUID clientRepositoryId) |
byte[] |
getFileData(String repositoryName,
String path,
long offset,
int length) |
HostnameVerifier |
getHostnameVerifier() |
RepoFileDTO |
getRepoFileDTO(String repositoryName,
String path) |
RepositoryDTO |
getRepositoryDTO(String repositoryName) |
Integer |
getSocketConnectTimeout() |
Integer |
getSocketReadTimeout() |
SSLContext |
getSslContext() |
void |
makeDirectory(String repositoryName,
String path,
Date lastModified) |
void |
makeSymlink(String repositoryName,
String path,
String target,
Date lastModified) |
void |
move(String repositoryName,
String fromPath,
String toPath) |
void |
putFileData(String repositoryName,
String path,
long offset,
byte[] fileData) |
void |
requestRepoConnection(String repositoryName,
String pathPrefix,
RepositoryDTO clientRepositoryDTO) |
void |
setCredentialsProvider(CredentialsProvider credentialsProvider) |
void |
setHostnameVerifier(HostnameVerifier hostnameVerifier) |
void |
setSocketConnectTimeout(Integer socketConnectTimeout) |
void |
setSocketReadTimeout(Integer socketReadTimeout) |
void |
setSslContext(SSLContext sslContext) |
void |
testException() |
void |
testSuccess() |
public static final String CONFIG_KEY_SOCKET_CONNECT_TIMEOUT
key
for the connection timeout used with Config.getPropertyAsInt(String, int)
.
The configuration can be overridden by a system property - see Config.SYSTEM_PROPERTY_PREFIX
.
public static final String CONFIG_KEY_SOCKET_READ_TIMEOUT
key
for the read timeout used with Config.getPropertyAsInt(String, int)
.
The configuration can be overridden by a system property - see Config.SYSTEM_PROPERTY_PREFIX
.
public CloudStoreRESTClient(URL url)
url
- any URL to the server. Must not be null
.
May be the base-URL, any repository's remote-root-URL or any URL within a remote-root-URL.
The base-URL is automatically determined by cutting sub-paths, step by step.public CloudStoreRESTClient(String url)
url
- any URL to the server. Must not be null
.
May be the base-URL, any repository's remote-root-URL or any URL within a remote-root-URL.
The base-URL is automatically determined by cutting sub-paths, step by step.public Integer getSocketConnectTimeout()
public void setSocketConnectTimeout(Integer socketConnectTimeout)
public Integer getSocketReadTimeout()
public void setSocketReadTimeout(Integer socketReadTimeout)
public String getBaseURL()
This base-URL is the base of the CloudStoreREST
application. Hence all URLs
beneath this base-URL are processed by the CloudStoreREST
application.
In other words: All repository-names are located directly beneath this base-URL. The special services, too, are located directly beneath this base-URL.
For example, if the server's base-URL is "https://host.domain:8443/", then the test-service is available via "https://host.domain:8443/_test" and the repository with the alias "myrepo" is "https://host.domain:8443/myrepo".
public void testSuccess()
public void testException()
public RepositoryDTO getRepositoryDTO(String repositoryName)
public ChangeSetDTO getChangeSet(String repositoryName, boolean localSync)
public void requestRepoConnection(String repositoryName, String pathPrefix, RepositoryDTO clientRepositoryDTO)
public EncryptedSignedAuthToken getEncryptedSignedAuthToken(String repositoryName, UUID clientRepositoryId)
public RepoFileDTO getRepoFileDTO(String repositoryName, String path)
public void beginPutFile(String repositoryName, String path)
public void endSyncFromRepository(String repositoryName)
public void endSyncToRepository(String repositoryName, long fromLocalRevision)
public void endPutFile(String repositoryName, String path, DateTime lastModified, long length, String sha1)
public byte[] getFileData(String repositoryName, String path, long offset, int length)
public void putFileData(String repositoryName, String path, long offset, byte[] fileData)
public void makeDirectory(String repositoryName, String path, Date lastModified)
public void makeSymlink(String repositoryName, String path, String target, Date lastModified)
public HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
public SSLContext getSslContext()
public void setSslContext(SSLContext sslContext)
public CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
Copyright © 2013-2014. All Rights Reserved.