Java Doc for Utilities.java in  » Blogger-System » apache-roller-3.1 » org » apache » roller » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Blogger System » apache roller 3.1 » org.apache.roller.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.roller.util.Utilities

Utilities
public class Utilities (Code)
General purpose utilities, not for use in templates.


Field Summary
final public static  StringTAG_SPLIT_CHARS
    


Method Summary
public static  Stringautoformat(String s)
     Autoformat.
public static  voidcopyFile(File from, File to)
    
public static  voidcopyInputToOutput(InputStream input, OutputStream output, long byteCount)
     Utility method to copy an input stream to an output stream. Wraps both streams in buffers.
public static  voidcopyInputToOutput(InputStream input, OutputStream output)
    
final public static  Stringdecode(String s)
     URL decoding.
public static  StringdecodeString(String str)
     Decode a string using Base64 encoding.
final public static  Stringencode(String s)
     URL encoding.
public static  StringencodeEmail(String str)
    
public static  StringencodePassword(String password, String algorithm)
     Encode a string using algorithm specified in web.xml and return the resulting encrypted password.
public static  StringencodeString(String str)
     Encode a string using Base64 encoding.
public static  StringescapeHTML(String s)
     Escape, but do not replace HTML.
public static  StringescapeHTML(String s, boolean escapeAmpersand)
     Escape, but do not replace HTML.
public static  StringextractHTML(String str)
     Extract (keep) JUST the HTML from the String.
public static  StringhexEncode(String str)
    
public static  StringintArrayToString(int[] intArray)
     Convert integer array to a string.
public static  StringnormalizeTag(String tag, Locale locale)
    
public static  StringremoveAndEscapeHTML(String s)
     Run both removeHTML and escapeHTML on a string.
Parameters:
  s - String to be run through removeHTML and escapeHTML.
public static  StringremoveHTML(String str)
     Remove occurences of html, defined as any text between the characters "<" and ">".
public static  StringremoveHTML(String str, boolean addSpace)
     Remove occurences of html, defined as any text between the characters "<" and ">".
public static  StringremoveNonAlphanumeric(String str)
     Remove occurences of non-alphanumeric characters.
public static  StringreplaceNonAlphanumeric(String str)
     Replaces occurences of non-alphanumeric characters with an underscore.
public static  StringreplaceNonAlphanumeric(String str, char subst)
     Replaces occurences of non-alphanumeric characters with a supplied char.
public static  ListsplitStringAsTags(String tags)
    
public static  StringstringArrayToString(String[] stringArray, String delim)
    
public static  intstringToInt(String string)
    
public static  int[]stringToIntArray(String instr, String delim)
     Convert string to integer array.
public static  String[]stringToStringArray(String instr, String delim)
     Convert string to string array.
public static  StringstripInvalidTagCharacters(String tag)
    
public static  StringstripJsessionId(String url)
    
public static  StringtoBase64(byte[] aValue)
    
public static  Stringtruncate(String str, int lower, int upper, String appendToEnd)
     Strips HTML and truncates.
public static  StringtruncateNicely(String str, int lower, int upper, String appendToEnd)
     This method based on code from the String taglib at Apache Jakarta: http://cvs.apache.org/viewcvs/jakarta-taglibs/string/src/org/apache/taglibs/string/util/StringW.java?rev=1.16&content-type=text/vnd.viewcvs-markup Copyright (c) 1999 The Apache Software Foundation.
public static  StringtruncateText(String str, int lower, int upper, String appendToEnd)
    
public static  StringunescapeHTML(String str)
    

Field Detail
TAG_SPLIT_CHARS
final public static String TAG_SPLIT_CHARS(Code)





Method Detail
autoformat
public static String autoformat(String s)(Code)
Autoformat.



copyFile
public static void copyFile(File from, File to) throws IOException(Code)



copyInputToOutput
public static void copyInputToOutput(InputStream input, OutputStream output, long byteCount) throws IOException(Code)
Utility method to copy an input stream to an output stream. Wraps both streams in buffers. Ensures right numbers of bytes copied.



copyInputToOutput
public static void copyInputToOutput(InputStream input, OutputStream output) throws IOException(Code)



decode
final public static String decode(String s)(Code)
URL decoding.
Parameters:
  s - a URL-encoded string to be URL-decoded URL decoded value of s using character encoding UTF-8; null if s is null.



decodeString
public static String decodeString(String str) throws IOException(Code)
Decode a string using Base64 encoding.
Parameters:
  str - String
throws:
  IOException -



