|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensolaris.opengrok.web.Util
public final class Util
File for useful functions
Method Summary | |
---|---|
static java.lang.String |
breadcrumbPath(java.lang.String urlPrefix,
java.lang.String l)
Same as breadcrumbPath(urlPrefix, l, '/') . |
static java.lang.String |
breadcrumbPath(java.lang.String urlPrefix,
java.lang.String l,
char sep)
Same as breadcrumbPath(urlPrefix, l, sep, "", false) . |
static java.lang.String |
breadcrumbPath(java.lang.String urlPrefix,
java.lang.String l,
char sep,
java.lang.String urlPostfix,
boolean compact)
Create a breadcrumb path to allow navigation to each element of a path. |
static java.lang.String |
buildQueryString(java.lang.String freetext,
java.lang.String defs,
java.lang.String refs,
java.lang.String path,
java.lang.String hist)
Build a string that may be converted to a Query and passed to Lucene. |
static java.lang.String |
formQuoteEscape(java.lang.String q)
|
static void |
htmlize(char[] cs,
int length,
java.lang.Appendable out)
|
static java.lang.String |
htmlize(java.lang.CharSequence q)
|
static void |
htmlize(java.lang.CharSequence q,
java.lang.Appendable out)
Append a character sequence to an Appendable object. |
static void |
htmlize(java.lang.CharSequence q,
java.lang.StringBuilder out)
Append a character sequence to a StringBuilder
object. |
static void |
readableLine(int num,
java.io.Writer out,
Annotation annotation)
|
static java.lang.String |
redableSize(long num)
|
static java.lang.String |
uid(java.lang.String path,
java.lang.String date)
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. |
static java.lang.String |
uid2url(java.lang.String uid)
|
static java.lang.String |
URIEncode(java.lang.String q)
|
static java.lang.String |
URIEncodePath(java.lang.String path)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String htmlize(java.lang.CharSequence q)
public static void htmlize(java.lang.CharSequence q, java.lang.Appendable out) throws java.io.IOException
Appendable
object. Escape
special characters for HTML.
q
- a character sequenceout
- the object to append the character sequence to
java.io.IOException
- if an I/O error occurspublic static void htmlize(java.lang.CharSequence q, java.lang.StringBuilder out)
StringBuilder
object. Escape special characters for HTML. This method is identical to
htmlize(CharSequence,Appendable)
, except that it is
guaranteed not to throw IOException
because it uses a
StringBuilder
.
q
- a character sequenceout
- the object to append the character sequence tohtmlize(CharSequence, Appendable)
public static void htmlize(char[] cs, int length, java.lang.Appendable out) throws java.io.IOException
java.io.IOException
public static java.lang.String breadcrumbPath(java.lang.String urlPrefix, java.lang.String l)
breadcrumbPath(urlPrefix, l, '/')
.
breadcrumbPath(String, String, char)
public static java.lang.String breadcrumbPath(java.lang.String urlPrefix, java.lang.String l, char sep)
breadcrumbPath(urlPrefix, l, sep, "", false)
.
breadcrumbPath(String, String, char, String, boolean)
public static java.lang.String breadcrumbPath(java.lang.String urlPrefix, java.lang.String l, char sep, java.lang.String urlPostfix, boolean compact)
urlPrefix
- what comes before the path in the URLl
- the full path from which the breadcrumb path is builtsep
- the character that separates the path elements in l
urlPostfix
- what comes after the path in the URLcompact
- if true
, remove ..
and empty path
elements from the path in the links
public static java.lang.String redableSize(long num)
public static void readableLine(int num, java.io.Writer out, Annotation annotation) throws java.io.IOException
java.io.IOException
public static java.lang.String uid(java.lang.String path, java.lang.String date)
public static java.lang.String uid2url(java.lang.String uid)
public static java.lang.String URIEncode(java.lang.String q)
public static java.lang.String URIEncodePath(java.lang.String path)
public static java.lang.String formQuoteEscape(java.lang.String q)
public static java.lang.String buildQueryString(java.lang.String freetext, java.lang.String defs, java.lang.String refs, java.lang.String path, java.lang.String hist)
freetext
- The string from the "Full Search" text-field. This field
will be applied as it is specified.defs
- The string from the "Definition" text-field. This field
will be searched for in the defs field in the lucene
index. All occurences of ":" will be replaced with "\:"refs
- The string from the "Symbol" text-field. This field
will be searched for in the refs field in the lucene
index. All occurences of ":" will be replaced with "\:"path
- The string from the "File Path" text-field. This field
will be searched for in the path field in the lucene
index. All occurences of ":" will be replaced with "\:"hist
- The string from the "History" text-field. This field
will be searched for in the hist field in the lucene
index. All occurences of ":" will be replaced with "\:"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |