폴더 리스트 가져오기 String path="C:\"; File dirFile=new File(path); File []fileList=dirFile.listFiles(); for(File tempFile : fileList) { if(tempFile.isFile()) { String tempPath=tempFile.getParent(); String tempFileName=tempFile.getName(); System.out.println("Path="+tempPath); System.out.println("FileName="+tempFileName); /*** Do something withd tempPath and temp FileName ^^; ***/ } } 정렬해서 가져오기 import java.io.FileFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import org.apache.commons.io.comparator.LastModifiedFileComparator; import org.apache.commons.io.filefilter.FileFileFilter; public class LastModifiedFileComparatorTest { public static void main(String[] args) throws IOException { File directory = new File("."); // get just files, not directories File[] files = directory.listFiles((FileFilter) FileFileFilter.FILE); System.out.println("Defaul...
댓글
댓글 쓰기