public final class HdocUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HdocUtil.DocId
This class represents a DocId.
|
static class |
HdocUtil.SAPDocId
This class represents a SAP DocId.
|
Modifier and Type | Field and Description |
---|---|
static int |
APOSTROPHE
The Constant APOSTROPHE.
|
static int |
CLOSE_BRACKET
The Constant CLOSE_BRACKET.
|
static char[] |
DIGITS
The Constant DIGITS.
|
static int |
EXCLAMATION_MARK
The Constant EXCLAMATION_MARK.
|
static int |
NINE
The Constant NINE.
|
static int |
OPEN_BRACKET
The Constant OPEN_BRACKET.
|
static int |
QOUTE
The Constant QOUTE.
|
static int |
STAR
The Constant STAR.
|
static int |
ZERO
The Constant ZERO.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
bytesToHex(byte[] raw)
Converts the given byte[] to a Hex String.
|
static HdocUtil.SAPDocId |
convert(HdocUtil.DocId docId)
This method converts an encoded XHDOC, so it can be used with SAP.
|
static String |
decode(HdocUtil.DocId docId)
This method tries to decode an encoded Document ID, which is used by the
HTML-Gateway.
|
static String |
decode(HdocUtil.SAPDocId sapDocId)
This methode decodes a SAPDocId and returns the decoded XHDOC
(Version-specific Document ID).
|
static HdocUtil.DocId |
encode(String decoded)
This method tooks a XHDOC (Version-specific Document ID) and encodes it,
so this one can be used by the HTML-Gateway.
|
protected static byte[] |
hexToBytes(String hex)
Converts the given Hex String to a byte array.
|
static void |
main(String[] args)
Test driver.
|
protected static String |
replaceAfterEncode(String encodedUID)
Replaces after encoding the given string.
|
protected static String |
replaceBeforeDecode(String encodedUID)
Replaces before encoding the given string.
|
static void |
test()
Test method.
|
public static final char[] DIGITS
public static final int EXCLAMATION_MARK
public static final int STAR
public static final int ZERO
public static final int NINE
public static final int OPEN_BRACKET
public static final int CLOSE_BRACKET
public static final int QOUTE
public static final int APOSTROPHE
public static HdocUtil.DocId encode(String decoded)
decoded
- XHDOC (Version-specific Document ID)convert(DocId)
public static HdocUtil.SAPDocId convert(HdocUtil.DocId docId)
docId
- encoded XHDOCpublic static String decode(HdocUtil.SAPDocId sapDocId) throws Exception
sapDocId
- Encoded XHDOC (Version-specific Document ID)Exception
- If the sapDocId is not conformprotected static String replaceAfterEncode(String encodedUID)
encodedUID
- The String to be encoded.protected static String replaceBeforeDecode(String encodedUID)
encodedUID
- The String to be encoded.public static String decode(HdocUtil.DocId docId) throws IOException
docId
- Encoded XHDOC (Version-specific Document ID)IOException
- If an error occurs, while decoding (Base64)protected static String bytesToHex(byte[] raw)
raw
- The byte array to be converted to a Hex String.protected static byte[] hexToBytes(String hex)
hex
- The Hex String to be converted.public static void test() throws Exception
Exception
- if an error occurs.Copyright © 2020 Hyland Software Germany GmbH. All rights reserved.