亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? html2txt.java

?? Java轉換為html
?? JAVA
字號:
/*
 * Copyright (c) 2001 Shiraz Kanga.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */ 
 
 
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

// Recurse through a directory of html files and convert them to text.
public class html2txt
{
  static boolean inText = true;
  static String fileSeparator = System.getProperty ("file.separator");
  static int numFiles = 0;

  // regular search and replace of all occurances of oldString with newString.
  static String strReplace (String currLine, String oldString, String newString)
  {
    int index = 0;
    while ((index = currLine.indexOf (oldString, index)) >= 0)
    {
      // Replace the old string with the new string (inefficient - but works!)
      currLine = currLine.substring (0, index) + newString + 
        currLine.substring (index + oldString.length ());
      index += newString.length ();
    }
    return currLine;
  }
  
  // This is the actual filter. Removes anything between a < and a >
  public static final String filterLine (String currLine) throws IOException
  {
    if (currLine == null)
      return null;

    StringBuffer currBuf = new StringBuffer ();
    char [] theChars = currLine.toCharArray ();

    for (int i = 0; i < currLine.length (); i++)
    {
      if (theChars [i] == '<')
        inText = false;
      if (theChars [i] == '>')
        inText = true;

      if (inText && theChars [i] != '>') 
        currBuf.append (theChars [i]);
    }

    // Should add more of these
    String str1 = strReplace (currBuf.toString (), "&nbsp;", " ");
    String str2 = strReplace (str1, "&lt;", "<");
    String str3 = strReplace (str2, "&gt;", ">");

    return str3;    
  }

  // Process this file
  public static void doFile (String fileName)
  {
    try
    {
      File inFile = new File (fileName);
      String inputText = readFile (inFile);
      String outputText = filterLine (inputText);
  
      numFiles ++;
      System.out.println ("Processed file \"" + fileName + "\"");
  
      File outFile = new File (fileName + ".txt");
      writeFile (outFile, outputText);
    }
    catch (IOException e)
    {
      System.out.println ("ERROR: I/O Exception while processing file \"" + 
        fileName + "\"");
      e.printStackTrace ();
    }
  }

  // Writes a String to a File
  public static void writeFile (String fileName, String text)
    throws IOException, FileNotFoundException
  {
    BufferedWriter theWriter = new BufferedWriter (new FileWriter (fileName));
    stringToWriter (theWriter, text);
  }

  // Writes a String to a File
  public static void writeFile (File fileHandle, String text)
    throws IOException, FileNotFoundException
  {
    BufferedWriter theWriter = new BufferedWriter (new FileWriter (fileHandle));
    stringToWriter (theWriter, text);
  }

  // Writes the entire contents of a String into a BufferedWriter
  public static void stringToWriter (BufferedWriter theWriter, String text)
    throws IOException
  {
    theWriter.write (text, 0, text.length ());
    theWriter.close ();
  }

  // Reads a File into a String.
  public static String readFile (String fileName)
    throws IOException, FileNotFoundException
  {
    BufferedReader theReader = new BufferedReader (new FileReader (fileName));
    return (readerToString (theReader));
  }

  // Reads a File into a String.
  public static String readFile (File fileHandle)
    throws IOException, FileNotFoundException
  {
    BufferedReader theReader = new BufferedReader (new FileReader (fileHandle));
    return (readerToString (theReader));
  }

  // Read the entire contents of the BufferedReader into a String.
  public static String readerToString (BufferedReader theReader)
    throws IOException
  {
    StringBuffer retVal = new StringBuffer (100000);
    String currLine = null;

    if (theReader != null)
    {
      while ((currLine = theReader.readLine ()) != null)
      {
        retVal.append (currLine);
        retVal.append ("\n");               // UNIX style - works
        //retVal.append ("\r\n");           // DOS style - works
        //retVal.append (fileSeparator);    // Java style - fails!!
      }
    }
    theReader.close ();

    return retVal.toString ();
  }

