Class StdLib

java.lang.Object
edu.suffolk.litlab.efspserver.StdLib

public class StdLib extends Object
Things that really should just be in the standard lib.
  • Constructor Details

    • StdLib

      public StdLib()
  • Method Details

    • strFromException

      public static String strFromException(Exception ex)
      Adds the stack trace to an exception. Default exception strings don't contain enough info to track down errors.
    • GetEnv

      public static Optional<String> GetEnv(String envVarName)
      Quick wrapper to get an env var as an optional.
    • exists

      public static boolean exists(String val)
      A simple check to make sure something isn't null or blank. Used in a lot of places.
    • closeQuitely

      public static void closeQuitely(XMLStreamReader xsr)
      A way to close a stream without throwing another checked exception, which avoids having to read lots of nested try-catch blocks in business code.