// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.File;

public class Path {
    public static void main(String[] args) throws Exception {
        System.out.println(Path.class.getProtectionDomain().getCodeSource().getLocation().getPath());
        File f = new File(Path.class.getProtectionDomain().getCodeSource().getLocation().getPath());
        System.out.println(f);
        for(String fnm : f.list()) {
            System.out.println(fnm);
        }
        System.out.println(Path.class.getClassLoader().getResource("Path.class").getPath());
        File f2 = new File(Path.class.getClassLoader().getResource("Path.class").getPath()).getParentFile();
        System.out.println(f2);
        for(String fnm : f2.list()) {
            System.out.println(fnm);
        }
        
    }
}
