Пример #1
0
  public static void directoryListJSON(
      IVResource dir, String path, User user, JSONWriter jsonWriter) {
    if (dir.exists()) {
      IVResource[] listFiles = dir.listFiles();
      for (int j = 0; j < listFiles.length; j++) {
        IVResource member = listFiles[j];
        if (Resource.isHidden(member)) continue;

        jsonWriter
            .startObject()
            .addField("name", member.getName())
            .addField("isDir", member.isDirectory())
            .endObject();
      }
      List links = user.getLinks().findLinks(path);
      for (Iterator iterator = links.iterator(); iterator.hasNext(); ) {
        Link link = (Link) iterator.next();
        jsonWriter
            .startObject()
            .addField("name", link.name)
            .addField("isDir", true)
            .addField("link", link.location)
            .endObject();
      }
    }
    /*
    if (path.equals(".") || path.length()==0 || jsonWriter.isEmpty())
    {
    	ServerManager.getServerManger().getLibraryManager().listFiles(path,jsonWriter);

    }
    */

  }
Пример #2
0
 @Override
 public boolean isDirectory() {
   // TODO Auto-generated method stub
   return original.isDirectory();
 }