Java Resource Load getResourceInDirPackage(String packageName, String packagePath, final boolean recursive, List classes)

Here you can find the source of getResourceInDirPackage(String packageName, String packagePath, final boolean recursive, List classes)

Description

get Resource In Dir Package

License

Open Source License

Declaration

private static void getResourceInDirPackage(String packageName, String packagePath, final boolean recursive,
            List<String> classes) 

Method Source Code


//package com.java2s;
import java.io.File;

import java.util.List;

public class Main {
    private static void getResourceInDirPackage(String packageName, String packagePath, final boolean recursive,
            List<String> classes) {
        File dir = new File(packagePath);

        if (!dir.exists() || !dir.isDirectory()) {
            return;
        }/*  ww w . j  av a2  s.  c  o  m*/

        File[] dirfiles = dir.listFiles();

        for (File file : dirfiles) {
            if (file.isDirectory()) {
                getResourceInDirPackage(packageName + "." + file.getName(), file.getAbsolutePath(), recursive,
                        classes);
            } else {
                classes.add(packageName + "." + file.getName());
            }
        }
    }
}

Related

  1. getResourceFile(Class theClass, String fileName)
  2. getResourceFile(String relativeResourceFilePathname)
  3. getResourceFile(String resource)
  4. getResourceFile(String resourceName)
  5. getResourceFromJar(File fromFile, String insideFile)
  6. getResourceList(File fdir, String extn)
  7. getResourceListing(URL pathUrl, String prefix, String suffix)
  8. getResourceNameFromFileName(final String pFileName)
  9. getResourceNames(File dir)