sourceChannel = sourceStream.getChannel();
destinationStream = new FileOutputStream(newFile);
destinationChannel = destinationStream.getChannel();
destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
sourceStream.close();
destinationStream.close();
File directory = historyFile.getParentFile();
boolean deleted = historyFile.delete();
if (!deleted) {