forked from I2P_Developers/i2p.i2p
* FileUtil: Add a rename method and a new copy method
This commit is contained in:
@ -359,7 +359,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
|
||||
|
||||
long now = _context.clock().now();
|
||||
if (_tempFile.exists()) {
|
||||
boolean copied = FileUtil.copy(_tempFile.getAbsolutePath(), _newsFile.getAbsolutePath(), true);
|
||||
boolean copied = FileUtil.copy(_tempFile, _newsFile, true, false);
|
||||
if (copied) {
|
||||
_lastUpdated = now;
|
||||
_tempFile.delete();
|
||||
|
@ -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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user