Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- import
- Quartz
- context
- Windows
- vscode
- Windows 10
- bash
- grep
- plugin
- lsof
- web.xml
- VirtualBox
- resource
- JavaScript
- maVen
- Eclipse
- port
- netsh
- 네트워크
- xargs
- profile
- ssh
- Source
- Mac
- IntelliJ
- 줄바꿈 문자
- find
- 단축키
- tomcat
- GIT
Archives
- Today
- Total
develog
getAbsolutePath, getCanonicalPath 본문
// 현재 디렉토리
// C:\Documents and Settings\Administrator\workspace\testApp
1. getAbsolutePath (., .. 을 계산하지 않고 그대로 출력)
System.out.println(new File(".").getAbsolutePath());
System.out.println(new File("..").getAbsolutePath());
// output
C:\Documents and Settings\Administrator\workspace\testApp\.
C:\Documents and Settings\Administrator\workspace\testApp\..
2. getCanonicalPath (., .. 을 계산한 경로를 출력)
System.out.println(new File(".").getCanonicalPath());
System.out.println(new File("..").getCanonicalPath());
// output
C:\Documents and Settings\Administrator\workspace\testApp
C:\Documents and Settings\Administrator\workspace
'Dev > Java' 카테고리의 다른 글
UserException (0) | 2013.06.11 |
---|---|
excel open protected password in jacob (0) | 2013.06.08 |
Jacob (0) | 2013.06.08 |
@Autowired 사용시 셋팅 (0) | 2013.05.30 |
exception handling (0) | 2013.05.29 |
Comments