public interface Sardine
| Modifier and Type | Method and Description |
|---|---|
void |
copy(String sourceUrl,
String destinationUrl)
Copy a url from source to destination using WebDAV
COPY. |
void |
createDirectory(String url)
Uses WebDAV
MKCOL to create a directory at the specified url |
void |
delete(String url)
Delete a resource using HTTP
DELETE at the specified url |
void |
disableCompression()
Disables support for HTTP compression.
|
void |
disablePreemptiveAuthentication()
Disable preemptive authentication.
|
void |
enableCompression()
Enables HTTP GZIP compression.
|
void |
enablePreemptiveAuthentication(String hostname)
Send a
Basic authentication header with each request even before 401 is returned. |
boolean |
exists(String url)
Performs a HTTP
HEAD request to see if a resource exists or not. |
InputStream |
get(String url)
Uses HTTP
GET to download data from a server. |
InputStream |
get(String url,
Map<String,String> headers)
Uses HTTP
GET to download data from a server. |
DavAcl |
getAcl(String url)
Read access control list for resource
|
List<String> |
getPrincipalCollectionSet(String url)
The principals that are available on the server that implements this resource.
|
List<DavPrincipal> |
getPrincipals(String url)
List the principals that can be used to set ACLs on given url
|
DavQuota |
getQuota(String url)
Read quota properties for resource
|
List<DavResource> |
getResources(String url)
Deprecated.
|
List<DavResource> |
list(String url)
Gets a directory listing using WebDAV
PROPFIND. |
List<DavResource> |
list(String url,
int depth)
Gets a directory listing using WebDAV
PROPFIND. |
List<DavResource> |
list(String url,
int depth,
boolean allProp)
Gets a directory listing using WebDAV
PROPFIND. |
String |
lock(String url)
Put an exclusive write lock on this resource.
|
void |
move(String sourceUrl,
String destinationUrl)
Move a url to from source to destination using WebDAV
MOVE. |
List<DavResource> |
patch(String url,
Map<QName,String> addProps)
Add custom properties for a url WebDAV
PROPPATCH. |
List<DavResource> |
patch(String url,
Map<QName,String> addProps,
List<QName> removeProps)
Add or remove custom properties for a url using WebDAV
PROPPATCH. |
void |
put(String url,
byte[] data)
Uses HTTP
PUT to send data to a server. |
void |
put(String url,
byte[] data,
String contentType)
Uses
PUT to send data to a server with a specific content type
header. |
void |
put(String url,
InputStream dataStream)
Uses
PUT to send data to a server. |
void |
put(String url,
InputStream dataStream,
Map<String,String> headers)
Uses
PUT to send data to a server with specific headers. |
void |
put(String url,
InputStream dataStream,
String contentType)
Uses
PUT to send data to a server with a specific content
type header. |
void |
put(String url,
InputStream dataStream,
String contentType,
boolean expectContinue)
Uses
PUT to send data to a server with a specific content
type header. |
void |
put(String url,
InputStream dataStream,
String contentType,
boolean expectContinue,
long contentLength)
Uses
PUT to send data to a server with a specific content
type header. |
String |
refreshLock(String url,
String token,
String file)
A LOCK request with no request body is a "LOCK refresh" request.
|
void |
setAcl(String url,
List<DavAce> aces)
Write access control list for resource
|
void |
setCredentials(String username,
String password)
Add credentials to any scope.
|
void |
setCredentials(String username,
String password,
String domain,
String workstation) |
void |
setCustomProps(String url,
Map<String,String> addProps,
List<String> removeProps)
Deprecated.
|
void |
shutdown()
Releasing any resources that might be held
open.
|
void |
unlock(String url,
String token)
Unlock the resource.
|
void setCredentials(String username, String password)
username - Use in authentication header credentialspassword - Use in authentication header credentialsvoid setCredentials(String username, String password, String domain, String workstation)
username - Use in authentication header credentialspassword - Use in authentication header credentialsdomain - NTLM authenticationworkstation - NTLM authentication@Deprecated List<DavResource> getResources(String url) throws IOException
IOExceptionlist(String)List<DavResource> list(String url) throws IOException
PROPFIND.url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureList<DavResource> list(String url, int depth) throws IOException
PROPFIND.url - Path to the resource including protocol and hostnamedepth - The depth to look at (use 0 for single ressource, 1 for directory listing)IOException - I/O error or HTTP response validation failureList<DavResource> list(String url, int depth, boolean allProp) throws IOException
PROPFIND.url - Path to the resource including protocol and hostnamedepth - The depth to look at (use 0 for single ressource, 1 for directory listing)allProp - If allprop should be used, which can be inefficient sometimes;
warning: no allprop does not retrieve custom props, just the basic onesIOException - I/O error or HTTP response validation failure@Deprecated void setCustomProps(String url, Map<String,String> addProps, List<String> removeProps) throws IOException
IOExceptionpatch(String, java.util.Map, java.util.List)List<DavResource> patch(String url, Map<QName,String> addProps) throws IOException
PROPPATCH.url - Path to the resource including protocol and hostnameaddProps - Properties to add to resource. If a property already exists then its value is replaced.IOException - I/O error or HTTP response validation failureList<DavResource> patch(String url, Map<QName,String> addProps, List<QName> removeProps) throws IOException
PROPPATCH.url - Path to the resource including protocol and hostnameaddProps - Properties to add to resource. If a property already exists then its value is replaced.removeProps - Properties to remove from resource. Specifying the removal of a property that does not exist is not an error.IOException - I/O error or HTTP response validation failureInputStream get(String url) throws IOException
GET to download data from a server. The stream must be closed after reading.url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureInputStream get(String url, Map<String,String> headers) throws IOException
GET to download data from a server. The stream must be closed after reading.url - Path to the resource including protocol and hostnameheaders - Additional HTTP headers to add to the requestIOException - I/O error or HTTP response validation failurevoid put(String url, byte[] data) throws IOException
PUT to send data to a server. Repeatable on authentication failure.url - Path to the resource including protocol and hostnamedata - Input sourceIOException - I/O error or HTTP response validation failurevoid put(String url, InputStream dataStream) throws IOException
PUT to send data to a server. Not repeatable on authentication failure.url - Path to the resource including protocol and hostnamedataStream - Input sourceIOException - I/O error or HTTP response validation failurevoid put(String url, byte[] data, String contentType) throws IOException
PUT to send data to a server with a specific content type
header. Repeatable on authentication failure.url - Path to the resource including protocol and hostnamedata - Input sourcecontentType - MIME type to add to the HTTP request headerIOException - I/O error or HTTP response validation failurevoid put(String url, InputStream dataStream, String contentType) throws IOException
PUT to send data to a server with a specific content
type header. Not repeatable on authentication failure.url - Path to the resource including protocol and hostnamedataStream - Input sourcecontentType - MIME type to add to the HTTP request headerIOException - I/O error or HTTP response validation failurevoid put(String url, InputStream dataStream, String contentType, boolean expectContinue) throws IOException
PUT to send data to a server with a specific content
type header. Not repeatable on authentication failure.url - Path to the resource including protocol and hostnamedataStream - Input sourcecontentType - MIME type to add to the HTTP request headerexpectContinue - Enable Expect: continue header for PUT requests.IOException - I/O error or HTTP response validation failurevoid put(String url, InputStream dataStream, String contentType, boolean expectContinue, long contentLength) throws IOException
PUT to send data to a server with a specific content
type header. Not repeatable on authentication failure.url - Path to the resource including protocol and hostnamedataStream - Input sourcecontentType - MIME type to add to the HTTP request headerexpectContinue - Enable Expect: continue header for PUT requests.contentLength - data size in bytes to set to Content-Length headerIOException - I/O error or HTTP response validation failurevoid put(String url, InputStream dataStream, Map<String,String> headers) throws IOException
PUT to send data to a server with specific headers. Not repeatable
on authentication failure.url - Path to the resource including protocol and hostnamedataStream - Input sourceheaders - Additional HTTP headers to add to the requestIOException - I/O error or HTTP response validation failurevoid delete(String url) throws IOException
DELETE at the specified urlurl - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failurevoid createDirectory(String url) throws IOException
MKCOL to create a directory at the specified urlurl - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failurevoid move(String sourceUrl, String destinationUrl) throws IOException
MOVE. Assumes overwrite.sourceUrl - Path to the resource including protocol and hostnamedestinationUrl - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failurevoid copy(String sourceUrl, String destinationUrl) throws IOException
COPY. Assumes overwrite.sourceUrl - Path to the resource including protocol and hostnamedestinationUrl - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureboolean exists(String url) throws IOException
HEAD request to see if a resource exists or not.url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureString lock(String url) throws IOException
url - Path to the resource including protocol and hostnameLOCK operation in the lockdiscovery property in the response body, and can also be found through
lock discovery on a resource.IOException - I/O error or HTTP response validation failureString refreshLock(String url, String token, String file) throws IOException
url - Path to the resource including protocol and hostnametoken - The lock token used to lock the resourcefile - The name of the file at the end of the urlLOCK operation in the lockdiscovery property in the response body, and can also be found through
lock discovery on a resource.IOException - I/O error or HTTP response validation failurevoid unlock(String url, String token) throws IOException
url - Path to the resource including protocol and hostnametoken - The lock token to unlock this resource.IOException - I/O error or HTTP response validation failurelock(String)DavAcl getAcl(String url) throws IOException
url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureDavQuota getQuota(String url) throws IOException
url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failurevoid setAcl(String url, List<DavAce> aces) throws IOException
url - Path to the resource including protocol and hostnameaces - Access control elementsIOException - I/O error or HTTP response validation failureList<DavPrincipal> getPrincipals(String url) throws IOException
url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failureList<String> getPrincipalCollectionSet(String url) throws IOException
url - Path to the resource including protocol and hostnameIOException - I/O error or HTTP response validation failurevoid enableCompression()
void disableCompression()
enableCompression()void enablePreemptiveAuthentication(String hostname)
Basic authentication header with each request even before 401 is returned.hostname - The hostname to enable preemptive authentication for.void disablePreemptiveAuthentication()
void shutdown()
Copyright © 2014. All rights reserved.