看板 java 關於我們 聯絡資訊
※ 引述《frex (Frex)》之銘言: : 有沒有API是可以 : 把整個目錄下(包含子目錄) : 中的 *.xxx(指定) 的檔 : 分別一個一個檔讀進來 : 用途是我想把所有的程式碼中*.JSP : 某段文字置換掉 一個一個改很麻煩 : 或者有更好的方法? http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html 有isDirectory() (判斷是否為資料夾) 還有 String[] list() Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname. 可以判斷底下的檔案(或資料夾) 配起來應該就夠用了 :P 或者是底下的這個 class *修改* 我手殘了 貼到 FileFilter XD 我腦袋想的是FilenameFilter的呀 http://java.sun.com/j2se/1.5.0/docs/api/java/io/FilenameFilter.html btw , 把java APP寫成能處理一個檔案, 然後用批次檔去處理或許也是一個好主意。 (如果程式本身是servlet或jsp就不能這樣玩了XD) -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the complier will stack.push(scouting.buck()); | answer your life stack.push(bowling.practice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68 ※ 編輯: TonyQ 來自: 220.134.27.68 (03/16 11:28)