/**
     * 解析文件中的二进制文件
     */
    public static String[] getFileName(File file){
         File[] fileList = file.listFiles();
         String[] fileNameArray = null;
         String fileName = "";
         for (int i = 0; i < fileList.length; i++) {
             if (fileList[i].isFile()) {
                 if(fileList[i].getName().contains(".tar.gz")){
                     //这个文件不需要解析
                 }else{
                     if(i != fileList.length){
                         fileName += fileList[i].getName()+"/";
                     }else{
                         fileName += fileList[i].getName();
                     }
                 }
             }
             //获取文件中的目录信息
             /*if (fileList[i].isDirectory()) {
                 String fileName = fileList[i].getName();
                 System.out.println("目录:" + fileName);        
               }*/
         }
         fileNameArray = fileName.split("/");
         return fileNameArray;
    }

 

相关文章:

  • 2022-02-03
  • 2021-11-28
  • 2021-09-08
猜你喜欢
  • 2021-06-18
  • 2021-09-07
  • 2022-12-23
  • 2021-12-12
  • 2022-01-15
  • 2022-02-28
相关资源
相似解决方案