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 41506
Collapse All | Expand All

(-)api/doc/changes/apichanges.xml (+17 lines)
Line 119 Link Here
119
    <api name="filesystems"/>
120
    <summary>There should exist just one FileObject for one resource (java.io.File or URL).  </summary>
121
    <version major="4" minor="29"/>
122
    <date day="9" month="4" year="2004"/>
123
    <author login="rmatous"/>
124
    <compatibility addition="yes" modification="yes" deprecation="yes" semantic="compatible"/>
125
    <description>
126
        <ul>
127
            <li>Added method FileUtil.toFileObject as replacement for current method FileUtil.fromFile which was deprecated.</li>
128
            <li>Added method URLMapper.findFileObject as replacement for current method URLMapper.findFileObjects which was deprecated .</li>
129
        </ul>
130
    </description>
131
    <class package="org.openide.filesystems" name="FileUtil"/>
132
    <class package="org.openide.filesystems" name="URLMapper"/>
133
    <issue number="41506"/>
134
    </change>
135
    <change>
(-)src/org/openide/filesystems/FileUtil.java (-4 / +13 lines)
Line 276 Link Here
276
     * If not possible then null is returned.
277
     * @param file File whose coresponding FileObjects will be looked for
278
     * @return corresponding FileObject or null
279
     * @since X.XX
280
     */
281
    public static FileObject toFileObject (File file) {
282
        FileObject[] fileObjects = fromFile (file);
283
        return (fileObjects != null && fileObjects.length > 0) ? fileObjects[0] : null;
284
    }
285
    /** Finds appropriate FileObjects to java.io.File if possible.
Line 282 Link Here
293
     * @deprecated Use method {@link #toFileObject toFileObject}
Line 858 Link Here
858
        return findFileObject(getArchiveRoot(archiveURL));
870
        return URLMapper.findFileObject(getArchiveRoot(archiveURL));
859
--
Line 967 Link Here
967
        FileObject fo = findFileObject(url);
979
        FileObject fo = URLMapper.findFileObject(url);
968
--
(-)src/org/openide/filesystems/URLMapper.java (-6 / +28 lines)
Line 114 Link Here
114
     * @since  2.22*/
114
     * @since  2.22
115
--
115
     * @deprecated use method {@link #findFileObject findFileObject}
116
     */
Line 134 Link Here
134
    /** Get an array of FileObjects for this url
136
    /** Find an appropiate instance of FileObject that addresses this url
135
--
137
     *
138
     * @param url url to be converted to file object
139
     * @return file object corresponding to url or null if no one was found
140
     * @since  X.XX
141
     */
142
    public static FileObject findFileObject (URL url) {
143
        FileObject fos[] = URLMapper.findFileObjects(url);
144
        if (fos.length == 0) {
145
            return null;
146
        }
147
        // prefer file object from master filesystem
148
        for (int i=0; i<fos.length; i++) {
149
            if (fos[i].getClass().getName().indexOf("masterfs") != -1) {        //NOI18N
150
                return fos[i];
151
            }
152
        }
153
        return fos[0];
154
    }
155
    /** Get an array of FileObjects for this url. There is no reason to return array
156
     * with size greater than one because method {@link #findFileObject findFileObject}
157
     * uses just first element (next elements won't be accepted anyway).
158
     * <p class="nonnormative"> There isn't necessary to return array here.
159
     * The only one reason is just backward compatibility.</p>
Line 136 Link Here
136
     * @return a suitable arry of FileObjects, or null
163
     * @return an array of FileObjects with size no greater than one, or null
137
--

Return to bug 41506