Java2HTML改造手记(6)

类别:Java 点击:0 评论:0 推荐:
Java2HTML改造手记(6)

 

 

Buildjava2html方法最后调用了O01055方法,看来这个方法是最终生成html页面的方法了.

既然如此,那么我们就把这个方法中出现的所有write方法中的参数加上”.getBytes(encoding)”,而这个encoding在构造方法中已经用用户指定的编码赋值了.

修改过的是这样的:

    public void O01055()

        throws Exception

    {

        Hashtable hashtable = O01093();

        Enumeration enumeration = hashtable.keys();

        Object 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类中来得.

那么我们就在这个这个类中结束全部工作吧.

 

欲知后事如何,且听下回分解.

本文地址:http://com.8s8s.com/it/it17543.htm