Util.java revision 153
230N/A * The contents of this file are subject to the terms of the 230N/A * Common Development and Distribution License (the "License"). 230N/A * You may not use this file except in compliance with the License. 230N/A * language governing permissions and limitations under the License. 230N/A * When distributing Covered Code, include this CDDL HEADER in each 230N/A * If applicable, add the following below this CDDL HEADER, with the 230N/A * fields enclosed by brackets "[]" replaced with your own identifying 230N/A * information: Portions Copyright [yyyy] [name of copyright owner] 230N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 230N/A * Use is subject to license terms. 230N/A * File for useful functions 230N/A * Return a string which represents a <code>CharSequence</code> in HTML. 230N/A * @param q a character sequence 230N/A * @return a string representing the character sequence in HTML 230N/A * Append a character sequence to an <code>Appendable</code> object. Escape 230N/A * special characters for HTML. 230N/A * @param q a character sequence 230N/A * @param out the object to append the character sequence to 230N/A * @exception IOException if an I/O error occurs for (
int i =
0; i < q.
length(); i++) {
* Append a character sequence to a <code>StringBuilder</code> * object. Escape special characters for HTML. This method is identical to * <code>Htmlize(CharSequence,Appendable)</code>, except that it is * guaranteed not to throw <code>IOException</code> because it uses a * <code>StringBuilder</code>. * @param q a character sequence * @param out the object to append the character sequence to * @see #Htmlize(CharSequence, Appendable) // StringBuilder's append methods are not declared to throw // IOException, so this should never happen. "StringBuilder should not throw IOException",
ioe);
* Append a character to a an <code>Appendable</code> object. If the * character has special meaning in HTML, append a sequence of characters * representing the special character. * @param c the character to append * @param out the object to append the character to * @exception IOException if an I/O error occurs }
else if ( l <
1048576 ) {
* Append path and date into a string in such a way that lexicographic * sorting gives the same results as a walk of the file hierarchy. Thus * null (\u0000) is used both to separate directory components and to * separate the path from the date. private static char[]
hexdigits = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f'};
for(
int i=
0; i < q.
length() ; i++) {
if ((c >=
'a' && c <=
'z')
||(c >=
'0' && c <=
'9')) {
for(
int i=
0; i < q.
length() ; i++) {
// not RCS, try CVS instead