任意の種類の fileIO を使用しているとしましょう。
public class example{
public Example(){
File file = new File(getClass().getProtectionDomain().getCodeSource().getLocation());
//file IO process ....
}
}
を使用getClass().getProtectionDomain().getCodeSource().getLocation()
すると、「example.jar」でフルパスを取得できます。では、「example.jar」なしでそのファイルの場所を取得するにはどうすればよいでしょうか?
(つまり、実際にはjarが配置されているフォルダーですが、jar自体へのリンクではありません)