import java.io.File;

File f = new File("/tmp/text1.txt");
if(f.exists() && !f.isDirectory()) { 
    println("${f.path} - This is a File!")
}

============= Output ===============
/tmp/text1.txt - This is a File!

dreamtails 發表在 痞客邦 PIXNET 留言(0) 人氣()