cvs diff -r 1.4 -u -- LocalFileSystemEx.java (in directory D:\projects\nb.reset_settings\core\startup\src\org\netbeans\core\startup\layers\) Index: LocalFileSystemEx.java =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/layers/LocalFileSystemEx.java,v retrieving revision 1.4 retrieving revision 1.2.12.1 diff -u -r1.4 -r1.2.12.1 --- LocalFileSystemEx.java 1 Jul 2006 08:52:48 -0000 1.4 +++ LocalFileSystemEx.java 25 Jul 2006 13:49:40 -0000 1.2.12.1 @@ -20,12 +20,14 @@ package org.netbeans.core.startup.layers; import java.io.IOException; +import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.Set; import java.util.Iterator; +import java.util.concurrent.Callable; import java.util.logging.Level; import java.util.logging.Logger; import org.openide.filesystems.*; @@ -89,7 +91,13 @@ /** Creates new LocalFileSystemEx */ public LocalFileSystemEx () { - super (); + this( false ); + } + + LocalFileSystemEx( boolean supportRemoveWritablesAttr ) { + if( supportRemoveWritablesAttr ) { + attr = new DelegatingAttributes( attr ); + } } protected void lock (String name) throws IOException { @@ -125,5 +133,53 @@ } } super.unlock (name); + } + + private class DelegatingAttributes implements AbstractFileSystem.Attr { + + private AbstractFileSystem.Attr a; + + public DelegatingAttributes( AbstractFileSystem.Attr a ) { + this.a = a; + } + + public Object readAttribute(String name, String attrName) { + if( "removeWritables".equals( attrName ) ) { + return new WritableRemover( name ); + } + return a.readAttribute( name, attrName ); + } + + public void writeAttribute(String name, String attrName, Object value) throws IOException { + a.writeAttribute( name, attrName, value ); + } + + public Enumeration attributes(String name) { + return a.attributes( name ); + } + + public void renameAttributes(String oldName, String newName) { + a.readAttribute( oldName, newName ); + } + + public void deleteAttributes(String name) { + a.deleteAttributes( name ); + } + } + + private class WritableRemover implements Callable { + private String name; + public WritableRemover( String name ) { + this.name = name; + } + + public Object call() throws Exception { + FileObject fo = findResource( name ); + if( null != fo ) { + fo.delete(); + } + return null; + } + } } ***** CVS exited normally with code 1 ***** cvs diff -r 1.7 -u -- SystemFileSystem.java (in directory D:\projects\nb.reset_settings\core\startup\src\org\netbeans\core\startup\layers\) Index: SystemFileSystem.java =================================================================== RCS file: /cvs/core/startup/src/org/netbeans/core/startup/layers/SystemFileSystem.java,v retrieving revision 1.7 retrieving revision 1.5.10.2 diff -u -r1.7 -r1.5.10.2 --- SystemFileSystem.java 1 Jul 2006 08:52:49 -0000 1.7 +++ SystemFileSystem.java 25 Jul 2006 13:49:40 -0000 1.5.10.2 @@ -248,7 +248,7 @@ if (!userDir.exists ()) { userDir.mkdirs (); } - LocalFileSystem l = new LocalFileSystemEx (); + LocalFileSystem l = new LocalFileSystemEx ( true ); l.setRootDirectory (userDir); user = l; } else { @@ -301,6 +301,7 @@ new NotSerializableException ("WARNING - SystemFileSystem is not designed to be serialized").printStackTrace (); // NOI18N return new SingletonSerializer (); } + private static final class SingletonSerializer extends Object implements Serializable { private static final long serialVersionUID = 6436781994611L; SingletonSerializer() {}