forked from Qortal/qortal
No longer creating the ".removed" files.
This commit is contained in:
parent
3019bb5c97
commit
8929f32068
@ -162,7 +162,6 @@ public class ArbitraryDataDiff {
|
|||||||
if (!Files.exists(directoryPathAfter)) {
|
if (!Files.exists(directoryPathAfter)) {
|
||||||
LOGGER.info("Directory was removed: {}", directoryPathAfter.toString());
|
LOGGER.info("Directory was removed: {}", directoryPathAfter.toString());
|
||||||
diff.removedPaths.add(directoryPathBefore);
|
diff.removedPaths.add(directoryPathBefore);
|
||||||
ArbitraryDataDiff.markFilePathAsRemoved(diffPathAbsolute, directoryPathBefore);
|
|
||||||
// TODO: we might need to mark directories differently to files
|
// TODO: we might need to mark directories differently to files
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,8 +176,6 @@ public class ArbitraryDataDiff {
|
|||||||
if (!Files.exists(filePathAfter)) {
|
if (!Files.exists(filePathAfter)) {
|
||||||
LOGGER.trace("File was removed: {}", before.toString());
|
LOGGER.trace("File was removed: {}", before.toString());
|
||||||
diff.removedPaths.add(filePathBefore);
|
diff.removedPaths.add(filePathBefore);
|
||||||
|
|
||||||
ArbitraryDataDiff.markFilePathAsRemoved(diffPathAbsolute, filePathBefore);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FileVisitResult.CONTINUE;
|
return FileVisitResult.CONTINUE;
|
||||||
@ -234,18 +231,6 @@ public class ArbitraryDataDiff {
|
|||||||
Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void markFilePathAsRemoved(Path base, Path relativePath) throws IOException {
|
|
||||||
String newFilename = relativePath.toString().concat(".removed");
|
|
||||||
Path dest = Paths.get(base.toString(), newFilename);
|
|
||||||
File file = new File(dest.toString());
|
|
||||||
File parent = file.getParentFile();
|
|
||||||
if (parent != null) {
|
|
||||||
parent.mkdirs();
|
|
||||||
}
|
|
||||||
LOGGER.info("Creating file {}", dest);
|
|
||||||
file.createNewFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Path getDiffPath() {
|
public Path getDiffPath() {
|
||||||
return this.diffPath;
|
return this.diffPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user