Skip to content

Instantly share code, notes, and snippets.

@seungdols
Forked from choiseungho/GetFilePath.java
Created November 26, 2015 12:31
Show Gist options
  • Save seungdols/fb09ad80e50240a86639 to your computer and use it in GitHub Desktop.
Save seungdols/fb09ad80e50240a86639 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