Java Class Loader loadClassifiers(String dataDirectoryName)

Here you can find the source of loadClassifiers(String dataDirectoryName)

Description

load Classifiers

License

Open Source License

Declaration

public static Map<String, String[]> loadClassifiers(String dataDirectoryName) throws URISyntaxException 

Method Source Code

//package com.java2s;

import java.io.File;

import java.net.URISyntaxException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static Map<String, String[]> loadClassifiers(String dataDirectoryName) throws URISyntaxException {

        Map<String, String[]> classifiers = new HashMap<>();
        URL dir_url = ClassLoader.getSystemResource(dataDirectoryName);
        File dir = new File(dir_url.toURI());
        for (String dirName : dir.list()) {
            File file = new File(
                    ClassLoader.getSystemResource(dataDirectoryName + File.separator + dirName).toURI());
            if (file.isDirectory()) {
                classifiers.put(file.getName(), file.list());
            }/*from  ww w.ja  v  a 2 s .  co m*/
        }
        return classifiers;
    }
}

Related

  1. loadClass(String dir, String classname)
  2. loadClass(String name)
  3. loadClass(String name, Object fallbackClass)
  4. loadClasses(Collection filenames, String packageName, File outputDir)
  5. loadClassesImplementsTheInterface(String packageName, Class interfaceClazz)
  6. loadConfig(String path, ClassLoader classLoader)
  7. loadForClass(final Class clazz, final String filename)
  8. loadManifest(Class manifestFileClass)
  9. loadManifest(Class theClass)