/**
     * 删除某个文件夹下的所有文件
     * @param fileName
     */
    public void deleteOldFile()
    {

     //clientFilePath是某个目录,如c:/test
        File file = new File(clientFilePath);
        if (!file.exists())
        {
            file.mkdir();
        }
        File files = new File(clientFilePath);
        if (files.isDirectory())
        {
            String[] fileList = files.list();
            for (int i = 0; i < fileList.length; i++)
            {
                File delFile = new File(clientFilePath + "/" + fileList[i]);
                delFile.delete();
            }
        }
    }

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2021-09-23
  • 2021-09-14
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案