public String logsearchsave(){
String classpath = Thread.currentThread().getContextClassLoader().getResource("/").getPath()
String fileName = classpath + "log4j.properties"
Properties props = new Properties()
FileInputStream fis
try {
fis = new FileInputStream(fileName)
try {
props.load(fis)
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace()
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace()
}
String logpath = props.getProperty("log4j.appender.R.File")
//System.out.println(logpath)
//扫描文件下的文件
File log = new File(logpath)
System.out.println("1------------"+log.getParent())
File log2 = log.getParentFile()
if(log2.isDirectory()==true){
//文件夹扫描
System.out.println("文件夹")
String [] loglist = log2.list()
for(int i=0
System.out.println(log2+"/"+loglist[i])
}
}
System.out.println(log.isDirectory())
return "haha"
}