Esempio n. 1
0
 private static void getAllResource(Collection<File> files, File currentDir) {
   File[] children = currentDir.listFiles();
   for (File child : children) {
     if (child.isFile()) {
       files.add(child);
     } else if (child.isDirectory()) {
       getAllResource(files, child);
     }
   }
 }
Esempio n. 2
0
  public static Collection<File> getAllResources(ContentContext ctx) {
    GlobalContext globalContext = GlobalContext.getInstance(ctx.getRequest());
    StaticConfig staticConfig = StaticConfig.getInstance(ctx.getRequest().getSession());

    File staticDir =
        new File(
            URLHelper.mergePath(globalContext.getDataFolder(), staticConfig.getStaticFolder()));

    Collection<File> outFiles = new LinkedList<File>();
    getAllResource(outFiles, staticDir);

    return outFiles;
  }