* FileUtil: Add a rename method and a new copy method

This commit is contained in:
zzz
2011-07-17 16:33:40 +00:00
parent 1ced604354
commit 7fbb3b12d1
6 changed files with 45 additions and 26 deletions

View File

@ -93,8 +93,8 @@ public class UnsignedUpdateHandler extends UpdateHandler {
_log.log(Log.CRIT, "Corrupt zip file from " + url);
return;
}
String to = (new File(_context.getRouterDir(), Router.UPDATE_FILE)).getAbsolutePath();
boolean copied = FileUtil.copy(_updateFile, to, true);
File to = new File(_context.getRouterDir(), Router.UPDATE_FILE);
boolean copied = FileUtil.copy(updFile, to, true, false);
if (copied) {
updFile.delete();
String policy = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_POLICY);
@ -124,7 +124,7 @@ public class UnsignedUpdateHandler extends UpdateHandler {
}
} else {
_log.log(Log.CRIT, "Failed copy to " + to);
updateStatus("<b>" + _("Failed copy to {0}", to) + "</b>");
updateStatus("<b>" + _("Failed copy to {0}", to.getAbsolutePath()) + "</b>");
}
}
}