public class 파일경로EX1_p848 {
/**
* <pre>
* TODO
* </pre>
* @since 2015. 7. 8. 오전 9:30:51
* @author Holy
* @version
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
File f=new File("src/파일/파일EX1_p848.java");
String fnm=f.getName();
int ps=fnm.lastIndexOf(".");
System.out.println(f.getName());
System.out.println(fnm.substring(0, ps));
System.out.println(fnm.substring(ps+1));
System.out.println();
System.out.println(f.getPath());
System.out.println(f.getAbsolutePath());
System.out.println(f.getCanonicalPath());
System.out.println(f.getParent());
System.out.println();
System.out.println(File.pathSeparator);
System.out.println(File.pathSeparatorChar);
System.out.println(File.separator);
System.out.println(File.separatorChar);
System.out.println();
System.out.println(System.getProperty("user.dir"));
System.out.println(System.getProperty("sun.boot.class.path").replaceAll(";", ";\n"));
}
}
'프로그래밍 > 자바' 카테고리의 다른 글
키 입력받기, 내부 클래스 이용 (0) | 2015.07.25 |
---|---|
JFrame 프레임기본 (0) | 2015.07.25 |
리스트박스 List (0) | 2015.07.25 |
드래그앤드랍 개체.setDropTarget(new DropTarget() {} 이용 (0) | 2015.07.25 |
드래그앤드랍 implements DropTargetListener (0) | 2015.07.25 |