锘??xml version="1.0" encoding="utf-8" standalone="yes"?>色狠狠一区二区三区香蕉,国产99久久精品一区二区永久免费,精品91自产拍在线观看一区http://www.aygfsteel.com/yegucheng/archive/2007/10/29/156639.htmlyeguchengyeguchengMon, 29 Oct 2007 04:28:00 GMThttp://www.aygfsteel.com/yegucheng/archive/2007/10/29/156639.htmlhttp://www.aygfsteel.com/yegucheng/comments/156639.htmlhttp://www.aygfsteel.com/yegucheng/archive/2007/10/29/156639.html#Feedback1http://www.aygfsteel.com/yegucheng/comments/commentRss/156639.htmlhttp://www.aygfsteel.com/yegucheng/services/trackbacks/156639.html闃呰鍏ㄦ枃

yegucheng 2007-10-29 12:28 鍙戣〃璇勮
]]>
浣跨敤Java API鎿嶄綔鏂囦歡鐨勫瓧絎﹂泦http://www.aygfsteel.com/yegucheng/archive/2007/10/26/156032.htmlyeguchengyeguchengFri, 26 Oct 2007 02:01:00 GMThttp://www.aygfsteel.com/yegucheng/archive/2007/10/26/156032.htmlhttp://www.aygfsteel.com/yegucheng/comments/156032.htmlhttp://www.aygfsteel.com/yegucheng/archive/2007/10/26/156032.html#Feedback5http://www.aygfsteel.com/yegucheng/comments/commentRss/156032.htmlhttp://www.aygfsteel.com/yegucheng/services/trackbacks/156032.html絎旇呯殑鍦烘櫙鏄繖鏍風(fēng)殑錛岀瑪鑰呬嬌鐢╟ode smith浣滀負(fù)浠g爜鐢熸垚宸ュ叿錛屽茍鍦‥clipse涓仛鎻掍歡寮鍙戯紝code smith澶╃敓
瀵笹B鐨勬敮鎸佹瘮杈冨急錛屽彧鑳界敓鎴怳TF-8緙栫爜錛岃繖鍦‥clipse寮鍙戠殑榪囩▼涓笉浼?xì)瀛樺湪闂锛屼絾鏄湪鋴社敤Eclipse鐨勫鍑?br /> 鍔熻兘鏃訛紝Eclipse搴曞眰浣跨敤ANT鐨勬墽琛屾柟寮忥紝ANT鐨勯粯璁ゅ瓧絎﹂泦榛樿浣跨敤褰撳墠緋葷粺鐨勫瓧絎﹂泦錛岃繖鏃跺湪緙栬瘧瀵煎嚭鐨勬椂鍊欙紝
浼?xì)鍑虹幇瀛椊W︽棤娉曡瘑鍒殑闂錛屽鑷村鍑烘垨鑰呮墦鍖呭け璐ャ?br />  涓縐嶆柟寮忓彲浠ユ敼鍙楨clipse宸ョ▼鐨勯粯璁ゅ瓧絎﹂泦錛屼互鍙?qiáng)鑷姩鐢熸垚鐨刟nt閰嶇疆鏂囦歡涓瓧絎﹂泦鐨勯厤緗紝榪欏浜庡崟涓伐紼嬫槸鏈?br /> 鏁堢殑錛屼絾澶勭悊宸ョ▼闂翠緷璧栨椂錛岃渚濊禆鐨勫伐紼嬪悓鏍蜂細(xì)鍑虹幇瀛楃闆嗛棶棰橈紝鍗充嬌琚緷璧栧伐紼嬭瀹歛nt鐨勫瓧絎﹂泦銆?br />  鍙︿竴縐嶆柟寮忥紝鏄墜宸ヨ漿鎹紝璁睻TF-8鐨勫瓧絎﹂泦杞崲涓篏BK鐨勶紝寰蔣鐨勭綉绔欐彁渚涗簡(jiǎn)涓涓壒閲忚漿鎹㈠伐鍏鳳紝浣嗘槸鍦ㄨ漿鎹箣鍚庯紝
鏂囨。鐨勬渶鍓嶉潰榪樹細(xì)鏈夊彲鑳藉瓨鍦ㄥ浜庡瓧絎︼紝騫跺鑷碼nt鎵撳寘澶辮觸
 鏈鍚庯紝娌″姙娉曡嚜宸卞啓浜?jiǎn)涓涓瓧絎﹂泦杞崲宸ュ叿錛屽洜涓烘槸鑷繁鐢紝鎵浠ュ鐢ㄥ氨琛岋紝涓嬮潰鏄漿鎹㈤儴鍒嗙殑浠g爜錛屽疄鐜癠TF8鍒?br /> GBK鐨勮漿鎹紝鍏朵粬杞崲鍙互瀵逛唬鐮佺◢浣滀慨鏀廣?/p>

 
