Skip to content

Instantly share code, notes, and snippets.

@daichan4649
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daichan4649/093ba0048319830d8d77 to your computer and use it in GitHub Desktop.
Save daichan4649/093ba0048319830d8d77 to your computer and use it in GitHub Desktop.
クラスパス内ファイルのフルパス取得
// クラスパスルートからの相対パスを指定
private static final String relativePath = "/resources/aaa.txt";
private String getRealResourcePath(String relativePath) {
return getClass().getClassLoader().getResource(relativePath).getPath();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment