Return to Snippet

Revision: 26609
at May 4, 2010 04:17 by AndreasKT


Initial Code
	public static String getResourcePath() {
		String className = ConfigUser.class.getName();
		String classNamePath = className.replace(".", "/") + ".class";
		URL is = ConfigUser.class.getClassLoader().getResource(classNamePath);
		String path = is.getFile();
		path = StringUtils.substringBefore(path, "classes");
		path = StringUtils.replace(path, "%20", " ");

		return StringUtils.removeStart(path, "/");
	}

Initial URL

                                

Initial Description

                                

Initial Title
getResourcePath

Initial Tags
path

Initial Language
Java