public class LicenseUtil extends Object
| Constructor and Description |
|---|
LicenseUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertDateToString(LocalDate date,
String stringFormat)
Convert date to string.
|
static LocalDate |
convertStringToDate(String dateTimeString,
String stringFormat)
Convert string to date string.
|
static InputStream |
createFileInputStreamBuffered(File file)
Create InputStream from file.
|
static byte[] |
decodeFromBase64String(String encoded)
Decoder from base64.
|
static LocalDate |
getDateValue(Element parentElem,
String childElemName)
Gets date value from the specified XML element.
|
static Element |
getElementByName(Element parentElem,
String childElemName)
Xml helper function.
|
static String |
getJarFolder(Class clazz)
Get jar folder
|
static String |
getOuterXml(Node node)
Java helper function to get XML from a DOM element.
|
static String |
getStringValue(Element parentElem,
String childElemName)
Returns text from the child element of a specified parent element or empty string if the element was not found.
|
static byte[] |
stripLeadingZeros(byte[] sourceArray)
Java: Utility method to delete the leading zeros from the byte array.
|
public static String getStringValue(Element parentElem, String childElemName)
Returns text from the child element of a specified parent element or empty string if the element was not found.
parentElem - Element object.childElemName - string.public static LocalDate getDateValue(Element parentElem, String childElemName) throws ParseException
Gets date value from the specified XML element. Returns DateTime.MaxValue if the element is missing.
parentElem - Element object.childElemName - string.ParseException - if can not parse element.public static LocalDate convertStringToDate(String dateTimeString, String stringFormat) throws ParseException
stringFormat - format of the string.dateTimeString - format of the string.ParseException - if can not parse element.public static String convertDateToString(LocalDate date, String stringFormat)
date - LocalDate format.stringFormat - format of the string.public static Element getElementByName(Element parentElem, String childElemName)
Xml helper function. Gets the first child element with the given name or null. I'm using this instead of XPath because XPath is not available on the .NET Compact Framework.
parentElem - Element object.childElemName - string.public static String getOuterXml(Node node)
node - Node element.public static byte[] stripLeadingZeros(byte[] sourceArray)
sourceArray - byte array.public static InputStream createFileInputStreamBuffered(File file) throws FileNotFoundException
file - input file.FileNotFoundException - if file is not found.public static byte[] decodeFromBase64String(String encoded)
encoded - encoded string.Copyright © 2025 Aspose. All rights reserved.