" Specify --force to overwrite remote files.");
}
try {
switch (file.getStatus()) {
case MODIFIED:
FileInputSource fis = new FileInputSource(file.getFile());
if (file.isBinary()) {
fis.setLineSeparator(LineOutputStream.LS_BINARY);
}
tx.modify(remoteFile, fis);
ctx.printMessage("sending....", file);
break;
case DELETED:
tx.delete(remoteFile);
ctx.printMessage("deleting...", file);
break;
case ADDED:
String path = this.getEntries().getPath();
if (path.endsWith("/")) {
path += file.getName();
} else {
path += "/" + file.getName();
}
if (file.canDescend()) {
tx.mkdir(path);
} else {
fis = new FileInputSource(file.getFile());
if (file.isBinary()) {
fis.setLineSeparator(LineOutputStream.LS_BINARY);
}
VaultFileOutput out = tx.add(path, fis);
// set the content type hint
out.setContentType(file.getContentType());
}