|
@@ -161,12 +161,19 @@ public class TrashPolicyDefault extends TrashPolicy {
|
|
@SuppressWarnings("deprecation")
|
|
@SuppressWarnings("deprecation")
|
|
@Override
|
|
@Override
|
|
public void createCheckpoint() throws IOException {
|
|
public void createCheckpoint() throws IOException {
|
|
|
|
+ createCheckpoint(new Date());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
|
|
+ public void createCheckpoint(Date date) throws IOException {
|
|
|
|
+
|
|
if (!fs.exists(current)) // no trash, no checkpoint
|
|
if (!fs.exists(current)) // no trash, no checkpoint
|
|
return;
|
|
return;
|
|
|
|
|
|
Path checkpointBase;
|
|
Path checkpointBase;
|
|
synchronized (CHECKPOINT) {
|
|
synchronized (CHECKPOINT) {
|
|
- checkpointBase = new Path(trash, CHECKPOINT.format(new Date()));
|
|
|
|
|
|
+ checkpointBase = new Path(trash, CHECKPOINT.format(date));
|
|
|
|
+
|
|
}
|
|
}
|
|
Path checkpoint = checkpointBase;
|
|
Path checkpoint = checkpointBase;
|
|
|
|
|
|
@@ -287,7 +294,7 @@ public class TrashPolicyDefault extends TrashPolicy {
|
|
TrashPolicyDefault trash = new TrashPolicyDefault(
|
|
TrashPolicyDefault trash = new TrashPolicyDefault(
|
|
fs, home.getPath(), conf);
|
|
fs, home.getPath(), conf);
|
|
trash.deleteCheckpoint();
|
|
trash.deleteCheckpoint();
|
|
- trash.createCheckpoint();
|
|
|
|
|
|
+ trash.createCheckpoint(new Date(now));
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
LOG.warn("Trash caught: "+e+". Skipping "+home.getPath()+".");
|
|
LOG.warn("Trash caught: "+e+". Skipping "+home.getPath()+".");
|
|
}
|
|
}
|