Ejemplo n.º 1
0
  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;
    }
  }
Ejemplo n.º 2
0
  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()]);
  }
Ejemplo n.º 3
0
  public static VFS getVFSByName(String name) {

    VFS vfs = (VFS) ServiceManager.getService(SERVICE, name);
    if (vfs == null) return (VFS) vfsHash.get(name);
    else return vfs;
  }