  // Main recursive routing to locate all files in a tree that have a specific ending
  private static void fileLister (String rootDir)
  {
    File f = new File (rootDir);
    String [] fileList = f.list ();
    if (fileList == null)
      return;
    for (int i = fileList.length - 1; i >= 0; i--)
    {
      f = new File (rootDir, fileList [i]);
      if (f.isDirectory ())
        fileLister (rootDir + fileSeparator + fileList [i]);
      else if (fileList [i].toUpperCase ().endsWith ("HTML") 
        || fileList [i].toUpperCase ().endsWith ("HTM"))
      {
        doFile (rootDir + fileSeparator + fileList [i]);
      }
    }
  }

  public static void getFiles (String rootDir)
  {
    fileLister (rootDir);
  }

  public static void main (String [] args)
  {
    String rootDir = "";

    if (args.length == 0)   // No directory argument supplied. Use current directory
      rootDir = ".";
    else
      rootDir = args [0];

    System.out.println ("Converting *.htm and *.html in directory \"" + 
      rootDir + "\" to text.");

    getFiles (rootDir);
    // All Done.
    System.out.println ("Done.");
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久| 国产精品 日产精品 欧美精品| www一区二区| 欧美成人一区二区| 精品国产一区二区三区av性色| 91精品国产综合久久婷婷香蕉| 91精品国产一区二区三区香蕉| 欧美日韩国产影片| 91精品国产一区二区三区| 欧美一级欧美三级| 精品久久久久久综合日本欧美| 精品日韩一区二区三区免费视频| 欧美丰满一区二区免费视频| 欧美绝品在线观看成人午夜影视| 欧美日韩成人综合天天影院| 日韩一区二区视频| 国产亚洲精品bt天堂精选| 国产精品久久久99| 亚洲综合一区二区三区| 丝袜美腿亚洲综合| 蜜桃视频免费观看一区| 韩国一区二区三区| 91尤物视频在线观看| 欧美日韩电影一区| 国产亚洲欧美日韩在线一区| 亚洲欧美另类综合偷拍| 丝袜美腿亚洲综合| 丁香婷婷综合五月| 欧美午夜电影在线播放| 久久久亚洲午夜电影| 亚洲女子a中天字幕| 日本vs亚洲vs韩国一区三区二区| 国产精品综合av一区二区国产馆| 9i在线看片成人免费| 欧美一级免费观看| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲一区中文日韩| 国产激情一区二区三区| 欧美日韩在线三级| 久久精品人人爽人人爽| 亚洲专区一二三| 国产福利一区在线| 欧美日韩国产三级| 国产精品三级在线观看| 五月激情六月综合| 成人免费看的视频| 精品国产91乱码一区二区三区| 中文字幕在线一区| 精品在线播放午夜| 欧美日韩一区三区| 亚洲欧美日韩系列| 成人精品在线视频观看| 精品国产一二三| 日韩**一区毛片| 欧美性欧美巨大黑白大战| 中文一区在线播放| 韩国三级电影一区二区| 777a∨成人精品桃花网| 一区二区三区中文在线| 成人av集中营| 国产三级精品视频| 国产美女av一区二区三区| 欧美精品久久天天躁| 一区二区理论电影在线观看| 成人91在线观看| 国产视频不卡一区| 国产福利一区二区三区视频在线| 日韩女优av电影| 琪琪一区二区三区| 日韩一区二区在线观看视频播放| 午夜在线成人av| 欧美日韩精品一二三区| 亚洲超碰97人人做人人爱| 色999日韩国产欧美一区二区| 国产精品乱人伦一区二区| 处破女av一区二区| 国产网站一区二区三区| 国产91丝袜在线播放0| 国产日韩视频一区二区三区| 国产米奇在线777精品观看| 久久久一区二区| 国产美女精品一区二区三区| 国产视频不卡一区| 不卡的电视剧免费网站有什么| 久久久久久久久伊人| 国产69精品一区二区亚洲孕妇| 欧美精品一区二区久久久| 精品亚洲欧美一区| 久久久国产精华| 99久久婷婷国产综合精品电影| 亚洲欧美在线观看| 日本高清不卡一区| 肉色丝袜一区二区| 337p日本欧洲亚洲大胆色噜噜| 国产裸体歌舞团一区二区| 18涩涩午夜精品.www| 欧美亚洲日本一区| 开心九九激情九九欧美日韩精美视频电影| 精品日韩一区二区三区| 不卡av在线免费观看| 亚洲综合一二三区| 欧美草草影院在线视频| 成人免费高清在线| 夜夜爽夜夜爽精品视频| 欧美一区二区三区在线| 成人一区二区三区视频 | 亚洲一区二区视频在线观看| 欧美日韩一级二级三级| 国产麻豆精品一区二区| 一区二区三区四区不卡视频| 日韩亚洲欧美在线| www.视频一区| 免费一级欧美片在线观看| 国产精品三级av在线播放| 91精品国产综合久久久久久久久久 | 国产另类ts人妖一区二区| 亚洲美女少妇撒尿| 欧美成人激情免费网| 在线影院国内精品| 国产传媒欧美日韩成人| 视频一区二区不卡| 亚洲天堂2014| 久久久91精品国产一区二区精品 | 日本在线不卡视频一二三区| 久久久无码精品亚洲日韩按摩| 欧洲视频一区二区| 高清不卡一二三区| 免费成人性网站| 亚洲一区二区不卡免费| 国产精品少妇自拍| 精品国产乱码久久久久久久久| 在线观看日韩电影| 成人免费毛片app| 美洲天堂一区二卡三卡四卡视频| 亚洲免费高清视频在线| 国产天堂亚洲国产碰碰| 欧美一级国产精品| 91麻豆精品国产91久久久久久久久 | 精品国产一区二区三区av性色| 欧美日韩一区三区| 在线视频综合导航| 99精品黄色片免费大全| 风间由美中文字幕在线看视频国产欧美| 日韩精品1区2区3区| 日韩国产精品久久久| 亚洲大片免费看| 亚洲成人动漫在线观看| 亚洲国产成人精品视频| 亚洲一区在线播放| 亚洲国产成人高清精品| 丝袜a∨在线一区二区三区不卡| 亚洲五码中文字幕| 亚洲地区一二三色| 日韩精品视频网| 麻豆精品在线视频| 国内久久精品视频| 国产成人精品网址| 成人爽a毛片一区二区免费| 成人午夜免费视频| 94色蜜桃网一区二区三区| 91香蕉国产在线观看软件| 成人免费视频caoporn| 91亚洲国产成人精品一区二区三| 99re热这里只有精品免费视频| 色综合天天综合网天天狠天天| 91国产免费观看| 欧美一级日韩免费不卡| 精品欧美黑人一区二区三区| 久久综合999| 国产精品成人免费| 亚洲综合色婷婷| 九色|91porny| 9人人澡人人爽人人精品| 欧洲色大大久久| 欧美成人一区二区三区| 亚洲国产精品传媒在线观看| 亚洲欧美在线视频观看| 日韩成人一区二区三区在线观看| 国内偷窥港台综合视频在线播放| 成人妖精视频yjsp地址| 在线欧美一区二区| 欧美v国产在线一区二区三区| 日本一二三四高清不卡| 天天影视色香欲综合网老头| 国产精品一区久久久久| 在线观看中文字幕不卡| 91麻豆精品91久久久久同性| 久久久久综合网| 亚洲成人av在线电影| 国产成人啪免费观看软件| 日本韩国欧美国产| 久久香蕉国产线看观看99| 一区二区三区日韩在线观看| 久久er99热精品一区二区| 91日韩一区二区三区| 亚洲精品一区二区三区精华液| 专区另类欧美日韩| 激情五月激情综合网| 在线观看成人免费视频| 日本一区二区视频在线观看|