public static VFS getVFSForProtocol(String protocol) { if (protocol.equals("file")) return fileVFS; else { VFS vfs = (VFS) ServiceManager.getService(SERVICE, protocol); if (vfs == null) vfs = (VFS) protocolHash.get(protocol); if (vfs != null) return vfs; else return urlVFS; } }
public static String[] getVFSs() { List returnValue = new LinkedList(); String[] newAPI = ServiceManager.getServiceNames(SERVICE); if (newAPI != null) { for (int i = 0; i < newAPI.length; i++) { returnValue.add(newAPI[i]); } } Enumeration oldAPI = vfsHash.keys(); while (oldAPI.hasMoreElements()) returnValue.add(oldAPI.nextElement()); return (String[]) returnValue.toArray(new String[returnValue.size()]); }
public static VFS getVFSByName(String name) { VFS vfs = (VFS) ServiceManager.getService(SERVICE, name); if (vfs == null) return (VFS) vfsHash.get(name); else return vfs; }