Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.util
Class JavaSEUtility

java.lang.Object
  extended by oracle.adfnmc.util.JavaSEUtility

public class JavaSEUtility
extends java.lang.Object

Contains miscellaneous utility functions


Field Summary
static PropertyBag appConfigFile
           
static java.lang.Class CLASS_INSTANCE
           
static java.lang.String CRLF
           
static ResourceLoader defaultResourceLoader
           
 
Constructor Summary
JavaSEUtility()
           
 
Method Summary
static void closeSilently(java.io.InputStream is)
          Close the specified InputStream and ignore any IOException that may be thrown as a result
static java.lang.String fullNameToPathName(java.lang.String fullName)
           
static java.lang.String fullNameToPropertiesFileName(java.lang.String fullName)
           
static java.lang.String fullNameToXliffFileName(java.lang.String fullName)
           
static java.lang.String fullNameToXmlFileName(java.lang.String fullName)
          Convert a fully-qualified classname, like "oracle.adfnmc.model.Products", to a filename relative to the predefined resources base directory, like "/res/oracle/adfnmc/model/Products.xml"
static java.lang.String getAppConfigDefinedDir(java.lang.String key, java.lang.String defaultVal, boolean isJarPath)
          Utility method for getting application file configurable paths.
static PropertyBag getAppConfigFile()
          Get the properties for this application.
static Map getAppConfigFileAsMap()
           
static ResourceLoader getDefaultResourceLoader()
           
static java.lang.String getLocaleName(java.lang.String baseName, Locale locale)
          Create a property/bundle name of the form "baseName_language_country_variant".
static java.lang.String getMetadataBasedir()
          Deprecated. - Now just use getRootPath() + the path of the resource relative to the root of the jar it is packaged in
static java.io.InputStream getResourceAsStream(java.lang.String resName)
          Load the requested resource and return it as an InputStream for reading
static java.lang.String handleEscapeChars(java.lang.String str)
           
static boolean isEmpty(java.lang.String s)
          Is the provided string empty?
static java.util.Vector parseBufferIntoLines(java.io.InputStream stream)
          Parse a stream of bytes into lines delimited by newline characters
static java.lang.String[] tokenize(java.lang.String str, java.lang.String delimiter)
          Break apart string into tokens delimited by another string.
static java.lang.String[] tokenize(java.lang.String str, java.lang.String delimiter, int limit)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

CRLF

public static final java.lang.String CRLF
See Also:
Constant Field Values

appConfigFile

public static PropertyBag appConfigFile

defaultResourceLoader

public static ResourceLoader defaultResourceLoader
Constructor Detail

JavaSEUtility

public JavaSEUtility()
Method Detail

parseBufferIntoLines

public static final java.util.Vector parseBufferIntoLines(java.io.InputStream stream)
Parse a stream of bytes into lines delimited by newline characters

Parameters:
stream -
Returns:
A Vector of String's, each of which represents one line. Trailing CR, LF characters are stripped away. Returns null if there was a problem.

tokenize

public static final java.lang.String[] tokenize(java.lang.String str,
                                                java.lang.String delimiter)
Break apart string into tokens delimited by another string.

Parameters:
str - Input string to tokenize
delimiter - Another string which delimits tokens
Returns:
An array of string tokens

tokenize

public static final java.lang.String[] tokenize(java.lang.String str,
                                                java.lang.String delimiter,
                                                int limit)

getLocaleName

public static final java.lang.String getLocaleName(java.lang.String baseName,
                                                   Locale locale)
Create a property/bundle name of the form "baseName_language_country_variant". Note that if any of the components {language, country, variant} is null or empty, that part (and the preceding underscore) will be omitted from the result.

Parameters:
baseName -
locale -
Returns:

handleEscapeChars

public static java.lang.String handleEscapeChars(java.lang.String str)

fullNameToXmlFileName

public static final java.lang.String fullNameToXmlFileName(java.lang.String fullName)
Convert a fully-qualified classname, like "oracle.adfnmc.model.Products", to a filename relative to the predefined resources base directory, like "/res/oracle/adfnmc/model/Products.xml"

Parameters:
fullName - Fully-qualified classname, e.g. "oracle.adfnmc.model.Products"
Returns:
Absolute filename, e.g. "/res/oracle/adfnmc/model/Products.xml"

fullNameToPropertiesFileName

public static final java.lang.String fullNameToPropertiesFileName(java.lang.String fullName)

fullNameToXliffFileName

public static final java.lang.String fullNameToXliffFileName(java.lang.String fullName)

fullNameToPathName

public static final java.lang.String fullNameToPathName(java.lang.String fullName)

getAppConfigDefinedDir

public static java.lang.String getAppConfigDefinedDir(java.lang.String key,
                                                      java.lang.String defaultVal,
                                                      boolean isJarPath)
Utility method for getting application file configurable paths. A slash separator will be appended to the return value, so callers should not insert a slash character between the result of this call and any descendant path strings as they build up a path.

Parameters:
key -
defaultVal -
isJarPath - TODO
Returns:

getAppConfigFile

public static final PropertyBag getAppConfigFile()
Get the properties for this application. These are typically stored in a JAD file and then loaded during app initialization

Returns:
A PropertyBag which can be used to retrieve values by String keys

getAppConfigFileAsMap

public static final Map getAppConfigFileAsMap()

getMetadataBasedir

public static final java.lang.String getMetadataBasedir()
Deprecated. - Now just use getRootPath() + the path of the resource relative to the root of the jar it is packaged in

-Internal- Get the base path for application metadata resources

Returns:

getDefaultResourceLoader

public static final ResourceLoader getDefaultResourceLoader()

getResourceAsStream

public static final java.io.InputStream getResourceAsStream(java.lang.String resName)
Load the requested resource and return it as an InputStream for reading

Parameters:
resName - Name of resource, like "res/Foo.png" or "/res/SRDEMO.sql"
Returns:
An InputStream if resName was found, or null if it was not

isEmpty

public static final boolean isEmpty(java.lang.String s)
Is the provided string empty?

Parameters:
s - string to test
Returns:
true if empty; false if not

closeSilently

public static final void closeSilently(java.io.InputStream is)
Close the specified InputStream and ignore any IOException that may be thrown as a result

Parameters:
is -

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.