FileObject.toString()
must return resource path of file objectFileObject
implementations which override
+ toString
in idiosyncratic ways will need to delete the
+ override (the base implementation is correct). Subclasses of
+ AbstractFileSystem
(the normal case) need not be concerned,
+ since the corresponding FileObject
already implements this
+ method correctly.
+ toString()
to return the
+ path to the file object from the filesystem root, which is to say the
+ same as getPackageNameExt('/', '.')
.
+ '/'
.
* The extension, if present, is separated from the basename with '.'
.
* Note: fo.getPackageNameExt ('/','.')
- * will have the same effect as using this method.
- * But it is not guaranteed that this will be so.
+ * will have the same effect as using this method (guaranteed as of APIs 3.6).
+ * But the result of this method may not have anything to do with the Java
+ * classpath; instead see the ClassPath API.
* @return the fully-qualified filename e.g. path/from/root.ext
*/
public String toString () {
@@ -129,6 +130,7 @@
* @param separatorChar char to separate folders and files
* @param extSepChar char to separate extension
* @return the fully-qualified filename
+ * @deprecated Please use the ClassPath API instead.
*/
public String getPackageNameExt (char separatorChar, char extSepChar) {
String pn = getPackageName (separatorChar);
@@ -146,6 +148,7 @@
* Like {@link #getPackageNameExt} but omits the extension.
* @param separatorChar char to separate folders and files
* @return the fully-qualified filename
+ * @deprecated Please use the ClassPath API instead.
*/
public String getPackageName (char separatorChar) {
StringBuffer sb = new StringBuffer ();
Index: openide/src/org/openide/filesystems/FileSystem.java
===================================================================
RCS file: /cvs/openide/src/org/openide/filesystems/FileSystem.java,v
retrieving revision 1.63
diff -u -r1.63 FileSystem.java
--- openide/src/org/openide/filesystems/FileSystem.java 24 Apr 2002 15:08:57 -0000 1.63
+++ openide/src/org/openide/filesystems/FileSystem.java 30 Aug 2002 01:35:01 -0000
@@ -7,7 +7,7 @@
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
- * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
* Microsystems, Inc. All Rights Reserved.
*/
@@ -276,6 +276,7 @@
*
* @return a file object that represents a file with the given name or
* null
if the file does not exist
+ * @deprecated Please use the ClassPath API instead, or use {@link #findResource} if you are not interested in classpaths.
*/
public FileObject find (String aPackage, String name, String ext) {
StringBuffer bf = new StringBuffer ();
@@ -300,15 +301,10 @@
return findResource (bf.toString ());
}
- /** Finds file when its resource name is given.
- * The name has the usual format for the {@link ClassLoader#getResource(String)}
- * method. So it may consist of "package1/package2/filename.ext".
- * If there is no package, it may consist only of "filename.ext".
- *
- * @param name resource name
- *
- * @return FileObject that represents file with given name or
- * null
if the file does not exist
+ /** Finds a file given its full resource path.
+ * @param name the resource path, e.g. "dir/subdir/file.ext" or "dir/subdir" or "dir"
+ * @return a file object with the given path or
+ * null
if no such file exists
*/
public abstract FileObject findResource (String name);
Index: openide/src/org/openide/filesystems/FileSystemCapability.java
===================================================================
RCS file: /cvs/openide/src/org/openide/filesystems/FileSystemCapability.java,v
retrieving revision 1.14
diff -u -r1.14 FileSystemCapability.java
--- openide/src/org/openide/filesystems/FileSystemCapability.java 15 Apr 2002 15:24:47 -0000 1.14
+++ openide/src/org/openide/filesystems/FileSystemCapability.java 30 Aug 2002 01:35:01 -0000
@@ -7,7 +7,7 @@
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
- * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
* Microsystems, Inc. All Rights Reserved.
*/
@@ -40,11 +40,17 @@
}
};
- /** Well known capability of being compiled */
+ /** Well known capability of being compiled.
+ * @deprecated Please use the ClassPath API instead.
+ */
public static final FileSystemCapability COMPILE = new FileSystemCapability ();
- /** Well known ability to be executed */
+ /** Well known ability to be executed.
+ * @deprecated Please use the ClassPath API instead.
+ */
public static final FileSystemCapability EXECUTE = new FileSystemCapability ();
- /** Well known ability to be debugged */
+ /** Well known ability to be debugged.
+ * @deprecated Please use the ClassPath API instead.
+ */
public static final FileSystemCapability DEBUG = new FileSystemCapability ();
/** Well known ability to contain documentation files */
public static final FileSystemCapability DOC = new FileSystemCapability ();
@@ -65,6 +71,7 @@
/** All filesystems that are capable of this capability.
* @return enumeration of FileSystems that satifies this capability
+ * @deprecated Please use the ClassPath API instead.
*/
public Enumeration fileSystems () {
return new FilterEnumeration (ExternalUtil.getRepository ().fileSystems ()) {
@@ -77,6 +84,7 @@
/** Find a resource in repository, ignoring not capable filesystems.
* @param resName name of the resource
+ * @deprecated Please use the ClassPath API instead.
*/
public FileObject findResource (String resName) {
Enumeration en = fileSystems ();
@@ -95,6 +103,7 @@
* that satifies this capability, returning all matches.
* @param name name of the resource
* @return enumeration of {@link FileObject}s
+ * @deprecated Please use the ClassPath API instead.
*/
public Enumeration findAllResources(String name) {
Vector v = new Vector(8);
@@ -122,6 +131,7 @@
*
* @return {@link FileObject} that represents file with given name or
* null
if the file does not exist
+ * @deprecated Please use the ClassPath API instead.
*/
public final FileObject find (String aPackage, String name, String ext) {
Enumeration en = fileSystems ();
@@ -147,6 +157,7 @@
* a package and not a file name
*
* @return enumeration of {@link FileObject}s
+ * @deprecated Please use the ClassPath API instead.
*/
public final Enumeration findAll (String aPackage, String name, String ext) {
Enumeration en = fileSystems ();
@@ -220,12 +231,14 @@
}
/** Getter for value of compiling capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public boolean getCompile () {
return compilation;
}
/** Setter for allowing compiling capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public void setCompile(boolean val) {
if (val != compilation) {
@@ -237,12 +250,14 @@
}
/** Getter for value of executiong capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public boolean getExecute () {
return execution;
}
/** Setter for allowing executing capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public void setExecute (boolean val) {
if (val != execution) {
@@ -254,12 +269,14 @@
}
/** Getter for value of debugging capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public boolean getDebug () {
return debug;
}
/** Setter for allowing debugging capability.
+ * @deprecated Please use the ClassPath API instead.
*/
public void setDebug (boolean val) {
if (val != debug) {
@@ -287,8 +304,6 @@
}
}
- /** Adds listener.
- */
public synchronized void addPropertyChangeListener (PropertyChangeListener l) {
if (supp == null) {
supp = new PropertyChangeSupport (this);
@@ -296,8 +311,6 @@
supp.addPropertyChangeListener (l);
}
- /** Removes listener.
- */
public void removePropertyChangeListener (PropertyChangeListener l) {
if (supp != null) {
supp.removePropertyChangeListener (l);
Index: openide/src/org/openide/filesystems/Repository.java
===================================================================
RCS file: /cvs/openide/src/org/openide/filesystems/Repository.java,v
retrieving revision 1.40
diff -u -r1.40 Repository.java
--- openide/src/org/openide/filesystems/Repository.java 14 Aug 2002 18:25:02 -0000 1.40
+++ openide/src/org/openide/filesystems/Repository.java 30 Aug 2002 01:35:01 -0000
@@ -7,7 +7,7 @@
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
- * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
* Microsystems, Inc. All Rights Reserved.
*/
@@ -384,6 +384,7 @@
*
* @return {@link FileObject} that represents file with given name or
* null
if the file does not exist
+ * @deprecated Please use the ClassPath API instead.
*/
public final FileObject find (String aPackage, String name, String ext) {
Enumeration en = getFileSystems ();
@@ -403,6 +404,7 @@
* @see FileSystem#findResource
* @param name a name of the resource
* @return file object or null
if the resource can not be found
+ * @deprecated Please use the ClassPath API instead.
*/
public final FileObject findResource(String name) {
Enumeration en = getFileSystems ();
@@ -420,6 +422,7 @@
/** Searches for the given resource among all filesystems, returning all matches.
* @param name name of the resource
* @return enumeration of {@link FileObject}s
+ * @deprecated Please use the ClassPath API instead.
*/
public final Enumeration findAllResources(String name) {
Vector v = new Vector(8);
@@ -444,6 +447,7 @@
* a package and not a file name
*
* @return enumeration of {@link FileObject}s
+ * @deprecated Please use the ClassPath API instead.
*/
public final Enumeration findAll (String aPackage, String name, String ext) {
Enumeration en = getFileSystems ();