continue;
String backupPath = filePath;
try {
Item localChildItem = localConnection.getItem(localChildFile, followlinks);
localChildItem.setParent(remoteParentItem);
backupPath = localChildItem.getPath();
Item remoteChildItem = remoteParentItem.getChildByName(localChildItem.getName());
if (remoteChildItem == null) {
remoteChildItem = localChildItem;
LOGGER.log(Level.FINE, "create " + remoteChildItem.getTypeName() + " '" + backupPath + "'");
if (perform) {
createLock();
remoteConnection.upload(this, remoteChildItem);
}
remoteParentItem.addChild(remoteChildItem);
status.create++;
} else {
if (remoteChildItem.isTypeChanged(localChildItem)) {
LOGGER.log(Level.FINE, "remove " + remoteChildItem.getTypeName() + " '" + backupPath + "'");
if (perform) {
createLock();
remoteConnection.remove(this, remoteChildItem);
}
status.remove++;
remoteChildItem = localChildItem;
LOGGER.log(Level.FINE, "create " + remoteChildItem.getTypeName() + " '" + backupPath + "'");
if (perform) {
createLock();
remoteConnection.upload(this, remoteChildItem);
}
remoteParentItem.addChild(remoteChildItem);
status.create++;
}
// check filesize and modify time
else if (remoteChildItem.isMetadataChanged(localChildItem)) {
final boolean isFiledataChanged = localChildItem.isFiledataChanged(remoteChildItem);
remoteChildItem.update(localChildItem);
List<String> types = new ArrayList<String>();
if (isFiledataChanged)
types.add("data,attributes");
else if (!isFiledataChanged)
types.add("attributes");
if (remoteChildItem.isMetadataFormatChanged())
types.add("format");
LOGGER.log(Level.FINE, "update " + remoteChildItem.getTypeName() + " '" + backupPath + "' [" + StringUtils.join(types, ",") + "]");
if (perform) {
createLock();
remoteConnection.update(this, remoteChildItem, isFiledataChanged);
}
status.update++;
} else {
status.skip++;
}
}
try {
// refresh Metadata
Item _localChildItem = localConnection.getItem(localChildFile, followlinks);
if (_localChildItem.isMetadataChanged(localChildItem)) {
LOGGER.log(Level.WARNING, localChildItem.getTypeName() + " '" + backupPath + "' was changed during update.");
}
} catch (NoSuchFileException e) {