1 package org.simantics.utils;
4 import java.io.IOException;
7 * @author Tuukka Lehtonen
9 public interface FileService {
11 public static interface DeleteOption {}
13 public static class EffortOption implements DeleteOption {
14 public final int maxTries;
16 private EffortOption(int maxTries) {
17 this.maxTries = maxTries;
20 public static EffortOption maxTries(int maxTries) {
21 return new EffortOption(maxTries);
26 * Schedules a file to be deleted at some point in the future when the
27 * system allows it to be deleted if ever.
30 * @return an operation handle for tracking the progress of the deletion or
31 * <code>null</code> if there's a deletion operation scheduled for
32 * the provided file in the queue or the file does not exist.
34 IOperation<Boolean, IOException> scheduleDeleteIfExists(File file, DeleteOption... options);