Package com.vaadin.pro.licensechecker
Class Util
java.lang.Object
com.vaadin.pro.licensechecker.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final DateTimeFormatterADateTimeFormatterinstance defining a standardized format for timestamps accepted by License Server. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longcopyLarge(InputStream input, OutputStream output, byte[] buffer) From commons-io IOUtils.static Stringstatic elemental.json.JsonObjectparseJson(int status, InputStream inputStream) Parses a JSON response from an input stream and converts it into aJsonObject.static Stringstatic StringtoString(InputStream in) static StringvalidateURL(String url)
-
Field Details
-
TIMESTAMP_FORMAT
ADateTimeFormatterinstance defining a standardized format for timestamps accepted by License Server. This format is based on the ISO-8601 standard and enforced to use UTC as the time zone. Format Details: - Pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'" - Time Zone: UTC -
EOF
public static final int EOF- See Also:
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
toString
- Throws:
IOException
-
copyLarge
public static long copyLarge(InputStream input, OutputStream output, byte[] buffer) throws IOException From commons-io IOUtils. Included to avoid external dependencies.- Throws:
IOException
-
getHash
-
removeTrailingSlash
-
validateURL
-
parseJson
public static elemental.json.JsonObject parseJson(int status, InputStream inputStream) throws IOException Parses a JSON response from an input stream and converts it into aJsonObject. Handles errors gracefully and ensures that certain server errors do not propagate sensitive information to the client application.- Parameters:
status- the HTTP status code of the server responseinputStream- the input stream containing the server's response- Returns:
- a
JsonObjectparsed from the input stream - Throws:
IOException- if an I/O error occurs or if the JSON response cannot be parsed
-