close()
:
void
Closes the current connection to the server.
copy(origin
:
String, destination
:
String)
:
boolean
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
.
copy(origin
:
String, destination
:
String, overwrite
:
boolean)
:
boolean
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
.
copy(origin
:
String, destination
:
String, overwrite
:
boolean, shallow
:
boolean)
:
boolean
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
.
del(path
:
String)
:
boolean
Deletes a file or directory from the remote server that can be found under rootUrl
/path
.
get(path
:
String)
:
String
Reads the content of a remote file or directory that can be found under rootUrl
/path
and returns a string representation of the data found in the DEFAULT_ENCODING encoding.
get(path
:
String, encoding
:
String)
:
String
Reads the content of a remote file or directory that can be found under rootUrl
/path
and returns a string representation of the data found in the given encoding
.
get(path
:
String, encoding
:
String, maxGetSize
:
Number)
:
String
Reads the content of a remote file or directory that can be found under rootUrl
/path
and returns a string representation of the data found in the given encoding
.
get(path
:
String, file
:
File)
:
boolean
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in DEFAULT_ENCODING encoding and writes a
File in the system's standard encoding, which is "UTF-8".
get(path
:
String, file
:
File, maxFileSize
:
Number)
:
boolean
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in DEFAULT_ENCODING encoding and writes a
File in the system's standard encoding, which is "UTF-8".
get(path
:
String, file
:
File, encoding
:
String, maxFileSize
:
Number)
:
boolean
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in the passed encoding and writes a
File in the system standard encoding, which is "UTF-8".
getBinary(path
:
String, file
:
File)
:
boolean
Reads the content of a remote binary file that can be found under
rootUrl
/
path
and creates a local copy in
File.
getBinary(path
:
String, file
:
File, maxFileSize
:
Number)
:
boolean
Reads the content of a remote binary file that can be found under
rootUrl
/
path
and creates a local copy in
File.
mkcol(path
:
String)
:
boolean
Creates a directory on the remote server on the location rootUrl
/path
.
move(origin
:
String, destination
:
String)
:
boolean
Moves a file on the server from one place rootUrl
+ "/" +origin
to the other rootUrl
/destination
.
move(origin
:
String, destination
:
String, overwrite
:
boolean)
:
boolean
Moves a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
Can also be used to rename a remote file.
options(path
:
String)
:
String[]
Returns a list of methods which can be executed on the server location rootUrl
/path
.
put(path
:
String, content
:
String)
:
boolean
Puts content encoded with DEFAULT_ENCODING into a remote located file at rootUrl
/path
.
put(path
:
String, content
:
String, encoding
:
String)
:
boolean
Puts content encoded with the passed encoding into a remote located file at rootUrl
/path
.
put(path
:
String, file
:
File)
:
boolean
Puts content out of a passed local file into a remote located file at rootUrl
/path
.
succeeded()
:
boolean
Returns true if the last executed WebDAV method was executed successfully - otherwise false.
addRequestHeader
addRequestHeader(headerName
:
String, headerValue
:
String)
:
void
Adds a request header to the next WebDAV call.
Parameters:
headerName
-
name of the header.
headerValue
-
value of the header.
close
close()
:
void
Closes the current connection to the server.
copy
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
. If
destination
already exists it gets overwritten. Returns
true if succeeded, otherwise false.
Parameters:
origin
-
The origin where a file is located, relative to the rootUrl
stated when instantiating the client.
destination
-
The destination where the file should be copied to, relative to the rootUrl
stated when instantiating the client.
Returns:
true if succeeded, otherwise false.
copy
copy(origin
:
String, destination
:
String, overwrite
:
boolean)
:
boolean
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
. If
the passed parameter overwrite
is true and
destination
already exists it gets overwritten. Returns
true if succeeded, otherwise false.
Parameters:
origin
-
The origin where a file is located, relative to the rootUrl
stated when instantiating the client.
destination
-
The destination where the file should be copied to, relative to the rootUrl
stated when instantiating the client.
overwrite
-
A flag which determines whether the destination gets overwritten if it exists before copying.
Returns:
true if succeeded, otherwise false.
copy
copy(origin
:
String, destination
:
String, overwrite
:
boolean, shallow
:
boolean)
:
boolean
Copies a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
. If
the passed parameter overwrite
is true and
destination
already exists it gets overwritten. If the
passed parameter shallow
is true a flat copy mechanism is
used.
Returns true if succeeded, otherwise false.
Parameters:
origin
-
The origin where a file is located, relative to the rootUrl
stated when instantiating the client.
destination
-
The destination where the file should be copied to, relative to the rootUrl
stated when instantiating the client.
overwrite
-
A flag which determines whether the destination gets overwritten if it exits before copying
shallow
-
A flag which determines how to copy the given data.
Returns:
true if succeeded, otherwise false.
del
Deletes a file or directory from the remote server that can be found
under rootUrl
/path
. Returns true if
succeeded, otherwise false.
Parameters:
path
-
The path of the file or collection to delete, relative to the rootUrl
stated when instantiating the client.
Returns:
true if succeeded, otherwise false.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/path
and returns a string
representation of the data found in the DEFAULT_ENCODING encoding. If the
remote location is a directory the result depends on the server
configuration, some return an HTML formatted directory listing. Returns
at most DEFAULT_GET_STRING_SIZE bytes.
Parameters:
path
-
The path of the collection or file one wants to get, relative to the rootUrl
stated when instantiating the client.
Returns:
returns the String representation of the data found on the given path.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/path
and returns a string
representation of the data found in the given encoding
. If
the remote location is a directory the result depends on the server
configuration, some return an HTML formatted directory listing. Returns
at most DEFAULT_GET_STRING_SIZE bytes.
Parameters:
path
-
The path of the collection or file one wants to get - relative to the rootUrl
stated when instantiating the client.
encoding
-
The encoding of the resulting String.
Returns:
returns the String representation of the data found on the given path in the given encoding.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/path
and returns a string
representation of the data found in the given encoding
. If
the remote location is a directory the result depends on the server
configuration, some return an HTML formatted directory listing. Returns
at most maxGetSize bytes.
Parameters:
path
-
The path of the collection or file one wants to get - relative to the rootUrl
stated when instantiating the client.
encoding
-
The encoding of the resulting String.
maxGetSize
-
The maximum size of data in bytes. Not to exceed MAX_GET_STRING_SIZE.
Returns:
returns the String representation of the data found on the given path in the given encoding.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in DEFAULT_ENCODING
encoding and writes a
File in the system's standard
encoding, which is "UTF-8". If the remote location is a directory the
result depends on the server configuration, some return an HTML formatted
directory listing. Receives at most DEFAULT_GET_FILE_SIZE bytes which
determines the file size of the local file. Returns true if succeeded
otherwise false.
Parameters:
path
-
The path of the collection or file one wants to get - relative to the rootUrl
stated when instantiating the client.
file
-
The file to save the received data in.
Returns:
returns true if succeeded, otherwise false.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in DEFAULT_ENCODING
encoding and writes a
File in the system's standard
encoding, which is "UTF-8". If the remote location is a directory the
result depends on the server configuration, some return an HTML formatted
directory listing. Receives at most maxFileSize bytes which determines
the file size of the local file. Returns true if succeeded, otherwise
false.
Parameters:
path
-
The path of the collection or file one wants to get - relative to the rootUrl
stated when instantiating the client.
file
-
The file to save the received data in.
maxFileSize
-
The maximum size of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.
Returns:
returns true if succeeded, otherwise false.
get
Reads the content of a remote file or directory that can be found under
rootUrl
/
path
in the passed encoding and
writes a
File in the system standard encoding, which is
"UTF-8". If the remote location is a directory the result depends on the
server configuration, some return an HTML formatted directory listing.
Receives at most maxFileSize bytes which determines the file size of the
local file. Returns true if succeeded, otherwise false.
Parameters:
path
-
The path of the collection or file one wants to get - relative to the rootUrl
stated when instantiating the client.
file
-
The file to save the received data in.
encoding
-
The encoding to use when reading the remote file.
maxFileSize
-
The maximum number of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.
Returns:
returns true if succeeded, otherwise false.
getAllResponseHeaders
Returns a
HashMap of all response headers.
getBinary
Reads the content of a remote binary file that can be found under
rootUrl
/
path
and creates a local copy
in
File. If the remote location is a directory the result
depends on the server configuration, some return an HTML formatted
directory listing. Copies at most DEFAULT_GET_FILE_SIZE bytes. Returns
true if succeeded, otherwise false.
Parameters:
path
-
The path relative to rootUrl
on the remote server including the file name.
file
-
The local file where the received binary data should be stored.
Returns:
true if succeeded, otherwise false.
getBinary
Reads the content of a remote binary file that can be found under
rootUrl
/
path
and creates a local copy
in
File. If the remote location is a directory the result
depends on the server configuration, some return an HTML formatted
directory listing. Copies at most maxFileSize bytes. Returns true if
succeeded, otherwise false.
Parameters:
path
-
The path relative to rootUrl
on the remote server including the file name.
file
-
The file local file where the received binary data should be stored.
maxFileSize
-
The maximum number of bytes to stream into the file. Not to exceed MAX_GET_FILE_SIZE.
Returns:
true if succeeded, otherwise false.
getResponseHeader
Returns a specified response header - multiple headers are separated by
CRLF.
Parameters:
header
-
The name of the header.
Returns:
The header - in case of multiple headers separated by CRLF.
getStatusCode
Returns the status code after the execution of a method.
getStatusText
Returns the status text after the execution of a method.
mkcol
mkcol(path
:
String)
:
boolean
Creates a directory on the remote server on the location
rootUrl
/path
.
Parameters:
path
-
The path relative to the rootUrl
stated when instantiating the client where the new collection should be created.
Returns:
true if succeeded, otherwise false.
move
Moves a file on the server from one place rootUrl
+ "/" +origin
to the other rootUrl
/destination
. If
destination
already exists it gets overwritten. Can also
be used to rename a remote file. Returns true if succeeded, otherwise
false.
Parameters:
origin
-
The origin where a file is located, relative to the rootUrl
stated when instantiating the client.
destination
-
The destination where the file should be moved to, relative to the rootUrl
stated when instantiating the client.
Returns:
true if succeeded, otherwise false.
move
move(origin
:
String, destination
:
String, overwrite
:
boolean)
:
boolean
Moves a file on the server from one place rootUrl
/origin
to the other rootUrl
/destination
Can
also be used to rename a remote file. If overwrite
is true
and destination
already exists it gets overwritten.
Returns true if succeeded, otherwise false.
Parameters:
origin
-
The origin where a file is located, relative to the rootUrl
stated when instantiating the client.
destination
-
The destination where the file should be moved to, relative to the rootUrl
stated when instantiating the client.
overwrite
-
A flag which determines whether the destination gets overwritten if it exists before moving.
Returns:
true if succeeded, otherwise false.
options
Returns a list of methods which can be executed on the server location
rootUrl
/path
.
Parameters:
path
-
The path relative to the rootUrl
stated when instantiating the client one wants to get the options for.
Returns:
list of WebDav methods which can be executed on the given path.
propfind
Get file listing of a remote location.
Returns a list of
WebDAVFileInfo objects which contain
information about the files and directories located on
rootUrl
/
path
and DEPTH_1 (1) level
underneath.
Parameters:
path
-
The path relative to the rootUrl
stated when instantiating the client where to get information about the containing files from.
Returns:
an Array of WebDAVFileInfo objects which hold information about the files located on the server at the location.
propfind
Get file listing of a remote location.
Returns a list of
WebDAVFileInfo objects which contain
information about the files and directories located on
rootUrl
/
path
and the passed depth
underneath.
Parameters:
path
-
The path relative to the rootUrl
stated when instantiating the client where to get information about the containing files from.
depth
-
The level starting from rootUrl
down to which the file information gets collected.
Returns:
an Array of WebDAVFileInfo objects which hold information about the files located on the server at the location.
put
Puts content encoded with DEFAULT_ENCODING into a remote located file at
rootUrl
/
path
. Returns true if
succeeded, otherwise false.
If the content of a local file is to be uploaded, please use method
put(String, File) instead.
Parameters:
path
-
The path to put given content up to, relative to the rootUrl
stated when instantiating the client.
content
-
The content that has to be pushed on to the server.
Returns:
true if succeeded, otherwise false.
put
Puts content encoded with the passed encoding into a remote located file
at
rootUrl
/
path
. Returns true if
succeeded, otherwise false.
If the content of a local file is to be uploaded, please use method
put(String, File) instead.
Parameters:
path
-
The path to put a given content up to, relative to the rootUrl
stated when instantiating the client.
content
-
The content that has to be pushed on to a remote location.
encoding
-
The encoding in which the data should be stored on the server.
Returns:
true if succeeded, otherwise false.
put
Puts content out of a passed local file into a remote located file
at rootUrl
/path
. This method performs
a binary file transfer. Returns true if succeeded, otherwise false.
Parameters:
path
-
The path to put given content up to, relative to the rootUrl
stated when instantiating the client.
file
-
The file to push up to the server.
Returns:
true if succeeded, otherwise false.
succeeded
succeeded()
:
boolean
Returns true if the last executed WebDAV method was executed successfully - otherwise false.
See the code snippet above for an example how to use the succeed() method.
Returns:
true if the last executed WebDAV method was successful - otherwise false.