Java Class Loader getLoadingDir(Class clazz)

Here you can find the source of getLoadingDir(Class clazz)

Description

get Loading Dir

License

LGPL

Declaration

@SuppressWarnings("rawtypes")
    public static File getLoadingDir(Class clazz) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.File;

import java.net.URISyntaxException;

public class Main {
    @SuppressWarnings("rawtypes")
    public static File getLoadingDir(Class clazz) {
        try {/* www  . j av a2  s  .  c  o  m*/
            return new File(clazz.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
        } catch (URISyntaxException e) {
            return null;
        }
    }
}

Related

  1. getClassLocation(String className)
  2. getCustomClassloader(List entries)
  3. getFileFromClassLoader(String fileName)
  4. getFilesByPackgeName(String packageName, File _file, ClassLoader classLoader, List list)
  5. getJvmExtClassLoader()
  6. getManifest(ClassLoader cl, String extension)
  7. getPackageFolder(String packageName, ClassLoader classLoader)
  8. getParentClassLoader()
  9. getProjectClassLoader(IJavaProject javaProject)