This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 123899 - Simple way to run atomic action without having a fileobject
Summary: Simple way to run atomic action without having a fileobject
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: rmatous
Depends on:
Blocks: 123832
  Show dependency tree
Reported: 2007-12-12 17:52 UTC by Jaroslav Tulach
Modified: 2008-12-22 11:52 UTC (History)
2 users (show)

See Also:
Exception Reporter:

Suggested patch (6.45 KB, patch)
2008-01-04 13:54 UTC, rmatous
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2007-12-12 17:52:43 UTC
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.
Comment 1 Jaroslav Tulach 2007-12-12 17:54:44 UTC
Radek, please implement this little enhancement for the benefit of everyone.
Comment 2 rmatous 2008-01-04 13:54:47 UTC
Created attachment 54688 [details]
Suggested patch
Comment 3 rmatous 2008-01-04 13:59:04 UTC
Patch+API change+Test submitted as attachment. FileUtil.Executor not included, because I don't find it much handy. 
Comment 4 Jaroslav Tulach 2008-01-04 15:38:56 UTC
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 
Comment 5 rmatous 2008-01-04 15:59:51 UTC
Iff it was OK for Milan, someone else might require different impl.  The simplest executor 1 - 3 lines of code for everyone
Comment 6 Milan Kubec 2008-01-04 17:16:07 UTC
I think that it's OK even without executor support.
Comment 7 rmatous 2008-01-07 09:50:26 UTC
Will be integrated tomorrow 
Comment 8 rmatous 2008-01-08 10:53:04 UTC
/cvs/openide/fs/src/org/openide/filesystems/,v  <--
new revision: 1.50; previous revision: 1.49

/cvs/openide/fs/test/unit/src/org/openide/filesystems/,v  <--
new revision: 1.6; previous revision: 1.5

/cvs/openide/fs/,v  <--
new revision: 1.13; previous revision: 1.12

/cvs/openide/fs/apichanges.xml,v  <--  apichanges.xml
new revision: 1.17; previous revision: 1.16