Skip to content

Instantly share code, notes, and snippets.

@choiseungho
Last active November 26, 2015 12:31
Show Gist options
  • Save choiseungho/60c651665eeaeb9a16c9 to your computer and use it in GitHub Desktop.
Save choiseungho/60c651665eeaeb9a16c9 to your computer and use it in GitHub Desktop.
Class의 디렉토리 경로를 가져오는 방법
String path = GetFilePath.class.getResource("").getPath();//현재 자신의 경로
String path = GetFilePath.class.getResource("/").getPath();//classes의 최상위 경로
new File("").getAbsolutePath();//절대 경로
new File("").getCanonicalPath();//상대 경로
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment