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.

View | Details | Raw Unified | Return to bug 26904
Collapse All | Expand All

(-)openide/api/doc/changes/apichanges.xml (+23 lines)
Lines 584-589 Link Here
584
      <class package="org.openide.util" name="Utilities"/>
584
      <class package="org.openide.util" name="Utilities"/>
585
      <issue number="20882"/>
585
      <issue number="20882"/>
586
    </change>
586
    </change>
587
588
    <change>
589
      <api name="filesystems"/>
590
      <summary><code>FileObject.toString()</code> must return resource path of file object</summary>
591
      <version major="3" minor="6"/>
592
      <date day="29" month="8" year="2002"/>
593
      <author login="jglick"/>
594
      <compatibility semantic="incompatible" modification="yes">
595
        Older <code>FileObject</code> implementations which override
596
        <code>toString</code> in idiosyncratic ways will need to delete the
597
        override (the base implementation is correct). Subclasses of
598
        <code>AbstractFileSystem</code> (the normal case) need not be concerned,
599
        since the corresponding <code>FileObject</code> already implements this
600
        method correctly.
601
      </compatibility>
602
      <description>
603
        File objects must now implement <code>toString()</code> to return the
604
        path to the file object from the filesystem root, which is to say the
605
        same as <code>getPackageNameExt('/',&#160;'.')</code>.
606
      </description>
607
      <class package="org.openide.filesystems" name="FileObject"/>
608
      <issue number="26904"/>
609
    </change>
587
      
610
      
588
    <change>
611
    <change>
589
      <api name="explorer"/>
612
      <api name="explorer"/>
(-)openide/src/org/openide/filesystems/FileObject.java (-3 / +6 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 111-118 Link Here
111
    * to the root of the filesystem. Separates files with provided <code>'/'</code>.
111
    * to the root of the filesystem. Separates files with provided <code>'/'</code>.
112
    * The extension, if present, is separated from the basename with <code>'.'</code>.
112
    * The extension, if present, is separated from the basename with <code>'.'</code>.
113
    * <p><strong>Note:</strong> <samp>fo.getPackageNameExt ('/','.')</samp> 
113
    * <p><strong>Note:</strong> <samp>fo.getPackageNameExt ('/','.')</samp> 
114
    * will have the same effect as using this method. 
114
    * will have the same effect as using this method (guaranteed as of APIs 3.6).
115
    * But it is not guaranteed that this will be so.
115
    * But the result of this method may not have anything to do with the Java
116
    * classpath; instead see the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a>.
116
    * @return the fully-qualified filename e.g. <code>path/from/root.ext</code>
117
    * @return the fully-qualified filename e.g. <code>path/from/root.ext</code>
117
    */
118
    */
118
    public String toString () {
119
    public String toString () {
Lines 129-134 Link Here
129
    * @param separatorChar char to separate folders and files
130
    * @param separatorChar char to separate folders and files
130
    * @param extSepChar char to separate extension
131
    * @param extSepChar char to separate extension
131
    * @return the fully-qualified filename
132
    * @return the fully-qualified filename
133
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
132
    */
134
    */
133
    public String getPackageNameExt (char separatorChar, char extSepChar) {
135
    public String getPackageNameExt (char separatorChar, char extSepChar) {
134
        String pn = getPackageName (separatorChar);
136
        String pn = getPackageName (separatorChar);
Lines 146-151 Link Here
146
    * Like {@link #getPackageNameExt} but omits the extension.
148
    * Like {@link #getPackageNameExt} but omits the extension.
147
    * @param separatorChar char to separate folders and files
149
    * @param separatorChar char to separate folders and files
148
    * @return the fully-qualified filename
150
    * @return the fully-qualified filename
151
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
149
    */
152
    */
150
    public String getPackageName (char separatorChar) {
153
    public String getPackageName (char separatorChar) {
151
        StringBuffer sb = new StringBuffer ();
154
        StringBuffer sb = new StringBuffer ();
(-)openide/src/org/openide/filesystems/FileSystem.java (-10 / +6 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 276-281 Link Here
276
    *
276
    *
277
    * @return a file object that represents a file with the given name or
277
    * @return a file object that represents a file with the given name or
278
    *   <CODE>null</CODE> if the file does not exist
278
    *   <CODE>null</CODE> if the file does not exist
279
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead, or use {@link #findResource} if you are not interested in classpaths.
279
    */
280
    */
280
    public FileObject find (String aPackage, String name, String ext) {
281
    public FileObject find (String aPackage, String name, String ext) {
281
        StringBuffer bf = new StringBuffer ();
282
        StringBuffer bf = new StringBuffer ();
Lines 300-314 Link Here
300
        return findResource (bf.toString ());
301
        return findResource (bf.toString ());
301
    }
302
    }
302
303
303
    /** Finds file when its resource name is given.
304
    /** Finds a file given its full resource path.
304
    * The name has the usual format for the {@link ClassLoader#getResource(String)}
305
    * @param name the resource path, e.g. "dir/subdir/file.ext" or "dir/subdir" or "dir"
305
    * method. So it may consist of "package1/package2/filename.ext".
306
    * @return a file object with the given path or
306
    * If there is no package, it may consist only of "filename.ext".
307
    *   <CODE>null</CODE> if no such file exists
307
    *
308
    * @param name resource name
309
    *
310
    * @return FileObject that represents file with given name or
311
    *   <CODE>null</CODE> if the file does not exist
312
    */
308
    */
313
    public abstract FileObject findResource (String name);
309
    public abstract FileObject findResource (String name);
314
310
(-)openide/src/org/openide/filesystems/FileSystemCapability.java (-8 / +21 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 40-50 Link Here
40
                }
40
                }
41
            };
41
            };
42
42
43
    /** Well known capability of being compiled */
43
    /** Well known capability of being compiled.
44
     * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
45
     */
44
    public static final FileSystemCapability COMPILE = new FileSystemCapability ();
46
    public static final FileSystemCapability COMPILE = new FileSystemCapability ();
45
    /** Well known ability to be executed */
47
    /** Well known ability to be executed.
48
     * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
49
     */
46
    public static final FileSystemCapability EXECUTE = new FileSystemCapability ();
50
    public static final FileSystemCapability EXECUTE = new FileSystemCapability ();
47
    /** Well known ability to be debugged */
51
    /** Well known ability to be debugged.
52
     * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
53
     */
48
    public static final FileSystemCapability DEBUG = new FileSystemCapability ();
54
    public static final FileSystemCapability DEBUG = new FileSystemCapability ();
49
    /** Well known ability to contain documentation files */
55
    /** Well known ability to contain documentation files */
50
    public static final FileSystemCapability DOC = new FileSystemCapability ();
56
    public static final FileSystemCapability DOC = new FileSystemCapability ();
Lines 65-70 Link Here
65
71
66
    /** All filesystems that are capable of this capability.
72
    /** All filesystems that are capable of this capability.
67
    * @return enumeration of FileSystems that satifies this capability
73
    * @return enumeration of FileSystems that satifies this capability
74
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
68
    */
75
    */
69
    public Enumeration fileSystems () {
76
    public Enumeration fileSystems () {
70
        return new FilterEnumeration (ExternalUtil.getRepository ().fileSystems ()) {
77
        return new FilterEnumeration (ExternalUtil.getRepository ().fileSystems ()) {
Lines 77-82 Link Here
77
84
78
    /** Find a resource in repository, ignoring not capable filesystems.
85
    /** Find a resource in repository, ignoring not capable filesystems.
79
    * @param resName name of the resource
86
    * @param resName name of the resource
87
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
80
    */
88
    */
81
    public FileObject findResource (String resName) {
89
    public FileObject findResource (String resName) {
82
        Enumeration en = fileSystems ();
90
        Enumeration en = fileSystems ();
Lines 95-100 Link Here
95
    * that satifies this capability, returning all matches.
103
    * that satifies this capability, returning all matches.
96
    * @param name name of the resource
104
    * @param name name of the resource
97
    * @return enumeration of {@link FileObject}s
105
    * @return enumeration of {@link FileObject}s
106
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
98
    */
107
    */
99
    public Enumeration findAllResources(String name) {
108
    public Enumeration findAllResources(String name) {
100
        Vector v = new Vector(8);
109
        Vector v = new Vector(8);
Lines 122-127 Link Here
122
    *
131
    *
123
    * @return {@link FileObject} that represents file with given name or
132
    * @return {@link FileObject} that represents file with given name or
124
    *   <CODE>null</CODE> if the file does not exist
133
    *   <CODE>null</CODE> if the file does not exist
134
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
125
    */
135
    */
126
    public final FileObject find (String aPackage, String name, String ext) {
136
    public final FileObject find (String aPackage, String name, String ext) {
127
        Enumeration en = fileSystems ();
137
        Enumeration en = fileSystems ();
Lines 147-152 Link Here
147
    *    a package and not a file name
157
    *    a package and not a file name
148
    *
158
    *
149
    * @return enumeration of {@link FileObject}s
159
    * @return enumeration of {@link FileObject}s
160
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
150
    */
161
    */
151
    public final Enumeration findAll (String aPackage, String name, String ext) {
162
    public final Enumeration findAll (String aPackage, String name, String ext) {
152
        Enumeration en = fileSystems ();
163
        Enumeration en = fileSystems ();
Lines 220-231 Link Here
220
        }
231
        }
221
232
222
        /** Getter for value of compiling capability.
233
        /** Getter for value of compiling capability.
234
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
223
        */
235
        */
224
        public boolean getCompile () {
236
        public boolean getCompile () {
225
            return compilation;
237
            return compilation;
226
        }
238
        }
227
239
228
        /** Setter for allowing compiling capability.
240
        /** Setter for allowing compiling capability.
241
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
229
        */
242
        */
230
        public void setCompile(boolean val) {
243
        public void setCompile(boolean val) {
231
            if (val != compilation) {
244
            if (val != compilation) {
Lines 237-248 Link Here
237
        }
250
        }
238
251
239
        /** Getter for value of executiong capability.
252
        /** Getter for value of executiong capability.
253
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
240
        */
254
        */
241
        public boolean getExecute () {
255
        public boolean getExecute () {
242
            return execution;
256
            return execution;
243
        }
257
        }
244
258
245
        /** Setter for allowing executing capability.
259
        /** Setter for allowing executing capability.
260
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
246
        */
261
        */
247
        public void setExecute (boolean val) {
262
        public void setExecute (boolean val) {
248
            if (val != execution) {
263
            if (val != execution) {
Lines 254-265 Link Here
254
        }
269
        }
255
270
256
        /** Getter for value of debugging capability.
271
        /** Getter for value of debugging capability.
272
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
257
        */
273
        */
258
        public boolean getDebug () {
274
        public boolean getDebug () {
259
            return debug;
275
            return debug;
260
        }
276
        }
261
277
262
        /** Setter for allowing debugging capability.
278
        /** Setter for allowing debugging capability.
279
         * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
263
        */
280
        */
264
        public void setDebug (boolean val) {
281
        public void setDebug (boolean val) {
265
            if (val != debug) {
282
            if (val != debug) {
Lines 287-294 Link Here
287
            }
304
            }
288
        }
305
        }
289
306
290
        /** Adds listener.
291
        */
292
        public synchronized void addPropertyChangeListener (PropertyChangeListener l) {
307
        public synchronized void addPropertyChangeListener (PropertyChangeListener l) {
293
            if (supp == null) {
308
            if (supp == null) {
294
                supp = new PropertyChangeSupport (this);
309
                supp = new PropertyChangeSupport (this);
Lines 296-303 Link Here
296
            supp.addPropertyChangeListener (l);
311
            supp.addPropertyChangeListener (l);
297
        }
312
        }
298
313
299
        /** Removes listener.
300
        */
301
        public void removePropertyChangeListener (PropertyChangeListener l) {
314
        public void removePropertyChangeListener (PropertyChangeListener l) {
302
            if (supp != null) {
315
            if (supp != null) {
303
                supp.removePropertyChangeListener (l);
316
                supp.removePropertyChangeListener (l);
(-)openide/src/org/openide/filesystems/Repository.java (-1 / +5 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 * 
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 384-389 Link Here
384
    *
384
    *
385
    * @return {@link FileObject} that represents file with given name or
385
    * @return {@link FileObject} that represents file with given name or
386
    *   <CODE>null</CODE> if the file does not exist
386
    *   <CODE>null</CODE> if the file does not exist
387
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
387
    */
388
    */
388
    public final FileObject find (String aPackage, String name, String ext) {
389
    public final FileObject find (String aPackage, String name, String ext) {
389
        Enumeration en = getFileSystems ();
390
        Enumeration en = getFileSystems ();
Lines 403-408 Link Here
403
    * @see FileSystem#findResource
404
    * @see FileSystem#findResource
404
    * @param name a name of the resource
405
    * @param name a name of the resource
405
    * @return file object or <code>null</code> if the resource can not be found
406
    * @return file object or <code>null</code> if the resource can not be found
407
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
406
    */
408
    */
407
    public final FileObject findResource(String name) {
409
    public final FileObject findResource(String name) {
408
        Enumeration en = getFileSystems ();
410
        Enumeration en = getFileSystems ();
Lines 420-425 Link Here
420
    /** Searches for the given resource among all filesystems, returning all matches.
422
    /** Searches for the given resource among all filesystems, returning all matches.
421
    * @param name name of the resource
423
    * @param name name of the resource
422
    * @return enumeration of {@link FileObject}s
424
    * @return enumeration of {@link FileObject}s
425
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
423
    */
426
    */
424
    public final Enumeration findAllResources(String name) {
427
    public final Enumeration findAllResources(String name) {
425
        Vector v = new Vector(8);
428
        Vector v = new Vector(8);
Lines 444-449 Link Here
444
    *    a package and not a file name
447
    *    a package and not a file name
445
    *
448
    *
446
    * @return enumeration of {@link FileObject}s
449
    * @return enumeration of {@link FileObject}s
450
    * @deprecated Please use the <a href="http://www.netbeans.org/download/dev/javadoc/JavaSupportAPIs/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead.
447
    */
451
    */
448
    public final Enumeration findAll (String aPackage, String name, String ext) {
452
    public final Enumeration findAll (String aPackage, String name, String ext) {
449
        Enumeration en = getFileSystems ();
453
        Enumeration en = getFileSystems ();

Return to bug 26904