Java Doc for FxSharedUtils.java in  » J2EE » fleXive » com » flexive » shared » 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 » J2EE » fleXive » com.flexive.shared 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.shared.FxSharedUtils

FxSharedUtils
final public class FxSharedUtils (Code)
Flexive shared utility functions.
author:
   Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Inner Class :public static interface ParameterMapper extends Serializable
Inner Class :final public static class ProcessResult
Inner Class :final static class AsyncStreamBuffer extends Thread
Inner Class :public static class AssignmentPositionSorter implements Comparator<FxAssignment>,Serializable
Inner Class :public static class SelectableObjectSorter implements Comparator<SelectableObject>,Serializable

Field Summary
final public static  StringCOOKIE_FORCE_TEST_DIVISION
     Browser tests set this cookie to force using the test division instead of the actual division defined by the URL domain.
final public static  StringSHARED_BUNDLE
    
final public static  booleanUSE_JDK6_EXTENSION
    
final public static  booleanWINDOWS
    
final public static  StringXPATH_ENCODEDSLASH
     The character(s) representing a "xpath slash" (/) in a public URL.
public static  MessageDigestdigest
    


Method Summary
public static  voidcheckParameterEmpty(Object value, String parameterName)
     Check if the given value is empty (empty string or null for String objects, empty collection, null for other objects) and throw an exception if empty.
public static  voidcheckParameterNull(Object value, String parameterName)
     Check if the given value is empty (empty string or null for String objects, empty collection, null for other objects) and throw an exception if empty.
public static  StringdecodeXPath(String escapedXPath)
     Decodes a previously escaped XPath.
public static  StringescapePath(String path)
    
public static  StringescapeXPath(String xpath)
     Escapes the given XPath for use in a public URI.
public static  ProcessResultexecuteCommand(String command, String... arguments)
    
public static  StringformatResultValue(Object value, ContentLinkFormatter linkFormatter, String linkFormat, String itemLinkFormat)
     Formats the value as returned from a flexive search query.
public static  Vget(Map<K, V> map, K key, V defaultValue)
     Returns map.get(key) if key exists, defaultValue otherwise.
public static  StringgetBuildDate()
    
public static  StringgetBuildNumber()
    
public static  StringgetBuildUser()
    
public static  StringgetBundledGroovyVersion()
    
public static  byte[]getBytes(String s)
     Returns the UTF-8 byte representation of the given string.
public static  CollatorgetCollator()
     Returns a collator for the calling user's locale.
public static  intgetColumnIndex(String[] columnNames, String name)
     Return the index of the given column name.
public static  intgetColumnIndex(List<String> columnNames, String name)
     Return the index of the given column name.
public static synchronized  List<String>getDrops()
    
public static  StringgetEmptyResultMessage()
    
public static  FxStringgetEnumLabel(Enum value, Object... args)
     Returns the localized label for the given enum value.
public static  StringgetFlexiveEdition()
    
public static  StringgetFlexiveEditionFull()
    
public static  StringgetFlexiveVersion()
    
public static  StringgetHeader()
    
public static  StringgetLocalizedMessage(String resourceBundle, long localeId, String localeIso, String key, Object... args)
    
public static  Map<K, V>getMappedFunction(ParameterMapper<K, V> mapper)
     Projects a single-parameter function on a hashmap.
public static  FxStringgetMessage(String resourceBundle, String key, Object... args)
     Returns a multilingual FxString with all translations for the given property key.
public static  List<StepDefinition>getUsedStepDefinitions(List<? extends Step> steps, List<? extends StepDefinition> stepDefinitions)
    
public static synchronized  StringhashPassword(long accountId, String password)
     Compute the hash of the given flexive password.
public static  booleanisGroovyScript(String name)
    
