/** Returns enumeration of all filesystems. * @return enumeration of type {@link FileSystem} * @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 Enumeration<? extends FileSystem> fileSystems() { return getFileSystems(); }
/** 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 <a href="@org-netbeans-api-java-classpath@/org/netbeans/api/java/classpath/ClassPath.html">ClassPath API</a> instead. */ @Deprecated public final Enumeration<? extends FileObject> findAllResources(String name) { assert false : "Deprecated."; Vector<FileObject> v = new Vector<FileObject>(8); Enumeration<? extends FileSystem> en = getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = en.nextElement(); FileObject fo = fs.findResource(name); if (fo != null) { v.addElement(fo); } } return v.elements(); }
private static JarFileSystem findJarFileSystem(File jarFile) { JarFileSystem retVal = null; @SuppressWarnings("deprecation") // keep for backward compatibility w/ NB 3.x Enumeration<? extends FileSystem> en = Repository.getDefault().getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = en.nextElement(); if (fs instanceof JarFileSystem) { File fsJarFile = ((JarFileSystem) fs).getJarFile(); if (fsJarFile.equals(jarFile)) { retVal = (JarFileSystem) fs; break; } } } return retVal; }
/** Searches for the given resource among all filesystems. * @see FileSystem#findResource * @param name a name of the resource * @return file object or <code>null</code> if the resource can not be found * @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 FileObject findResource(String name) { assert false : "Deprecated."; Enumeration<? extends FileSystem> en = getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = en.nextElement(); FileObject fo = fs.findResource(name); if (fo != null) { // object found return fo; } } return null; }
/** Finds all files among all filesystems matching a given name, returning all matches. * All filesystems are queried with {@link FileSystem#find}. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return enumeration of {@link FileObject}s * @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 Enumeration<? extends FileObject> findAll(String aPackage, String name, String ext) { assert false : "Deprecated."; Enumeration<? extends FileSystem> en = getFileSystems(); Vector<FileObject> ret = new Vector<FileObject>(); while (en.hasMoreElements()) { FileSystem fs = (FileSystem) en.nextElement(); FileObject fo = fs.find(aPackage, name, ext); if (fo != null) { ret.addElement(fo); } } return ret.elements(); }
/** Finds file when its name is provided. It scans in the list of * filesystems and asks them for the specified file by a call to * {@link FileSystem#find find}. The first object that is found is returned or <CODE>null</CODE> * if none of the filesystems contain such a file. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return {@link FileObject} that represents file with given name or * <CODE>null</CODE> if the file does not exist * @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 FileObject find(String aPackage, String name, String ext) { assert false : "Deprecated."; Enumeration<? extends FileSystem> en = getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = en.nextElement(); FileObject fo = fs.find(aPackage, name, ext); if (fo != null) { // object found return fo; } } return null; }
Enumeration<? extends FileSystem> en = Repository.getDefault().getFileSystems(); LinkedList<FileObject> list = new LinkedList<FileObject>(); String fileName = f.getAbsolutePath();
Enumeration<? extends FileSystem> ee = getFileSystems(); FileSystem fs;
/** Returns enumeration of all filesystems. * @return enumeration of type {@link FileSystem} * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration fileSystems () { return getFileSystems (); }
/** Returns enumeration of all filesystems. * @return enumeration of type {@link FileSystem} * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration fileSystems () { return getFileSystems (); }
/** 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 <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration findAllResources(String name) { assert FileUtil.assertDeprecatedMethod(); Vector v = new Vector(8); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.findResource(name); if (fo != null) { v.addElement(fo); } } return v.elements(); }
/** 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 <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration findAllResources(String name) { assert FileUtil.assertDeprecatedMethod(); Vector v = new Vector(8); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.findResource(name); if (fo != null) { v.addElement(fo); } } return v.elements(); }
private static JarFileSystem findJarFileSystem(File jarFile) { JarFileSystem retVal = null; Enumeration en = Repository.getDefault().getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = (FileSystem)en.nextElement(); if (fs instanceof JarFileSystem) { File fsJarFile = ((JarFileSystem)fs).getJarFile(); if (fsJarFile.equals(jarFile)) { retVal = (JarFileSystem)fs; break; } } } return retVal; }
private static JarFileSystem findJarFileSystem(File jarFile) { JarFileSystem retVal = null; Enumeration en = Repository.getDefault().getFileSystems(); while (en.hasMoreElements()) { FileSystem fs = (FileSystem)en.nextElement(); if (fs instanceof JarFileSystem) { File fsJarFile = ((JarFileSystem)fs).getJarFile(); if (fsJarFile.equals(jarFile)) { retVal = (JarFileSystem)fs; break; } } } return retVal; }
/** Searches for the given resource among all filesystems. * @see FileSystem#findResource * @param name a name of the resource * @return file object or <code>null</code> if the resource can not be found * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final FileObject findResource(String name) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.findResource(name); if (fo != null) { // object found return fo; } } return null; }
/** Finds all files among all filesystems matching a given name, returning all matches. * All filesystems are queried with {@link FileSystem#find}. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return enumeration of {@link FileObject}s * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration findAll (String aPackage, String name, String ext) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); Vector ret = new Vector(); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.find (aPackage, name, ext); if (fo != null) { ret.addElement(fo); } } return ret.elements(); }
/** Searches for the given resource among all filesystems. * @see FileSystem#findResource * @param name a name of the resource * @return file object or <code>null</code> if the resource can not be found * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final FileObject findResource(String name) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.findResource(name); if (fo != null) { // object found return fo; } } return null; }
/** Finds all files among all filesystems matching a given name, returning all matches. * All filesystems are queried with {@link FileSystem#find}. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return enumeration of {@link FileObject}s * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final Enumeration findAll (String aPackage, String name, String ext) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); Vector ret = new Vector(); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.find (aPackage, name, ext); if (fo != null) { ret.addElement(fo); } } return ret.elements(); }
/** Finds file when its name is provided. It scans in the list of * filesystems and asks them for the specified file by a call to * {@link FileSystem#find find}. The first object that is found is returned or <CODE>null</CODE> * if none of the filesystems contain such a file. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return {@link FileObject} that represents file with given name or * <CODE>null</CODE> if the file does not exist * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final FileObject find (String aPackage, String name, String ext) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.find (aPackage, name, ext); if (fo != null) { // object found return fo; } } return null; }
/** Finds file when its name is provided. It scans in the list of * filesystems and asks them for the specified file by a call to * {@link FileSystem#find find}. The first object that is found is returned or <CODE>null</CODE> * if none of the filesystems contain such a file. * * @param aPackage package name where each package is separated by a dot * @param name name of the file (without dots) or <CODE>null</CODE> if * one wants to obtain the name of a package and not a file in it * @param ext extension of the file or <CODE>null</CODE> if one needs * a package and not a file name * * @return {@link FileObject} that represents file with given name or * <CODE>null</CODE> if the file does not exist * @deprecated Please use the <a href="@JAVA/API@/org/netbeans/api/java/classpath/api.html">ClassPath API</a> instead. */ public final FileObject find (String aPackage, String name, String ext) { assert FileUtil.assertDeprecatedMethod(); Enumeration en = getFileSystems (); while (en.hasMoreElements ()) { FileSystem fs = (FileSystem)en.nextElement (); FileObject fo = fs.find (aPackage, name, ext); if (fo != null) { // object found return fo; } } return null; }