锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕一区二区在线播放,第三区美女视频在线,欧美国产日韩二区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#Feedback3http://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鐨勶紝寰蔣鐨勭綉绔欐彁渚涗簡涓涓壒閲忚漿鎹㈠伐鍏鳳紝浣嗘槸鍦ㄨ漿鎹箣鍚庯紝
鏂囨。鐨勬渶鍓嶉潰榪樹細(xì)鏈夊彲鑳藉瓨鍦ㄥ浜庡瓧絎︼紝騫跺鑷碼nt鎵撳寘澶辮觸
 鏈鍚庯紝娌″姙娉曡嚜宸卞啓浜嗕竴涓瓧絎﹂泦杞崲宸ュ叿錛屽洜涓烘槸鑷繁鐢紝鎵浠ュ鐢ㄥ氨琛岋紝涓嬮潰鏄漿鎹㈤儴鍒嗙殑浠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 鍙戣〃璇勮
]]>
鍦ㄤ嬌鐢═AB鍨嬬殑灞炴ч〉鏃訛紝璁懼畾Section鏍囬鐨勬柟娉?/title><link>http://www.aygfsteel.com/yegucheng/archive/2007/04/02/107992.html</link><dc:creator>yegucheng</dc:creator><author>yegucheng</author><pubDate>Mon, 02 Apr 2007 07:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/yegucheng/archive/2007/04/02/107992.html</guid><wfw:comment>http://www.aygfsteel.com/yegucheng/comments/107992.html</wfw:comment><comments>http://www.aygfsteel.com/yegucheng/archive/2007/04/02/107992.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yegucheng/comments/commentRss/107992.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yegucheng/services/trackbacks/107992.html</trackback:ping><description><![CDATA[     鎽樿: 鍦ㄤ嬌鐢═AB鍨嬬殑灞炴ч〉鏃訛紝璁懼畾Section鏍囬鐨勬柟娉?nbsp; <a href='http://www.aygfsteel.com/yegucheng/archive/2007/04/02/107992.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/yegucheng/aggbug/107992.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-04-02 15:36 <a href="http://www.aygfsteel.com/yegucheng/archive/2007/04/02/107992.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>EMF妯″瀷瑙f瀽鐨勭瓥鐣ュ垎鏋?/title><link>http://www.aygfsteel.com/yegucheng/archive/2007/03/07/102372.html</link><dc:creator>yegucheng</dc:creator><author>yegucheng</author><pubDate>Wed, 07 Mar 2007 05:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/yegucheng/archive/2007/03/07/102372.html</guid><wfw:comment>http://www.aygfsteel.com/yegucheng/comments/102372.html</wfw:comment><comments>http://www.aygfsteel.com/yegucheng/archive/2007/03/07/102372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yegucheng/comments/commentRss/102372.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yegucheng/services/trackbacks/102372.html</trackback:ping><description><![CDATA[ <p>浠婂ぉ鐪嬪埌涓ょ浣跨敤EMF瑙f瀽.xml涓篍MF妯″瀷鐨勭瓥鐣ワ細(xì)<br />涓縐嶆槸閫氳繃濡備笅浠g爜錛?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">IFileEditorInput聽modelFile聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(IFileEditorInput)getEditorInput();<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />URI聽resourceURI聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽URI.createPlatformResourceURI(modelFile.getFile().getFullPath().toString());;<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span id="Codehighlighter1_227_363_Open_Text"> <span style="COLOR: #000000">resource聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽editingDomain.getResourceSet().getResource(resourceURI,聽</span> <span style="COLOR: #0000ff">true</span> <span style="COLOR: #000000">);</span> </span> </div>涓婇潰榪欑鏂瑰紡浼?xì)寮曠敤涓涓狝dapterFactoryEditingDomain綾伙紝浣嗘垜浠熀浜庢ā鍨嬪仛緙栬緫鍣ㄦ椂錛屾湁鏃跺茍涓嶉渶瑕佺敤榪欎釜綾伙紝渚嬪GEF錛屽畠鍏鋒湁鑷韓鐨凟ditorDomain銆?br /><br />鍙﹀涓縐嶆柟寮忔槸浣跨敤EMF妯″瀷鑷姩鐢熸垚鐨凱rocess,璇ョ被涓鑸湪妯″瀷鐨刄til鍖呬笅闈紝寮曠敤浠g爜濡備笅錛?br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">IFileEditorInput聽modelFile聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(IFileEditorInput)getEditorInput();聽聽聽聽聽聽聽聽<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />XMLProcessor聽processor聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽DesignXMLProcessor();聽聽聽聽聽聽聽聽聽聽聽聽<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽resource聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽processor.load(</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽InputSource(</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽InputStreamReader(modelFile.getFile().getContents(),聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GBK</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)),聽</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">);<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽</span></div><br />鍏跺疄錛屽浜嶦MF鑰岃█錛屼笂闈袱縐嶈В閲婃柟寮忥紝褰掓牴鍒板簳閮介渶瑕丒MF鑾峰緱 涓氬姟妯″瀷鐩稿叧鐨勮В鏋愬櫒錛屽浜庣涓縐嶆柟寮忥紝EMF鏄浣曡幏鍙栧埌涓氬姟妯″瀷鐨勮В鏋愬櫒鍛紵涓昏鏄氳繃鎵╁睍鐨勬柟寮忥紝鎵╁睍瀹氫箟鍦ㄦā鍨嬬殑plugin.xml涓紝浠g爜鐗囨柇濡備笅鍥炬墍紺猴細(xì)<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">extension聽point</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.emf.ecore.extension_parser</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">parser聽<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">design</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">com.neusoft.report.design.util.DesignResourceFactoryImpl</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">/></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽</span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">extension</span><span style="COLOR: #000000">></span></div><br />榪欐牱錛岃В鏋?xml鏂囦歡鏃訛紝EMF浠嶳esourceFactory娉ㄥ唽涓紝鏍規(guī)嵁鐩稿簲鐨則ype錛岃幏鍙栬В鏋愬櫒錛圖esignResourceFactoryImpl錛夛紝瀹屾垚瑙f瀽銆?img src ="http://www.aygfsteel.com/yegucheng/aggbug/102372.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-03-07 13:08 <a href="http://www.aygfsteel.com/yegucheng/archive/2007/03/07/102372.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>