Util.java revision 154
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] 154N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 0N/A * Use is subject to license terms. 0N/A * File for useful functions 92N/A * Return a string which represents a <code>CharSequence</code> in HTML. 92N/A * @param q a character sequence 92N/A * @return a string representing the character sequence in HTML 92N/A * Append a character sequence to an <code>Appendable</code> object. Escape 92N/A * special characters for HTML. 92N/A * @param q a character sequence 92N/A * @param out the object to append the character sequence to 92N/A * @exception IOException if an I/O error occurs 92N/A * Append a character sequence to a <code>StringBuilder</code> 92N/A * object. Escape special characters for HTML. This method is identical to 92N/A * <code>Htmlize(CharSequence,Appendable)</code>, except that it is 92N/A * guaranteed not to throw <code>IOException</code> because it uses a 92N/A * <code>StringBuilder</code>. 92N/A * @param q a character sequence 92N/A * @param out the object to append the character sequence to 92N/A * @see #Htmlize(CharSequence, Appendable) 92N/A // StringBuilder's append methods are not declared to throw 92N/A // IOException, so this should never happen. 92N/A * Append a character to a an <code>Appendable</code> object. If the 92N/A * character has special meaning in HTML, append a sequence of characters 92N/A * representing the special character. 92N/A * @param c the character to append 92N/A * @param out the object to append the character to 92N/A * @exception IOException if an I/O error occurs 154N/A }
else if (l <
1048576) {
0N/A * Append path and date into a string in such a way that lexicographic 0N/A * sorting gives the same results as a walk of the file hierarchy. Thus 0N/A * null (\u0000) is used both to separate directory components and to 0N/A * separate the path from the date. 0N/A private static char[]
hexdigits = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f'};
154N/A if ((c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z') || (c >=
'0' && c <=
'9')) {