For implementation of issue 123832, especially its patch in ProjectManager:
I need to run a runnable in atomic action without actually knowing any fileobject or filesystem.
It would be very good to have:
public static void FileUtil.runAtomicAction(FileSystem.AtomicAction action) throws IOException;
public static void FileUtil.runAtomicAction(Runnable action);
that would block events on all (known) filesystems.
Moreover it would be excellent, if there also was
public static final FileUtil.Executor ATOMIC_ACTION;
delegating to FileUtil.runAtomicAction(Runnable). This would completely simplified the code in ProjectManager to
one-liner and others could use it too.
Radek, please implement this little enhancement for the benefit of everyone.
Created attachment 54688 [details]
Patch+API change+Test submitted as attachment. FileUtil.Executor not included, because I don't find it much handy.
OK with me. Up to Milan to decide if this is acceptable API for him, as this means he will have to write the executor
Iff it was OK for Milan, someone else might require different impl. The simplest executor 1 - 3 lines of code for everyone
I think that it's OK even without executor support.
Will be integrated tomorrow
/cvs/openide/fs/src/org/openide/filesystems/FileUtil.java,v <-- FileUtil.java
new revision: 1.50; previous revision: 1.49
/cvs/openide/fs/test/unit/src/org/openide/filesystems/FileUtilTestHidden.java,v <-- FileUtilTestHidden.java
new revision: 1.6; previous revision: 1.5
/cvs/openide/fs/manifest.mf,v <-- manifest.mf
new revision: 1.13; previous revision: 1.12
/cvs/openide/fs/apichanges.xml,v <-- apichanges.xml
new revision: 1.17; previous revision: 1.16