第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

java中刪除一個(gè)文件夾下的所有文件

java中刪除一個(gè)文件夾下的所有文件

qq_Dreamy_舊城_0 2017-12-04 16:26:34
/** * ?刪除文件夾里面的所有文件 * ?@param ?path ?String ?文件夾路徑 ?如 ?c:/fqf */public static void ?delAllFile(String ?path) ?{ ? ?File ?file ?= ?new ?File(path); ? ?if ?(!file.exists()) ?{ ? ? ? ?return; ? ?} ? ?if ?(!file.isDirectory()) ?{ ? ? ? ?return; ? ?} ? ?String[] ?tempList ?= ?file.list(); ? ?File ?temp ?= ?null; ? ?for ?(int ?i ?= ?0; ?i ?< ?tempList.length; ?i++) ?{ ? ? ? ?if ?(path.endsWith(File.separator)) ?{ ? ? ? ? ? ?temp ?= ?new ?File(path ?+ ?tempList[i]); ? ? ? ?} ? ? ? ?else ?{ ? ? ? ? ? ?temp ?= ?new ?File(path ?+ ?File.separator ?+ ?tempList[i]); ? ? ? ?} ? ? ? ?if ?(temp.isFile()) ?{ ? ? ? ? ? ?temp.delete(); ? ? ? ?} ? ? ? ?if ?(temp.isDirectory()) ?{ ? ? ? ? ? ?//先刪除文件夾里面的文件 ? ? ? ? ? ?delAllFile(path+"/"+ ?tempList[i]); ? ? ? ? ? ?/*//再刪除空文件夾 ? ? ? ? ? ?delFolder(path+"/"+ ?tempList[i]);*/ ? ? ? ?} ? ?}}我這邊找了一個(gè),寫著說是能刪除多個(gè)文件,但我運(yùn)行了只能刪除一個(gè),會(huì)的麻煩教教我,謝謝啦
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1622 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)