encode
final public static String encode(String s)(Code)
URL encoding.
Parameters:
  s - a string to be URL-encoded URL encoding of s using character encoding UTF-8; null if s is null.



encodeEmail
public static String encodeEmail(String str)(Code)



encodePassword
public static String encodePassword(String password, String algorithm)(Code)
Encode a string using algorithm specified in web.xml and return the resulting encrypted password. If exception, the plain credentials string is returned
Parameters:
  password - Password or other credentials to use in authenticatingthis username
Parameters:
  algorithm - Algorithm used to do the digest encypted password based on the algorithm.



encodeString
public static String encodeString(String str) throws IOException(Code)
Encode a string using Base64 encoding. Used when storing passwords as cookies. This is weak encoding in that anyone can use the decodeString routine to reverse the encoding.
Parameters:
  str - String
throws:
  IOException -



escapeHTML
public static String escapeHTML(String s)(Code)
Escape, but do not replace HTML. The default behaviour is to escape ampersands.



escapeHTML
public static String escapeHTML(String s, boolean escapeAmpersand)(Code)
Escape, but do not replace HTML.
Parameters:
  escapeAmpersand - Optionally escapeampersands (&).



extractHTML
public static String extractHTML(String str)(Code)
Extract (keep) JUST the HTML from the String.
Parameters:
  str -



hexEncode
public static String hexEncode(String str)(Code)



intArrayToString
public static String intArrayToString(int[] intArray)(Code)
Convert integer array to a string.



normalizeTag
public static String normalizeTag(String tag, Locale locale)(Code)



removeAndEscapeHTML
public static String removeAndEscapeHTML(String s)(Code)
Run both removeHTML and escapeHTML on a string.
Parameters:
  s - String to be run through removeHTML and escapeHTML. String with HTML removed and HTML special characters escaped.



removeHTML
public static String removeHTML(String str)(Code)
Remove occurences of html, defined as any text between the characters "<" and ">". Replace any HTML tags with a space.



removeHTML
public static String removeHTML(String str, boolean addSpace)(Code)
Remove occurences of html, defined as any text between the characters "<" and ">". Optionally replace HTML tags with a space.
Parameters:
  str -
Parameters:
  addSpace -



removeNonAlphanumeric
public static String removeNonAlphanumeric(String str)(Code)
Remove occurences of non-alphanumeric characters.



replaceNonAlphanumeric
public static String replaceNonAlphanumeric(String str)(Code)
Replaces occurences of non-alphanumeric characters with an underscore.



replaceNonAlphanumeric
public static String replaceNonAlphanumeric(String str, char subst)(Code)
Replaces occurences of non-alphanumeric characters with a supplied char.



splitStringAsTags
public static List splitStringAsTags(String tags)(Code)

Parameters:
  tags -



stringArrayToString
public static String stringArrayToString(String[] stringArray, String delim)(Code)

Parameters:
  stringArray -
Parameters:
  delim -



stringToInt
public static int stringToInt(String string)(Code)

Parameters:
  string -



stringToIntArray
public static int[] stringToIntArray(String instr, String delim) throws NoSuchElementException, NumberFormatException(Code)
Convert string to integer array.



stringToStringArray
public static String[] stringToStringArray(String instr, String delim) throws NoSuchElementException, NumberFormatException(Code)
Convert string to string array.



stripInvalidTagCharacters
public static String stripInvalidTagCharacters(String tag)(Code)

Parameters:
  tag -



stripJsessionId
public static String stripJsessionId(String url)(Code)
Strip jsessionid off of a URL



toBase64
public static String toBase64(byte[] aValue)(Code)
Convert a byte array into a Base64 string (as used in mime formats)



truncate
public static String truncate(String str, int lower, int upper, String appendToEnd)(Code)
Strips HTML and truncates.



truncateNicely
public static String truncateNicely(String str, int lower, int upper, String appendToEnd)(Code)
This method based on code from the String taglib at Apache Jakarta: http://cvs.apache.org/viewcvs/jakarta-taglibs/string/src/org/apache/taglibs/string/util/StringW.java?rev=1.16&content-type=text/vnd.viewcvs-markup Copyright (c) 1999 The Apache Software Foundation. Author: timster@mac.com
Parameters:
  str -
Parameters:
  lower -
Parameters:
  upper -
Parameters:
  appendToEnd -



truncateText
public static String truncateText(String str, int lower, int upper, String appendToEnd)(Code)



unescapeHTML
public static String unescapeHTML(String str)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.