Class Util

java.lang.Object
net.uptheinter.interceptify.util.Util

public final class Util extends Object
General utility class with a few modestly useful functions.
  • Method Details

    • DebugError

      public static void DebugError(Throwable exception)
      Prints an exception's message and stack trace to stderr.
      Parameters:
      exception - The exception to print.
    • toURL

      public static URL toURL(Path path)
      This is a convenience function for trying to convert a Path to a URI.
      Prints to stderr if an exception is thrown.
      Parameters:
      path - A path that you wish to convert into a URL
      Returns:
      a URL generated from the path, or null if it fails.
    • walk

      public static Stream<Path> walk(Path path, int depth)
      It's Files.walk(java.nio.file.Path, int, java.nio.file.FileVisitOption...), but it catches exceptions and logs them.
      Parameters:
      path - same as for Files.walk(Path, int, FileVisitOption...)
      depth - ditto.
      Returns:
      the return value also has the same semantics.