Java2HTML改造手記(6) (轉)

amyz發表於2007-11-24
Java2HTML改造手記(6) (轉)[@more@]

2HTML改造手記(6)

:namespace prefix = o ns = "urn:schemas--com::office" />

Buildjava2html方法最後了O01055方法,看來這個方法是最終生成html頁面的方法了.

既然如此,那麼我們就把這個方法中出現的所有write方法中的引數加上”.getBytes(encoding)”,而這個encoding在構造方法中已經用指定的編碼賦值了.

修改過的是這樣的:

  public void O01055()

  throws Exception

  {

  Hashtable hashtable = O01093();

  Enumeration enumeration = hashtable.keys();

  obj = null;

  Object obj1 = null;

  while(enumeration.hasMoreElements())

  {

  String s = (String)enumeration.nextElement();

   O01090 o01090 = (O01090)hashtable.get(s);

  File file = new File(O01045);

  String s1 = file.getAbsolutePath();

  if(!s1.endsWith(File.separator))

  {

  s1 = s1 + File.separator;

  }

  String s2 = null;

  if(o01090.O01082.equals(""))

  {

  s2 = s1 + o01090.O01006 + ".java.html";

  } else

  {

  s2 = s1 + O07.O01015(o01090.O01082, File.separatorChar) + File.separatorChar + o01090.O01006 + ".java.html";

  }

  File file1 = new File(s1 + O07.O01015(o01090.O01082, '/'));

  file1.mkdirs();

  O01025 o01025 = new O01025(s2, O01040, O01041);

  FileReader filereader = new FileReader(s);

  o01025.O01032(false);

  String s3 = ".";

  if(o01090.O01082.length() == 0)

  {

  s3 = "";

  }

  O07.setEncoding(encoding);

  String s4 = O07.O01018(o01090.O01082);

 

  String s5 = O01117(s4);

 

  o01025.write(new String(O07.O01004(s5 + "stylesheet.css", o01090.O01082 + s3 + o01090.O01006).getBytes(encoding)));

 

  o01025.write(new String(O07.O01011(o01090.O01006, "", O01012).getBytes(encoding)));

  o01025.write(new String(o01025.O01037().getBytes(encoding)));

  o01025.O01032(true);

  boolean flag = false;

  try

  {

  O0106.O0108(filereader, o01025, s5, this, O01051);

  o01025.O01032(false);

  }

  catch(O0109 _ex)

  {

  flag = true;

  System.out.println("Parse Error, Non-Legal Java File. (2nd Parse - File has changed since first pars" +

"e)"

);

  }

  catch(IOException _ex)

  {

  flag = true;

  System.out.println("IO Error. (2nd Parse)");

  }

  finally

  {

  try

   {

  o01025.write(new String(O07.O01013(o01090.O01006, "", O01014).getBytes(encoding)));

  o01025.write(new String(O07.O01007().getBytes(encoding)));

  o01025.close();

  }

   catch(IOException _ex) { }

  try

  {

  filereader.close();

  }

  catch(IOException _ex) { }

  }

  if(!flag)

  {

  System.out.println("Created: " + s2);

  }

  }

  }

從這個方法中可以看出所有的資源都是從O07類中來得.

那麼我們就在這個這個類中結束全部工作吧.

欲知後事如何,且聽下回分解.


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752019/viewspace-983742/,如需轉載,請註明出處,否則將追究法律責任。

相關文章