Index: URLMapper.java
===================================================================
RCS file: /cvs/openide/src/org/openide/filesystems/URLMapper.java,v
retrieving revision 1.27
diff -u -r1.27 URLMapper.java
--- URLMapper.java 30 Mar 2004 10:09:35 -0000 1.27
+++ URLMapper.java 1 Apr 2004 16:05:37 -0000
@@ -111,7 +111,9 @@
* findURL(FileObject fo, int type)
.
* @param url to wanted FileObjects
* @return a suitable arry of FileObjects, or empty array if not successful
- * @since 2.22*/
+ * @since 2.22
+ * @deprecated use method {@link #findFileObject findFileObject}
+ */
public static FileObject[] findFileObjects (URL url) {
/** first basic implementation */
Set retSet = new HashSet ();
@@ -131,9 +133,25 @@
return retVal;
}
- /** Get an array of FileObjects for this url
+ /** Find an appropiate instance of FileObject that addresses this url
+ *
+ * @param url url to be converted to file object
+ * @return file object corresponding to url or null if no one was found
+ * @since X.XX
+ */
+ public static FileObject findFileObject (URL url) {
+ FileObject fos[] = URLMapper.findFileObjects(url);
+ return (fos.length != 0) ? fos[0] : null;
+ }
+
+
+ /** Get an array of FileObjects for this url. There is no reason to return array
+ * with size greater than one because method {@link #findFileObject findFileObject}
+ * uses just first element (next elements won't be accepted anyway).
+ *
There isn't necessary to return array here. + * The only one reason is just backward compatibility.
* @param url to wanted FileObjects - * @return a suitable arry of FileObjects, or null + * @return an array of FileObjects with size no greater than one, or null * @since 2.22*/ public abstract FileObject[] getFileObjects (URL url);