import org.apache.commons.lang.ArrayUtils;

public class EncodeRepairTool {
 public static final byte[] bPre = "EFBBBF".getBytes();
 private int i = 0;

 /**
  * @param args
  */
 public static void main(String[] args) {  
  String path = "D:\\eclipse-dev-3.3\\workspace";
  File file = new File(path);
  EncodeRepairTool scanner = new EncodeRepairTool();
  scanner.scanFolder(file);

 }

 

 public void scanFolder(File file) {
  if (file.isDirectory()) {
   File[] files = file.listFiles();
   for (int i = 0; i < files.length; i++) {
    scanFolder(files[i]);
   }
  } else if (file.getName().endsWith(".java")) {
   removePreCode(file);
  }
 }

 private void removePreCode(File file) {
  try {
   FileInputStream fis = new FileInputStream(file);
   int size = fis.available();
   if (size < 24) {
    return;
   }
   i ++ ;
   byte[] bs = new byte[size];
   fis.read(bs);
   byte[] tbs = ArrayUtils.subarray(bs, 0, 3);
   byte[] tbs1 = new byte[] { new Integer(0xEF).byteValue(),
     new Integer(0xBB).byteValue(),
     new Integer(0xBF).byteValue() };
   boolean bol = false;
   if (tbs[0] == tbs1[0] && tbs[1] == tbs1[1] && tbs[2] == tbs1[2]) {
    bol = true;
   }
   fis.close();
   if (!bol) {
    System.out.println("  " + i + " : " + file.getName());
    tbs = bs;
   }
   else {
    System.out.println("**" + i + " : " + file.getName());
    tbs = ArrayUtils.subarray(bs, 3, size);
    
   }   
   InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(tbs), "UTF-8");
   BufferedReader br = new BufferedReader(reader);
   StringBuffer buffer = new StringBuffer();
   String s = br.readLine();
   while (s != null) {
    buffer.append(s);
    buffer.append("\n");
    s =  br.readLine();
   }
   reader.close();
   byte[] nbs = buffer.toString().getBytes("GBK");   
   FileOutputStream fos = new FileOutputStream(file);
   fos.write(nbs);
   fos.flush();
   fos.close();
   
  } catch (FileNotFoundException e) {
   // TODO 鑷姩鐢熸垚 catch 鍧?br />    e.printStackTrace();
  } catch (IOException e) {
   // TODO 鑷姩鐢熸垚 catch 鍧?br />    e.printStackTrace();
  }

 }

}



