클래스 패스 및 파일 확인하는 코드
boolean fileExists = false;
String[] classPathArray = null;
try {
classPathArray = System.getProperty(“java.class.path”).split(“;”);
File file = null;
String dirPath = null;
for(int i=0; i < classPathArray.length; i++)
{
file = new java.io.File(classPathArray[i]);
dirPath = file.getCanonicalFile().getParent();
if(dirPath.indexOf(“\\”) != -1)
dirPath = dirPath.replace(“\\”, “/”);
if(!dirPath.endsWith(“/”))
dirPath = dirPath + “/”;
file = new File(dirPath + fileName);
fileExists = file.exists();
if(fileExists) {
this.fullFilePath = dirPath + fileName;
break;
}
}
} catch(IOException e) {
// e.printStackTrace();
}