public final class Upload extends Object
Modifier and Type | Method and Description |
---|---|
static void |
reportError(CommandEnv env,
String message,
boolean interactive)
Helper: reports specified error while taking
specified
interactive into account. |
static boolean |
upload(CommandEnv env,
URL[] urls,
String[] contentTypes,
boolean ignoreMissingSource,
boolean overwriteTarget,
boolean interactive)
Upload specified files to a remote server.
|
public static boolean upload(CommandEnv env, URL[] urls, String[] contentTypes, boolean ignoreMissingSource, boolean overwriteTarget, boolean interactive)
env
- the environment to be used when uploading filesurls
- an array of source file/destination file pairs
The source URLs are all expected to be located
on the same Drive
.
The destination URLs are all expected to be located
on the same Drive
.
Note that directories are supported and that a directory is ``recursively uploaded''.
contentTypes
- the content types of destination files.
Specify null
for a directory. May be null
.ignoreMissingSource
- if true
, do not report
a fatal error if one of the source file is missingoverwriteTarget
- if true
and the target exists,
it is deleted prior to transfering the corresponding source.
By default, this method overwrites an existing destination file by the corresponding source file without checking if this possible.
interactive
- true
if it's a user initiated
upload operation; false
otherwise (typically auto-save)true
if the upload was successful;
false
otherwise, in which case an error
has been reported to the userpublic static void reportError(CommandEnv env, String message, boolean interactive)
interactive
into account.