Util.java revision 345
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1054N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 1190N/A * Use is subject to license terms. 261N/A * File for useful functions 1062N/A * Return a string which represents a <code>CharSequence</code> in HTML. 467N/A * @param q a character sequence 428N/A * @return a string representing the character sequence in HTML 77N/A * Append a character sequence to an <code>Appendable</code> object. Escape 0N/A * special characters for HTML. 0N/A * @param q a character sequence 0N/A * @param out the object to append the character sequence to 0N/A * @exception IOException if an I/O error occurs 886N/A * Append a character sequence to a <code>StringBuilder</code> 886N/A * object. Escape special characters for HTML. This method is identical to 886N/A * <code>htmlize(CharSequence,Appendable)</code>, except that it is 886N/A * guaranteed not to throw <code>IOException</code> because it uses a 886N/A * <code>StringBuilder</code>. 491N/A * @param q a character sequence 491N/A * @param out the object to append the character sequence to 491N/A * @see #htmlize(CharSequence, Appendable) 464N/A // StringBuilder's append methods are not declared to throw 0N/A // IOException, so this should never happen. 240N/A * Append a character to a an <code>Appendable</code> object. If the 1016N/A * character has special meaning in HTML, append a sequence of characters 58N/A * representing the special character. 58N/A * @param c the character to append 58N/A * @param out the object to append the character to 77N/A * @exception IOException if an I/O error occurs 491N/A }
else if (l <
1048576) {
1088N/A * Append path and date into a string in such a way that lexicographic 491N/A * sorting gives the same results as a walk of the file hierarchy. Thus 1088N/A * null (\u0000) is used both to separate directory components and to 491N/A * separate the path from the date. 1088N/A // We should probably use an encoding which supports a larger 1062N/A // character set, but use ISO-8859-1 for now, since that's what 491N/A // we use other places in the code. 1115N/A // Should not happen. ISO-8859-1 must be supported by all JVMs. 491N/A * Build a string that may be converted to a Query and passed to Lucene. 491N/A * All parameters may be passed as null or an empty string to indicate that 1088N/A * @param freetext The string from the "Full Search" text-field. This field 491N/A * will be applied as it is specified. 1088N/A * @param defs The string from the "Definition" text-field. This field 491N/A * will be searched for in the <b>defs</b> field in the lucene 491N/A * index. All occurences of ":" will be replaced with "\:" 491N/A * @param refs The string from the "Symbol" text-field. This field 491N/A * will be searched for in the <b>refs</b> field in the lucene 491N/A * index. All occurences of ":" will be replaced with "\:" 491N/A * @param path The string from the "File Path" text-field. This field 491N/A * will be searched for in the <b>path</b> field in the lucene 491N/A * index. All occurences of ":" will be replaced with "\:" 491N/A * @param hist The string from the "History" text-field. This field 1088N/A * will be searched for in the <b>hist</b> field in the lucene 491N/A * index. All occurences of ":" will be replaced with "\:" 491N/A * @return A string to be parsed by the Lucene parser.