|
NetCharts Server | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--netcharts.server.util.Util
Assorted utility methods.
| Constructor Summary | |
Util()
|
|
| Method Summary | |
static java.lang.String |
appendToQueryString(java.util.Hashtable variables,
java.util.Hashtable excludes,
java.lang.String queryString)
Appends the set of key/value pairs contained within the variables Hashtable that do not exist in the excludes Hashtable to the HTTP query string supplied. |
static java.lang.String |
appendToQueryString(java.util.Hashtable variables,
java.util.Vector excludes,
java.lang.String queryString)
Appends the set of key/value pairs contained within the variables Hashtable that do not exist in the excludes Hashtable to the HTTP query string supplied. |
static java.lang.String |
appendToQueryString(java.lang.String parameterName,
java.lang.String parameterValue,
java.lang.String queryString)
Appends the new parameter and value to the HTTP query string supplied. |
static void |
checkHashtableParametersForChart(java.util.Hashtable vars)
Ensures that the Hashtable contains no parameters that we add specifically and that there is a type parameter. |
static void |
combineHashtables(java.util.Hashtable orig,
java.util.Hashtable toAdd)
Appends one Hashtable to another. |
static java.lang.Object[][] |
convertNCXMLToObjectArray(byte[] ncxml)
Converts NCXML into an Object[][]. |
static java.lang.Object[][] |
convertNCXMLToObjectArray(org.xml.sax.InputSource source)
Converts NCXML into an Object[][]. |
static java.lang.Object[][] |
convertNCXMLToObjectArray(java.lang.String ncxml)
Converts NCXML into an Object[][]. |
static java.sql.ResultSet |
convertObjectArrayToResultSet(java.lang.Object[][] data,
boolean useFirstRowAsColumnNames)
Converts an Object[][] into a ResultSet. |
static java.lang.String |
convertResultSetToNCXML(java.sql.ResultSet data)
Converts an ResultSet into NCXML. |
static java.lang.String |
convertResultSetToNCXML(java.sql.ResultSet data,
boolean useColumnNamesAsFirstRow)
Converts an ResultSet into NCXML. |
static java.lang.String |
convertResultSetToNCXML(java.sql.ResultSet data,
boolean useColumnNamesAsFirstRow,
java.lang.String encoding)
Converts an ResultSet into NCXML. |
static java.lang.String |
convertResultSetToNCXML(java.sql.ResultSet data,
java.lang.String encoding)
Converts an ResultSet into NCXML. |
static java.lang.Object[][] |
convertResultSetToObjectArray(java.sql.ResultSet rs)
Converts an ResultSet into a Object[][]. |
static java.lang.Object[][] |
convertResultSetToObjectArray(java.sql.ResultSet rs,
boolean useColumnNamesAsFirstRow)
Converts an ResultSet into a Object[][]. |
static java.lang.String |
convertToCSV(java.lang.Object[][] data,
char delimiter)
Converts an Object[][] into CSV. |
static java.lang.String |
convertToNCXML(java.lang.Object[][] data)
Converts an Object[][] into NCXML. |
static java.lang.String |
convertToNCXML(java.lang.Object[][] data,
java.lang.String encoding)
Converts an Object[][] into NCXML. |
static java.util.Vector |
convertToVector(java.lang.Object[][] data)
Converts an Object[][] into a Vector. |
static java.lang.String |
createQueryString(java.util.Hashtable variables,
java.util.Hashtable excludes)
Creates a HTTP query string containing the set of key/value pairs contained within the variables Hashtable that do not exist in the excludes Hashtable. |
static java.lang.String |
createQueryString(java.util.Hashtable variables,
java.util.Vector excludes)
Creates a HTTP query string containing the set of key/value pairs contained within the variables Hashtable that do not exist in the excludes Hashtable. |
static java.lang.String |
encode(java.lang.String s)
URL encode the string but ignore /'s. |
static java.lang.String |
formatForHtml(java.lang.String in)
HTML encodes the string |
static java.lang.String |
formatForXML(java.lang.String in)
Encodes the string for inclusion within XML. |
static byte[] |
getBytes(java.lang.String data,
java.lang.String encoding)
Get bytes from a string given a String and an encoding mechanism. |
static java.lang.String |
getEncodingForXMLPI(java.lang.String encoding)
Get the XML PI attribute representing the encoding. |
static java.lang.String |
getRelativePath(java.lang.String absolutePath1,
java.lang.String absolutePath2)
Resolves an absolute path against another to get a relative path. Case insensitive Examples of input/output combinations: absolutePath1="c:\\folder1\\" absolutePath2="c:\\folder1\\sub-folder1\\" getRelativePath=".\\sub-folder1\\" absolutePath1="c:\\folder1\\" absolutePath2="c:\\folder1\\sub-folder1\\file.txt" getRelativePath=".\\sub-folder1\\file.txt" absolutePath1="c:\\folder1\\sub-folder1\\" absolutePath2="c:\\folder2\\" getRelativePath="..\\..\\folder2\\" If the drives are different then an absolute path must be returned. For example: absolutePath1="c:\\folder1\\" absolutePath2="d:\\folder2\\" getRelativePath="d:\\folder2\\" |
static java.lang.String[] |
getResultSetColumnNames(java.sql.ResultSet data)
Get the column nbames of a ResultSet. |
static java.lang.String |
newString(byte[] data,
java.lang.String encoding)
Make a new string given a byte array and an encoding mechanism. |
static java.lang.String |
newString(chartworks.es.util.ServerReply sr)
Make a new string given the ServerReply's content byte array and character encoding. |
static java.util.Hashtable |
parseParameters(java.lang.String parameters)
|
static byte[] |
readBytesFully(java.io.InputStream input)
Reads the InputStream into the byte array. |
static java.lang.String |
removeQueryParameter(java.lang.String queryString,
java.lang.String parameter,
boolean all)
Removes a parameter from an existing query string. |
static java.lang.String |
replaceVar(java.lang.String origString,
java.lang.String variable,
java.lang.String newValue,
boolean all)
Replaces the variable string with the replacement value. |
static void |
resetResultSet(java.sql.ResultSet rs)
Reset a ResultSet to before its first row. |
static java.lang.String |
urlEncode(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Util()
| Method Detail |
public static void combineHashtables(java.util.Hashtable orig,
java.util.Hashtable toAdd)
orig - The Hashtable to add to.toAdd - The Hashtable to add from.
public static java.lang.String appendToQueryString(java.lang.String parameterName,
java.lang.String parameterValue,
java.lang.String queryString)
parameterName - The name of the parameter to add to the query string.parameterValue - The value of the parameter to add to the query string.queryString - The query string to append to.
public static java.lang.String createQueryString(java.util.Hashtable variables,
java.util.Hashtable excludes)
variables - The set of key/value pairs to add to the query string.excludes - The set of key/value pairs to exclude from the query string.
public static java.lang.String appendToQueryString(java.util.Hashtable variables,
java.util.Hashtable excludes,
java.lang.String queryString)
variables - The set of key/value pairs to add to the query string.excludes - The set of key/value pairs to exclude from the query string (can be null).queryString - The query string to append to.
public static java.lang.String createQueryString(java.util.Hashtable variables,
java.util.Vector excludes)
variables - The set of key/value pairs to add to the query string.excludes - The set of parameters to exclude from the query string.
public static java.lang.String appendToQueryString(java.util.Hashtable variables,
java.util.Vector excludes,
java.lang.String queryString)
variables - The set of key/value pairs to add to the query string.excludes - The set of parameters to exclude from the query string (can be null).queryString - The query string to append to.
public static java.lang.String removeQueryParameter(java.lang.String queryString,
java.lang.String parameter,
boolean all)
queryString - The query string to append to.parameter - The parameter to remove.all - Whether all occurrences of this parameter should be removed.
public static java.lang.String replaceVar(java.lang.String origString,
java.lang.String variable,
java.lang.String newValue,
boolean all)
origString - The original string containing variable to replace.variable - The variable to replace.newValue - The value to replace the variable with.all - Whether or not all variable instances should be replaced.public static void checkHashtableParametersForChart(java.util.Hashtable vars)
vars - The original string containing variable to replace.public static byte[] readBytesFully(java.io.InputStream input)
input - The InputStream containing the input.public static java.lang.String formatForHtml(java.lang.String in)
in - The string to encode for HTML.public static java.lang.String formatForXML(java.lang.String in)
in - The string to encode.public static java.util.Hashtable parseParameters(java.lang.String parameters)
public static java.lang.String encode(java.lang.String s)
public static java.lang.String convertToNCXML(java.lang.Object[][] data)
data - The data to convert.
public static java.lang.String convertToNCXML(java.lang.Object[][] data,
java.lang.String encoding)
data - The data to convert.encoding - The encoding to use for the xml doc.
public static java.lang.String convertToCSV(java.lang.Object[][] data,
char delimiter)
data - The data to convert.public static java.util.Vector convertToVector(java.lang.Object[][] data)
data - The data to convert.public static java.lang.String convertResultSetToNCXML(java.sql.ResultSet data)
data - The data to convert.
public static java.lang.String convertResultSetToNCXML(java.sql.ResultSet data,
boolean useColumnNamesAsFirstRow)
data - The data to convert.useColumnNamesAsFirstRow - Whether to use the column names as
the first row of data.
public static java.lang.String convertResultSetToNCXML(java.sql.ResultSet data,
java.lang.String encoding)
data - The data to convert.encoding - The encoding to use for the xml doc.
public static java.lang.String convertResultSetToNCXML(java.sql.ResultSet data,
boolean useColumnNamesAsFirstRow,
java.lang.String encoding)
data - The data to convert.useColumnNamesAsFirstRow - Whether to use the column names as
the first row of data.encoding - The encoding to use for the xml doc.public static void resetResultSet(java.sql.ResultSet rs)
public static java.lang.String[] getResultSetColumnNames(java.sql.ResultSet data)
data - The ResultSet.public static java.lang.Object[][] convertNCXMLToObjectArray(byte[] ncxml)
ncxml - The NCXML to convert.public static java.lang.Object[][] convertNCXMLToObjectArray(java.lang.String ncxml)
ncxml - The NCXML to convert.public static java.lang.Object[][] convertNCXMLToObjectArray(org.xml.sax.InputSource source)
source - The NCXML to convert.public static java.lang.Object[][] convertResultSetToObjectArray(java.sql.ResultSet rs)
rs - The data to convert.
public static java.lang.Object[][] convertResultSetToObjectArray(java.sql.ResultSet rs,
boolean useColumnNamesAsFirstRow)
rs - The data to convert.useColumnNamesAsFirstRow - Whether to make the column names the
first row of the object array.
public static java.sql.ResultSet convertObjectArrayToResultSet(java.lang.Object[][] data,
boolean useFirstRowAsColumnNames)
data - The data to convert.useFirstRowAsColumnNames - Whether to make the first row of the
object array the column names of the ResultSet.public static java.lang.String newString(chartworks.es.util.ServerReply sr)
public static java.lang.String newString(byte[] data,
java.lang.String encoding)
public static byte[] getBytes(java.lang.String data,
java.lang.String encoding)
public static java.lang.String getEncodingForXMLPI(java.lang.String encoding)
public static java.lang.String getRelativePath(java.lang.String absolutePath1,
java.lang.String absolutePath2)
public static java.lang.String urlEncode(java.lang.String s)
|
NetCharts Server | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2006 |
Last Modified: Nov 26, 2006 |