Class Util

java.lang.Object
com.vaadin.pro.licensechecker.Util

public class Util extends Object
  • Field Details

    • TIMESTAMP_FORMAT

      public static final DateTimeFormatter TIMESTAMP_FORMAT
      A DateTimeFormatter instance 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

      public static String toString(InputStream in) throws IOException
      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

      public static String getHash(String content, byte[] salt, Charset charset)
    • removeTrailingSlash

      public static String removeTrailingSlash(String url)
    • validateURL

      public static String validateURL(String url)
    • 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 a JsonObject. 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 response
      inputStream - the input stream containing the server's response
      Returns:
      a JsonObject parsed from the input stream
      Throws:
      IOException - if an I/O error occurs or if the JSON response cannot be parsed