fixed bug causing directories to disappear immediately after renaming to a long name.

This commit is contained in:
Sebastian Stenzel
2016-02-08 15:16:43 +01:00
parent e5d095606f
commit bb185c3170

View File

@@ -46,4 +46,15 @@ class ShorteningFile extends DelegatingFile<ShorteningFolder> {
return super.openWritable();
}
@Override
public void moveTo(File destination) {
super.moveTo(destination);
if (destination instanceof ShorteningFile) {
ShorteningFile dest = (ShorteningFile) destination;
if (shortener.isShortened(dest.shortenedName())) {
shortener.saveMapping(dest.name(), dest.shortenedName());
}
}
}
}