/** Adds new filesystem to the pool. * <em>Note</em> that a filesystem cannot be assigned to more than one file * system pool at one time (though currently there is only one pool anyway). * At any given time, no two filesystems in the pool may share the same {@link FileSystem#getSystemName name} * (unless all but one are {@link FileSystem#isValid invalid}). To be sure, that * filesystem was really added in Repository, then test that <code>FileSystem</code> * is valid. * @param fs filesystem to add * @deprecated Please use the <a href="@org-netbeans-api-java-classpath@/org/netbeans/api/java/classpath/ClassPath.html">ClassPath API</a> instead. */ @Deprecated public final void addFileSystem(FileSystem fs) { boolean fireIt; synchronized (this) { fireIt = addFileSystemImpl(fs); } // postponed firing after synchronized block to prevent deadlock if (fireIt) { fireFileSystem(fs, true); } }
/** Removes a filesystem from the pool. * @param fs filesystem to remove * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final void removeFileSystem (FileSystem fs) { boolean fireIt = false; synchronized (this) { if (fs.isDefault()) return; if (fireIt = fileSystems.remove(fs)) { fs.setRepository (null); fileSystemsClone = (ArrayList)fileSystems.clone(); // the filesystem realy was here if (fs.isValid ()) { // if the filesystem is valid then is in names hashtable names.remove (fs.getSystemName ()); fs.setValid (false); } // in all cases remove it from listeners fs.removePropertyChangeListener (propListener); fs.removeVetoableChangeListener (vetoListener); // notify filesystem itself that it has been removed fs.removeNotify(); } // unassign the filesystem fs.assigned = false; } // postponed firing after synchronized block to prevent deadlock if (fireIt) fireFileSystem (fs, false); }
/** Removes a filesystem from the pool. * @param fs filesystem to remove * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final void removeFileSystem (FileSystem fs) { boolean fireIt = false; synchronized (this) { if (fs.isDefault()) return; if (fireIt = fileSystems.remove(fs)) { fs.setRepository (null); fileSystemsClone = (ArrayList)fileSystems.clone(); // the filesystem realy was here if (fs.isValid ()) { // if the filesystem is valid then is in names hashtable names.remove (fs.getSystemName ()); fs.setValid (false); } // in all cases remove it from listeners fs.removePropertyChangeListener (propListener); fs.removeVetoableChangeListener (vetoListener); // notify filesystem itself that it has been removed fs.removeNotify(); } // unassign the filesystem fs.assigned = false; } // postponed firing after synchronized block to prevent deadlock if (fireIt) fireFileSystem (fs, false); }