Java ClassPath Get getClassPathPath()

Here you can find the source of getClassPathPath()

Description

get Class Path Path

License

Open Source License

Declaration

public static String getClassPathPath() throws Exception 

Method Source Code


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

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Main {
    private static final String ENCODE = "GBK";
    private static String webRoot = "";

    public static String getClassPathPath() throws Exception {
        String path = webRoot + "WEB-INF" + File.separator + "classes";
        path = urlDecoder(path);/*www.jav a2s . co  m*/
        return path;
    }

    private static String urlDecoder(String path) throws UnsupportedEncodingException {
        path = URLDecoder.decode(path, ENCODE);
        return path;
    }
}

Related

  1. getClassPathFile(String pathName)
  2. getClasspathFilePathFromName(String fileName)
  3. getClassPathFor(final Class clazz)
  4. getClasspathForClass(Class targetClass)
  5. getClassPathFromString(String classpath)
  6. getClasspathResource(final String resource)
  7. getClasspathResource(String name)
  8. getClasspathResource(String path)
  9. getClasspathResourceAsFile(String resourceName)