I want to read the path of a file. All I've found is about the class file, how to read the file or how to save the file in this direction.
But what I want is a method that shows me the path like this:
C:/Users/Administrator/Documents/NetBeansProjects/HashmapDemo/HeaderTemplate
So that i can save this direction in a XML file.
I hope it is understandable what I mean, I tend to write things nobody can understand.
I've tried:
public static String getCleanPath() {
ClassLoader classLoader = XmlLoader.class.getClassLoader();
File classpathRoot = new File(classLoader.getResource("").getPath());
return classpathRoot.getPath();
}
So far but like I said, it doesn't give me the information I need.