asit.common
Class Utils
java.lang.Object
asit.common.Utils
- public class Utils
- extends Object
|
Constructor Summary |
Utils()
|
|
Method Summary |
static byte[] |
base64Decoder(byte[] input)
|
static byte[] |
base64Encoder(byte[] input)
|
static void |
checkBase64Signature(String base64)
|
static SSLSocketFactory |
configureHTTPSConnection(InputStream clientAuthFile,
String clientAuthPass,
String clientAuthType,
InputStream trustStoreFile,
String password,
String trustStoreType)
|
static SSLSocketFactory |
configureHTTPSConnection(String clientAuthFile,
String clientAuthPass,
String clientAuthType,
String keyStoreFile,
String password,
String trustStoreType)
|
static void |
convertPKCS12ToJKS(String pkcs12,
String jks,
String password,
String alias)
|
static Document |
createEmptyDocument(boolean ns)
|
static Document |
createEmptyDocumentNS()
|
static void |
createTrustStore(Hashtable certificates,
String jks,
String password)
|
static Hashtable |
decodeURLEncodedHTTPRequest(String httprequest)
|
static List |
diff(Collection c1,
Collection c2)
|
static void |
dumpInputOutputStream(InputStream is,
OutputStream os)
|
static void |
dumpInputOutputStream(Reader reader,
OutputStream os)
|
static String |
formatNotificationDate(String date,
String month,
String year)
|
static String |
generateAppDeliveryID()
|
static String |
generateHTMLInputFormEntry(String description,
String paramname,
String paramvalue,
boolean readonly,
boolean hidden)
|
static String |
getSearchURL(boolean advanced,
int startIndex,
String mzsid,
String appid,
String datefrom,
String datebetween,
String errorcode,
String errormessage)
|
static String |
getSubjectDNDetail(String component,
String subjectdn)
|
static String |
getXMLString(Document xmldocument)
|
static String |
getXMLString(Element xmldocumentelement)
|
static String |
inputStreamToBase64(InputStream is)
|
static boolean |
isEmpty(String str)
|
static void |
main(String[] args)
|
static void |
mapVerifyResultToJSP(VerifyResult result,
HttpServletRequest request)
|
static String |
normalizeText(String inputText)
|
static Element |
packIntoSoap(Element element)
|
static Document |
parseXMLString(String inputString)
|
static Document |
parseXMLStringNoNS(String inputString)
|
static Document |
readDocFromIsNoNS(InputStream is)
|
static Document |
readDocFromIsNS(InputStream is)
|
static Document |
readDocFromIsNS(Reader is)
|
static String |
replaceVariable(String content,
String variable,
String textToInsert)
|
static String |
replaceVariables(File file,
Hashtable pairs)
|
static String |
replaceWord(String original,
String keyword,
String replacement)
|
static boolean |
serialize(Document doc,
OutputStream outputStream,
boolean addXMLHeader,
boolean ident)
|
static boolean |
serialize(Element doc,
OutputStream outputStream,
boolean addXMLHeader,
boolean ident)
|
static void |
serializeDocument(Document doc,
OutputStream out)
|
static void |
serializeElement(Element element,
OutputStream out)
|
static void |
serializeNode(Node node,
OutputStream out)
|
static String |
simpleQuoter(String xmltobequoted)
|
static String |
toUnicode(String text)
|
static String |
transformInputStream(InputStream is,
InputStream xsl)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
isEmpty
public static boolean isEmpty(String str)
mapVerifyResultToJSP
public static void mapVerifyResultToJSP(VerifyResult result,
HttpServletRequest request)
getSearchURL
public static String getSearchURL(boolean advanced,
int startIndex,
String mzsid,
String appid,
String datefrom,
String datebetween,
String errorcode,
String errormessage)
packIntoSoap
public static Element packIntoSoap(Element element)
throws ParserConfigurationException
- Throws:
ParserConfigurationException
createEmptyDocumentNS
public static Document createEmptyDocumentNS()
throws ParserConfigurationException
- Throws:
ParserConfigurationException
createEmptyDocument
public static Document createEmptyDocument(boolean ns)
throws ParserConfigurationException
- Throws:
ParserConfigurationException
diff
public static List diff(Collection c1,
Collection c2)
configureHTTPSConnection
public static SSLSocketFactory configureHTTPSConnection(String clientAuthFile,
String clientAuthPass,
String clientAuthType,
String keyStoreFile,
String password,
String trustStoreType)
throws Exception
- Throws:
Exception
configureHTTPSConnection
public static SSLSocketFactory configureHTTPSConnection(InputStream clientAuthFile,
String clientAuthPass,
String clientAuthType,
InputStream trustStoreFile,
String password,
String trustStoreType)
throws Exception
- Throws:
Exception
serializeElement
public static void serializeElement(Element element,
OutputStream out)
throws IOException
- Throws:
IOException
serializeDocument
public static void serializeDocument(Document doc,
OutputStream out)
throws IOException
- Throws:
IOException
serializeNode
public static void serializeNode(Node node,
OutputStream out)
throws IOException
- Throws:
IOException
readDocFromIsNoNS
public static Document readDocFromIsNoNS(InputStream is)
throws Exception
- Throws:
Exception
readDocFromIsNS
public static Document readDocFromIsNS(InputStream is)
throws Exception
- Throws:
Exception
readDocFromIsNS
public static Document readDocFromIsNS(Reader is)
throws Exception
- Throws:
Exception
parseXMLString
public static Document parseXMLString(String inputString)
throws SAXException,
IOException,
ParserConfigurationException
- Throws:
SAXException
IOException
ParserConfigurationException
parseXMLStringNoNS
public static Document parseXMLStringNoNS(String inputString)
throws SAXException,
IOException,
ParserConfigurationException
- Throws:
SAXException
IOException
ParserConfigurationException
inputStreamToBase64
public static String inputStreamToBase64(InputStream is)
throws IOException
- Throws:
IOException
dumpInputOutputStream
public static void dumpInputOutputStream(InputStream is,
OutputStream os)
throws IOException
- Throws:
IOException
dumpInputOutputStream
public static void dumpInputOutputStream(Reader reader,
OutputStream os)
throws IOException
- Throws:
IOException
createTrustStore
public static void createTrustStore(Hashtable certificates,
String jks,
String password)
throws Exception
- Throws:
Exception
convertPKCS12ToJKS
public static void convertPKCS12ToJKS(String pkcs12,
String jks,
String password,
String alias)
throws Exception
- Throws:
Exception
serialize
public static boolean serialize(Document doc,
OutputStream outputStream,
boolean addXMLHeader,
boolean ident)
- Parameters:
doc - outputStream - addXMLHeader - ident -
- Returns:
serialize
public static boolean serialize(Element doc,
OutputStream outputStream,
boolean addXMLHeader,
boolean ident)
simpleQuoter
public static String simpleQuoter(String xmltobequoted)
- Parameters:
xmltobequoted -
- Returns:
getSubjectDNDetail
public static String getSubjectDNDetail(String component,
String subjectdn)
- Parameters:
component - subjectdn -
- Returns:
generateHTMLInputFormEntry
public static String generateHTMLInputFormEntry(String description,
String paramname,
String paramvalue,
boolean readonly,
boolean hidden)
- Parameters:
description - paramname - paramvalue - readonly -
- Returns:
base64Encoder
public static byte[] base64Encoder(byte[] input)
throws IOException
- Parameters:
input -
- Returns:
- @throws
IOException
- Throws:
IOException
base64Decoder
public static byte[] base64Decoder(byte[] input)
throws IOException
- Parameters:
input -
- Returns:
- @throws
IOException
- Throws:
IOException
replaceWord
public static String replaceWord(String original,
String keyword,
String replacement)
- Parameters:
original - keyword - replacement -
- Returns:
decodeURLEncodedHTTPRequest
public static Hashtable decodeURLEncodedHTTPRequest(String httprequest)
throws UnsupportedEncodingException
- Parameters:
httprequest -
- Returns:
- @throws
UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getXMLString
public static String getXMLString(Document xmldocument)
getXMLString
public static String getXMLString(Element xmldocumentelement)
replaceVariable
public static String replaceVariable(String content,
String variable,
String textToInsert)
replaceVariables
public static String replaceVariables(File file,
Hashtable pairs)
throws IOException
- Throws:
IOException
normalizeText
public static String normalizeText(String inputText)
toUnicode
public static String toUnicode(String text)
transformInputStream
public static String transformInputStream(InputStream is,
InputStream xsl)
throws TransformerException,
UnsupportedEncodingException
- Throws:
TransformerException
UnsupportedEncodingException
formatNotificationDate
public static String formatNotificationDate(String date,
String month,
String year)
throws FormatException
- Throws:
FormatException
checkBase64Signature
public static void checkBase64Signature(String base64)
throws FormatException
- Throws:
FormatException
generateAppDeliveryID
public static String generateAppDeliveryID()
throws DeliveryException
- Throws:
DeliveryException
main
public static void main(String[] args)
Copyright 2007 Institut fuer Angewandte Informationsverarbeitung und Kommunikationstechnologie. All Rights Reserved.