yegucheng 2007-10-26 10:01 鍙戣〃璇勮
]]>
浣跨敤apche鐨刵et鍖呮搷浣渟erv-U鍜寈-light鐨勭粏寰尯鍒?/title><link>http://www.aygfsteel.com/yegucheng/archive/2007/10/26/156008.html</link><dc:creator>yegucheng</dc:creator><author>yegucheng</author><pubDate>Fri, 26 Oct 2007 01:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/yegucheng/archive/2007/10/26/156008.html</guid><wfw:comment>http://www.aygfsteel.com/yegucheng/comments/156008.html</wfw:comment><comments>http://www.aygfsteel.com/yegucheng/archive/2007/10/26/156008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yegucheng/comments/commentRss/156008.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yegucheng/services/trackbacks/156008.html</trackback:ping><description><![CDATA[鍦ㄤ嬌鐢╝pache鐨刵et鍖呭鐞哠erv-U鍜寈-lighgt鏃墮亣鍒扮殑鍑犵偣涓嶅悓<br /> 榪涘叆涓涓┖鐩綍錛?br />  鍦╯erv-U涓嬶紝璋冪敤fTPClient.changeWorkingDirectory("")鏂規(guī)硶娌℃湁浠諱綍闂(鎸囧悜涓涓┖鐨勭洰褰?<br />  鍦▁-light涓嬶紝璋冪敤鏂規(guī)硶錛屼細(xì)榪斿洖501淇℃伅<br /> 褰撲笅杞藉畬鏂囦歡鍚庯細(xì)<br />  浣跨敤 fTPClient.retrieveFileStream(url)鏂規(guī)硶涓嬭澆鏂囦歡錛屽湪serv-U涓嬶紝鍙互鐩存帴涓嬭澆涓嬩竴涓枃浠?br />  浣嗘槸鍦▁-light涓嬶紝璋冪敤 fTPClient.retrieveFileStream(url)鏂規(guī)硶鍚庯紝<br />  蹇呴』鎵ц fTPClient.completePendingCommand()鏂規(guī)硶錛屽叧闂綋鍓嶄笅杞芥搷浣滐紝<br />  鎵嶈兘鎵ц涓嬩竴涓笅杞戒換鍔★紙鍦╪et鍖呯殑API涓湁鐩稿叧鐨勮瀹氾級(jí)銆?br />   <img src ="http://www.aygfsteel.com/yegucheng/aggbug/156008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yegucheng/" target="_blank">yegucheng</a> 2007-10-26 09:08 <a href="http://www.aygfsteel.com/yegucheng/archive/2007/10/26/156008.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">喀什市</a>| <a href="http://" target="_blank">顺义区</a>| <a href="http://" target="_blank">溧水县</a>| <a href="http://" target="_blank">崇信县</a>| <a href="http://" target="_blank">呼和浩特市</a>| <a href="http://" target="_blank">海口市</a>| <a href="http://" target="_blank">黄浦区</a>| <a href="http://" target="_blank">黔西</a>| <a href="http://" target="_blank">昭通市</a>| <a href="http://" target="_blank">建德市</a>| <a href="http://" target="_blank">日土县</a>| <a href="http://" target="_blank">滦南县</a>| <a href="http://" target="_blank">东平县</a>| <a href="http://" target="_blank">和平区</a>| <a href="http://" target="_blank">集安市</a>| <a href="http://" target="_blank">鹰潭市</a>| <a href="http://" target="_blank">南漳县</a>| <a href="http://" target="_blank">台东市</a>| <a href="http://" target="_blank">镇赉县</a>| <a href="http://" target="_blank">大城县</a>| <a href="http://" target="_blank">齐齐哈尔市</a>| <a href="http://" target="_blank">婺源县</a>| <a href="http://" target="_blank">安阳市</a>| <a href="http://" target="_blank">上饶县</a>| <a href="http://" target="_blank">吉林省</a>| <a href="http://" target="_blank">平乡县</a>| <a href="http://" target="_blank">安康市</a>| <a href="http://" target="_blank">安龙县</a>| <a href="http://" target="_blank">江陵县</a>| <a href="http://" target="_blank">梨树县</a>| <a href="http://" target="_blank">扶风县</a>| <a href="http://" target="_blank">无锡市</a>| <a href="http://" target="_blank">靖州</a>| <a href="http://" target="_blank">苍溪县</a>| <a href="http://" target="_blank">松溪县</a>| <a href="http://" target="_blank">隆昌县</a>| <a href="http://" target="_blank">河曲县</a>| <a href="http://" target="_blank">全州县</a>| <a href="http://" target="_blank">达日县</a>| <a href="http://" target="_blank">北安市</a>| <a href="http://" target="_blank">聂荣县</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>