| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | | public class FileUtil { |
| | | |
| | | |
| | | public static List<String> getStaticFilePath(File file, List<String> list){ |
| | | |
| | |
| | | proc.waitFor(); |
| | | } |
| | | |
| | | //读取文件夹下的所有文件(不读取文件夹内的文件) |
| | | public static List getFileNameWithOutDirectory(String filePath) { |
| | | File folder = new File(filePath); // 文件夹路径 |
| | | List nameList=new ArrayList(); |
| | | File[] listOfFiles = folder.listFiles(); |
| | | if (listOfFiles != null) { |
| | | for (File file : listOfFiles) { |
| | | if (file.isFile()) { |
| | | nameList.add(file.getName()); |
| | | } |
| | | } |
| | | } |
| | | return nameList; |
| | | } |
| | | |
| | | //private static void decompressRar(File file, String outputFolder) throws IOException, RarException { |
| | | // Archive archive = new Archive(file); |
| | | // FileHeader fileHeader = archive.nextFileHeader(); |