title: Using Commons-VFS over HTTP
body: <p>I am trying to browse and retrieve files from an HTTP server using the Commons VFS to implement the directory browsing functionality, find below my code snippet,</p>
  
  <pre><code>try {
      StandardFileSystemManager manager = new StandardFileSystemManager();
      manager.addProvider("http", new HttpFileProvider());
      manager.setCacheStrategy(CacheStrategy.ON_CALL);
      manager.setFilesCache(new SoftRefFilesCache());
      FileObject fileObject = manager.resolveFile("http://localhost");
      System.out.println(fileObject.getChildren());
  } catch (FileSystemException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  </code></pre>
  
  <p>But when i run this code i get the following exception,</p>
  
  <pre><code>org.apache.commons.vfs.FileSystemException: Could not list the contents of "http://localhost/" because it is not a folder.
  at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractFileObject.java:527)
  at org.apache.commons.vfs.impl.DecoratedFileObject.getChildren(DecoratedFileObject.java:105)
  at org.apache.commons.vfs.cache.OnCallRefreshFileObject.getChildren(OnCallRefreshFileObject.java:105)
  at VFSClient.main(VFSClient.java:31)
  </code></pre>
  
  <p>But the server is up and running and am able to browse the directories. </p>
  
  <p>Can anyone tell me what could be reason for this error, am I missing something ??</p>