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