public static  booleanisQuoted(String value, char quoteChar)
     Returns true if the given string value is quoted with the given character (e.g.
public static  StringloadFile(File file)
     Load the contents of a file, returning it as a String.
public static  StringloadFromInputStream(InputStream in, int length)
    
public static  StringlookupResource(String resourceBundle, String key, String localeIso)
    
public static  Stringsha1Hash(byte[] bytes)
     Creates a SHA-1 hash for the given data and returns it in hexadecimal string encoding.
public static  String[]splitLiterals(String text, char[] stringDelims, char separator)
     Splits the given text using separator.
public static  String[]splitLiterals(String text)
     Splits the given comma-separated text.
public static  booleanstoreFile(String contents, File file)
    
public static  StringstripQuotes(String value, char quoteChar)
     Strips the quotes from the given string if it is quoted, otherwise it returns the input value itself.
public static  voidwriteResultValue(Writer out, Object value, ContentLinkFormatter linkFormatter, String linkFormat, String itemLinkFormat)
     Renders the value as returned from a flexive search query to the given output writer.

Field Detail
COOKIE_FORCE_TEST_DIVISION
final public static String COOKIE_FORCE_TEST_DIVISION(Code)
Browser tests set this cookie to force using the test division instead of the actual division defined by the URL domain. TODO: security?



SHARED_BUNDLE
final public static String SHARED_BUNDLE(Code)
Shared message resources bundle



USE_JDK6_EXTENSION
final public static boolean USE_JDK6_EXTENSION(Code)
Are JDK 6+ extensions allowed to be run on the current VM?



WINDOWS
final public static boolean WINDOWS(Code)



XPATH_ENCODEDSLASH
final public static String XPATH_ENCODEDSLASH(Code)
The character(s) representing a "xpath slash" (/) in a public URL.



digest
public static MessageDigest digest(Code)





Method Detail
checkParameterEmpty
public static void checkParameterEmpty(Object value, String parameterName)(Code)
Check if the given value is empty (empty string or null for String objects, empty collection, null for other objects) and throw an exception if empty.
Parameters:
  value - value to check
Parameters:
  parameterName - name of the value (for the exception)



checkParameterNull
public static void checkParameterNull(Object value, String parameterName)(Code)
Check if the given value is empty (empty string or null for String objects, empty collection, null for other objects) and throw an exception if empty.
Parameters:
  value - value to check
Parameters:
  parameterName - name of the value (for the exception)



decodeXPath
public static String decodeXPath(String escapedXPath)(Code)
Decodes a previously escaped XPath.
Parameters:
  escapedXPath - the escaped XPath the decoded XPath
See Also:   FxSharedUtils.escapeXPath(String)



escapePath
public static String escapePath(String path)(Code)
Escape a path for usage on the current operating systems shell
Parameters:
  path - path to escape escaped path



escapeXPath
public static String escapeXPath(String xpath)(Code)
Escapes the given XPath for use in a public URI.
Parameters:
  xpath - the xpath to be escaped the given XPath for use in a public URI.
See Also:   FxSharedUtils.decodeXPath(String)



executeCommand
public static ProcessResult executeCommand(String command, String... arguments)(Code)
Execute a command on the operating system
Parameters:
  command - name of the command
Parameters:
  arguments - arguments to pass to the command (one argument per String!) result



formatResultValue
public static String formatResultValue(Object value, ContentLinkFormatter linkFormatter, String linkFormat, String itemLinkFormat)(Code)
Formats the value as returned from a flexive search query.
Parameters:
  value - the value to be formatted the formatted string value



get
public static V get(Map<K, V> map, K key, V defaultValue)(Code)
Returns map.get(key) if key exists, defaultValue otherwise.
Parameters:
  map - a map
Parameters:
  key - the required key
Parameters:
  defaultValue - the default value to be returned if key does not exist in map map.get(key) if key exists, defaultValue otherwise.



getBuildDate
public static String getBuildDate()(Code)
Get the date flexive was compiled compile date



getBuildNumber
public static String getBuildNumber()(Code)
Get the subversion build number subversion build number



getBuildUser
public static String getBuildUser()(Code)
Get the name of the user that built flexive build user



getBundledGroovyVersion
public static String getBundledGroovyVersion()(Code)
Get the version of the bundled groovy runtime version of the bundled groovy runtime



getBytes
public static byte[] getBytes(String s)(Code)
Returns the UTF-8 byte representation of the given string. Use this instead of String.getBytes , since the latter will fail if the system locale is not UTF-8.
Parameters:
  s - the string to be processed the UTF-8 byte representation of the given string



getCollator
public static Collator getCollator()(Code)
Returns a collator for the calling user's locale. a collator for the calling user's locale.



getColumnIndex
public static int getColumnIndex(String[] columnNames, String name)(Code)
Return the index of the given column name. If name has no prefix (e.g. "co."), then only a suffix match is performed (e.g. "name" matches "co.name" or "abc.name", whichever comes first.)
Parameters:
  columnNames - all column names to be searched
Parameters:
  name - the requested column name the 1-based index of the given column, or -1 if it does not exist



getColumnIndex
public static int getColumnIndex(List<String> columnNames, String name)(Code)
Return the index of the given column name. If name has no prefix (e.g. "co."), then only a suffix match is performed (e.g. "name" matches "co.name" or "abc.name", whichever comes first.)
Parameters:
  columnNames - all column names to be searched
Parameters:
  name - the requested column name the 1-based index of the given column, or -1 if it does not exist



getDrops
public static synchronized List<String> getDrops()(Code)
Get a list of all installed and deployed drops list of all installed and deployed drops



getEmptyResultMessage
public static String getEmptyResultMessage()(Code)
Returns the localized "empty" message for empty result fields the localized "empty" message for empty result fields



getEnumLabel
public static FxString getEnumLabel(Enum value, Object... args)(Code)
Returns the localized label for the given enum value. The enum translations are stored in FxSharedMessages.properties and are standardized as FQCN.value , e.g. com.flexive.shared.search.query.ValueComparator.LIKE .
Parameters:
  value - the enum value to be translated
Parameters:
  args - optional arguments to be replaced in the localized messages the localized label for the given enum value



getFlexiveEdition
public static String getFlexiveEdition()(Code)
Get the name of this flexive edition flexive edition



getFlexiveEditionFull
public static String getFlexiveEditionFull()(Code)
Get the name of this flexive edition with the product name flexive edition with product name



getFlexiveVersion
public static String getFlexiveVersion()(Code)
Get the flexive version flexive version



getHeader
public static String getHeader()(Code)
Get the default html header title html header title



getLocalizedMessage
public static String getLocalizedMessage(String resourceBundle, long localeId, String localeIso, String key, Object... args)(Code)
Get the localized message for a given language code and ISO
Parameters:
  resourceBundle - the resource bundle to use
Parameters:
  localeId - used locale if args contain FxString instances
Parameters:
  localeIso - ISO code of the requested locale
Parameters:
  key - the key in the resource bundle
Parameters:
  args - arguments to replace in the message ({n}) localized message



getMappedFunction
public static Map<K, V> getMappedFunction(ParameterMapper<K, V> mapper)(Code)
Projects a single-parameter function on a hashmap. Useful for calling parameterized functions from JSF-EL.
Parameters:
  mapper - the parameter mapper wrapping the function to be called a hashmap projected on the given parameter mapper



getMessage
public static FxString getMessage(String resourceBundle, String key, Object... args)(Code)
Returns a multilingual FxString with all translations for the given property key.
Parameters:
  resourceBundle - the resource bundle to be used
Parameters:
  key - the message key
Parameters:
  args - optional parameters to be replaced in the property translations a multilingual FxString with all translations for the given property key.



getUsedStepDefinitions
public static List<StepDefinition> getUsedStepDefinitions(List<? extends Step> steps, List<? extends StepDefinition> stepDefinitions)(Code)
Returns a list of all used step definitions for the given steps
Parameters:
  steps - list of steps to be examined
Parameters:
  stepDefinitions - all defined step definitions a list of all used step definitions for this workflow



hashPassword
public static synchronized String hashPassword(long accountId, String password)(Code)
Compute the hash of the given flexive password.
Parameters:
  accountId - the user account ID
Parameters:
  password - the cleartext password a hashed password



isGroovyScript
public static boolean isGroovyScript(String name)(Code)
Is the script (most likely) a groovy script?
Parameters:
  name - script name to check if this script could be a groovy script



isQuoted
public static boolean isQuoted(String value, char quoteChar)(Code)
Returns true if the given string value is quoted with the given character (e.g. 'value').
Parameters:
  value - the string value to be checked
Parameters:
  quoteChar - the quote character, for example ' true if the given string value is quoted with the given character (e.g. 'value').



loadFile
public static String loadFile(File file)(Code)
Load the contents of a file, returning it as a String. This method should only be used when really necessary since no real error handling is performed!!!
Parameters:
  file - the File to load file contents



loadFromInputStream
public static String loadFromInputStream(InputStream in, int length)(Code)
Load a String from an InputStream (until end of stream)
Parameters:
  in - InputStream
Parameters:
  length - length of the string if > -1 (NOT number of bytes to read!) String



lookupResource
public static String lookupResource(String resourceBundle, String key, String localeIso)(Code)
Try to find a localized resource messages
Parameters:
  resourceBundle - the name of the resource bundle to retrieve the message from
Parameters:
  key - resource key
Parameters:
  localeIso - locale of the resource bundle resource from a localized bundle



sha1Hash
public static String sha1Hash(byte[] bytes) throws NoSuchAlgorithmException(Code)
Creates a SHA-1 hash for the given data and returns it in hexadecimal string encoding.
Parameters:
  bytes - data to be hashed hex-encoded hash
throws:
  java.security.NoSuchAlgorithmException - if the SHA-1 provider does not exist



splitLiterals
public static String[] splitLiterals(String text, char[] stringDelims, char separator)(Code)
Splits the given text using separator. String literals are supported, e.g. abc,def yields two elements, but 'abc,def' yields one (stringDelims = ['\''], separator = ',').
Parameters:
  text - the text to be splitted
Parameters:
  stringDelims - delimiters for literal string values, usually ' and "
Parameters:
  separator - separator between tokens split string



splitLiterals
public static String[] splitLiterals(String text)(Code)
Splits the given comma-separated text. String literals are supported, e.g. abc,def yields two elements, but 'abc,def' yields one.
Parameters:
  text - the text to be splitted split string



storeFile
public static boolean storeFile(String contents, File file)(Code)
Rather primitive "write String to file" helper, returns false if failed
Parameters:
  contents - the String to store
Parameters:
  file - the file, if existing it will be overwritten if successful



stripQuotes
public static String stripQuotes(String value, char quoteChar)(Code)
Strips the quotes from the given string if it is quoted, otherwise it returns the input value itself.
Parameters:
  value - the value to be "unquoted"
Parameters:
  quoteChar - the quote character, for example ' the unquoted string, or value, if it was not quoted



writeResultValue
public static void writeResultValue(Writer out, Object value, ContentLinkFormatter linkFormatter, String linkFormat, String itemLinkFormat) throws IOException(Code)
Renders the value as returned from a flexive search query to the given output writer.
Parameters:
  out - the output writer
Parameters:
  value - the value to be formatted
throws:
  IOException - if the value could not be written



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.