From: Kasun Gajasinghe Date: Fri, 25 May 2012 17:01:43 +0000 (+0000) Subject: Appended the contents of htmlFileList.js to htmlFileInfoList.js X-Git-Tag: release/1.79.1~6^2~409 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5429c4778fd41171536eefa0c6f40fce052a13fd;p=docbook-dsssl Appended the contents of htmlFileList.js to htmlFileInfoList.js --- diff --git a/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java b/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java index d22e72138..2fdce5fae 100644 --- a/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java +++ b/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java @@ -162,6 +162,7 @@ public class IndexerMain { * The main class without Ant dependencies. * This can be used as a standalone jar. * + * @param args */ public static void main(String[] args) { @@ -222,7 +223,7 @@ public class IndexerMain { Iterator it; //File name initialization - String htmlList = "htmlFileList.js"; + String htmlList = "htmlFileInfoList.js"; String htmlInfoList = "htmlFileInfoList.js"; String indexName = ".js"; @@ -258,7 +259,7 @@ public class IndexerMain { // check if outputdir exists File tempfile = new File(outputDir); if (!tempfile.exists()) { - boolean b = (new File(outputDir)).mkdir(); + boolean b = tempfile.mkdirs(); if (!b) { System.out.println(txt_cannot_create_outputdir + " " + outputDir + "."); return; @@ -271,7 +272,6 @@ public class IndexerMain { } //end of init - // Get the list of all html files but the tocs, covers and indexes DirList nsiDoc = new DirList(inputDir, "^.*\\." + htmlExtension + "?$", 1); htmlFiles = nsiDoc.getListFiles(); @@ -374,9 +374,9 @@ public class IndexerMain { Date dateEnd = new Date(); long diff = dateEnd.getTime() - dateStart.getTime(); if (diff < 1000) - System.out.println("Delay = " + diff + " milliseconds"); + System.out.println("Indexed the contents in " + diff + " milliseconds"); else - System.out.println("Delay = " + diff / 1000 + " seconds"); + System.out.println("Indexed the contents in " + diff / 1000 + " seconds"); } else { System.out.println(txt_wrong_dita_basedir); } diff --git a/xsl-webhelpindexer/src/com/nexwave/nquindexer/WriteJSFiles.java b/xsl-webhelpindexer/src/com/nexwave/nquindexer/WriteJSFiles.java index f0fd3eaa2..c3b148db3 100755 --- a/xsl-webhelpindexer/src/com/nexwave/nquindexer/WriteJSFiles.java +++ b/xsl-webhelpindexer/src/com/nexwave/nquindexer/WriteJSFiles.java @@ -1,13 +1,19 @@ package com.nexwave.nquindexer; -import java.io.*; +import com.nexwave.nsidita.DocFileInfo; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; import java.util.TreeSet; -import com.nexwave.nsidita.DocFileInfo; - /** * Outputs the js files with: * - the list of html files and their description @@ -44,13 +50,14 @@ public class WriteJSFiles { it = list.iterator(); try { - // open a outputstream, here a file + // open an outputStream, here a file. File is replaced rather than appending OutputStream fOut = new FileOutputStream(fileO); OutputStream bout = new BufferedOutputStream(fOut); OutputStreamWriter out = new OutputStreamWriter(bout, "UTF-8"); /*fl : file list*/ - out.write("//List of files which are indexed.\n"); + out.write("var doStem = " + doStem + ";\n"); + out.write("//List of indexed files.\n"); out.write("fl = new Array();\n"); String temp; while (it.hasNext()) { @@ -60,7 +67,6 @@ public class WriteJSFiles { i++; } - out.write("var doStem = " + doStem + ""); out.flush(); // Don't forget to flush! out.close(); // System.out.println("the array of html is in " + fileO); @@ -94,8 +100,8 @@ public class WriteJSFiles { } it = list.iterator(); try { - // open a outputstream, here a file - OutputStream fOut = new FileOutputStream(fileO); + // open a outputstream, here a file. The file get appended + OutputStream fOut = new FileOutputStream(fileO, true); // open a buffer output stream OutputStream bout = new BufferedOutputStream(fOut); OutputStreamWriter out