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 | 31 |
Tags
- netsh
- 공통표준용어
- ssh
- tomcat
- profile
- Mac
- grep
- Windows 10
- VirtualBox
- port
- Source
- context
- xargs
- 네트워크
- 단축키
- JavaScript
- web.xml
- resource
- maVen
- import
- Quartz
- find
- Eclipse
- bash
- DB 도메인
- IntelliJ
- lsof
- GIT
- copy-dependencies
- Windows
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