ariba.util.core
Class ServerUtil

java.lang.Object
  extended by ariba.util.core.ServerUtil

public class ServerUtil
extends java.lang.Object


Field Summary
static java.lang.String HTTPSProxyPassword
           
static boolean isMicrosoftVM
           
static boolean isUnix
           
static boolean isWin32
           
static boolean isWin32Enabled
          Useful for asking if it is legal to call a win32 specific api
static boolean UseSecureRandomNumberGenerator
           
 
Constructor Summary
ServerUtil()
           
 
Method Summary
static boolean compareFilenames(java.lang.String firstFilename, java.lang.String secondFilename)
           
static boolean compareInputStreams(java.io.InputStream firstStream, java.io.InputStream secondStream)
           
static boolean compareInputStreams(java.io.InputStream firstStream, java.io.InputStream secondStream, byte[] buffer1, byte[] buffer2)
           
static java.util.List fileExtension(java.lang.String mimeType)
          Returns the list of file extension names for the given mime type.
static java.lang.String filterMapValue(java.util.Map map, java.lang.String key, char fillChar)
          filterValue is useful for dumping out a Map for display in which a particular key's value is not suitable for display (e.g.
static java.lang.String filterMapValue(java.lang.String input, java.lang.String filterKey, char fillChar)
          Params: input: a string, assumed to be a result of Map.toString() filterKey: the key for which the value is to be "filtered" fillChar: the value for which the value is to be overwritten Returns null if the key was not found
static java.lang.String mimeType(java.lang.String fileExtension)
           
static java.lang.String mimeType(java.lang.String currentType, java.lang.String fileExtension)
          if we don't have a current type or the current type is the default, then try to map it by file extension.
static int nextRandomInt()
           
static long nextRandomLong()
           
static int nextSecureInt()
           
static long nextSecureLong()
           
static int parseInt(char[] charArray, int charArrayLength)
          Assuming the specified charArray represents an integer, returns that integer's value.
static int parseInt(char[] charArray, int charArrayLength, int radix)
          Assuming the specified charArray represents an integer, returns that integer's value.
static int parseInt(int offset, int scanLength, char[] charArray, int charArrayLength)
          Assuming the specified charArray represents an integer, returns that integer's value.
static int parseInt(int offset, int scanLength, char[] charArray, int charArrayLength, int radix)
          Assuming the specified charArray represents an integer, returns that integer's value.
static java.lang.String quoteQuotes(java.lang.String s, char quote)
           
static java.util.Random randomNumberGenerator()
           
static java.util.Random secureRandomNumberGenerator()
           
static void setSystemProperty(java.lang.String key, java.lang.String value)
           
static java.lang.String[] simpleParse(java.lang.String line, java.lang.String delimeter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTPSProxyPassword

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

isWin32

public static final boolean isWin32

isUnix

public static final boolean isUnix

isMicrosoftVM

public static final boolean isMicrosoftVM

isWin32Enabled

public static final boolean isWin32Enabled
Useful for asking if it is legal to call a win32 specific api


UseSecureRandomNumberGenerator

public static boolean UseSecureRandomNumberGenerator
Constructor Detail

ServerUtil

public ServerUtil()
Method Detail

quoteQuotes

public static java.lang.String quoteQuotes(java.lang.String s,
                                           char quote)

compareFilenames

public static boolean compareFilenames(java.lang.String firstFilename,
                                       java.lang.String secondFilename)

compareInputStreams

public static boolean compareInputStreams(java.io.InputStream firstStream,
                                          java.io.InputStream secondStream)

compareInputStreams

public static boolean compareInputStreams(java.io.InputStream firstStream,
                                          java.io.InputStream secondStream,
                                          byte[] buffer1,
                                          byte[] buffer2)

mimeType

public static java.lang.String mimeType(java.lang.String currentType,
                                        java.lang.String fileExtension)
if we don't have a current type or the current type is the default, then try to map it by file extension.


mimeType

public static java.lang.String mimeType(java.lang.String fileExtension)

fileExtension

public static java.util.List fileExtension(java.lang.String mimeType)
Returns the list of file extension names for the given mime type. It could return null or empty list on a not matched case.

Parameters:
mimeType - the mime type
Returns:
the mapped list of file extension names.
See Also:
Mapping.reverseMap

setSystemProperty

public static void setSystemProperty(java.lang.String key,
                                     java.lang.String value)

filterMapValue

public static java.lang.String filterMapValue(java.util.Map map,
                                              java.lang.String key,
                                              char fillChar)
filterValue is useful for dumping out a Map for display in which a particular key's value is not suitable for display (e.g. contains a password).


filterMapValue

public static java.lang.String filterMapValue(java.lang.String input,
                                              java.lang.String filterKey,
                                              char fillChar)
Params: input: a string, assumed to be a result of Map.toString() filterKey: the key for which the value is to be "filtered" fillChar: the value for which the value is to be overwritten Returns null if the key was not found


simpleParse

public static java.lang.String[] simpleParse(java.lang.String line,
                                             java.lang.String delimeter)

parseInt

public static int parseInt(int offset,
                           int scanLength,
                           char[] charArray,
                           int charArrayLength)
                    throws java.lang.NumberFormatException
Assuming the specified charArray represents an integer, returns that integer's value. Throws an exception if the charArray cannot be parsed as an int.

Throws:
java.lang.NumberFormatException - If the charArray does not contain a parsable integer.

parseInt

public static int parseInt(char[] charArray,
                           int charArrayLength,
                           int radix)
                    throws java.lang.NumberFormatException
Assuming the specified charArray represents an integer, returns that integer's value. Throws an exception if the charArray cannot be parsed as an int.

Throws:
java.lang.NumberFormatException - If the charArray does not contain a parsable integer.

parseInt

public static int parseInt(char[] charArray,
                           int charArrayLength)
                    throws java.lang.NumberFormatException
Assuming the specified charArray represents an integer, returns that integer's value. Throws an exception if the charArray cannot be parsed as an int.

Throws:
java.lang.NumberFormatException - If the charArray does not contain a parsable integer.

parseInt

public static int parseInt(int offset,
                           int scanLength,
                           char[] charArray,
                           int charArrayLength,
                           int radix)
                    throws java.lang.NumberFormatException
Assuming the specified charArray represents an integer, returns that integer's value. Throws an exception if the charArray cannot be parsed as an int.

Throws:
java.lang.NumberFormatException - If the charArray does not contain a parsable integer.

secureRandomNumberGenerator

public static final java.util.Random secureRandomNumberGenerator()

nextSecureInt

public static final int nextSecureInt()

nextSecureLong

public static final long nextSecureLong()

randomNumberGenerator

public static final java.util.Random randomNumberGenerator()

nextRandomInt

public static final int nextRandomInt()

nextRandomLong

public static final long nextRandomLong()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.