|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.knipp.rritoolkit.Utils
public class Utils
class with some utilities that do not fit elsewhere
Field Summary | |
---|---|
private static java.util.regex.Pattern |
datePattern
the date pattern |
private static java.util.TimeZone |
denicTimeZone
the time zone for date conversions |
private static char[] |
hexDigits
hex digits |
Constructor Summary | |
---|---|
private |
Utils()
private constructor to prevent instantiation |
Method Summary | |
---|---|
static byte[] |
calcAuthInfoHash(java.lang.String authInfo)
method that calculates the SHA-256 hash from a given authInfo |
static java.lang.String |
formatDate(java.util.Date date)
format the given date as 8 digit year/month/day, as required for the "create AuthInfo 1" operation. |
static java.lang.String |
formatDateTime(java.util.Date date)
format the given date as a string, conforming to the DENIC specs. |
static byte[] |
fromBase64Binary(java.lang.String text)
convert a string conforming to the XML Schema base64Binary syntax to a sequence of bytes |
static java.util.Date |
parseDateTime(java.lang.String text)
helper method to parse a date. |
static java.lang.String |
toBase64Binary(byte[] data)
convert a byte sequence to a string conforming to the XML Schema base64Binary syntax |
static java.lang.String |
toHex(byte[] data)
convert the given byte sequence to a hex string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.regex.Pattern datePattern
private static final java.util.TimeZone denicTimeZone
private static final char[] hexDigits
Constructor Detail |
---|
private Utils()
Method Detail |
---|
public static java.util.Date parseDateTime(java.lang.String text) throws ResponseParseException
null
is
accepted and will result in a null
date
text
- the date in text representation,
may be null
null
if the given text is null
ResponseParseException
- if the input is malformedpublic static java.lang.String formatDateTime(java.util.Date date)
null
date results in a null
.
date
- the date to convert
public static java.lang.String formatDate(java.util.Date date)
date
- the date to convert, may be null
YYYYMMDD
, or
null
if given parameter is also
null
public static java.lang.String toHex(byte[] data)
data
- the binary data
public static byte[] fromBase64Binary(java.lang.String text)
text
- the textual hexadecimal representation,
may be null
null
if the given text is
also null
java.lang.IllegalArgumentException
- if the string does not conform to the
Base64 encodingpublic static java.lang.String toBase64Binary(byte[] data)
data
- the binary data, may be null
null
if the given data is
also null
public static byte[] calcAuthInfoHash(java.lang.String authInfo)
authInfo
- the AuthInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |