Class IOUtil

java.lang.Object
org.xhtmlrenderer.util.IOUtil

public class IOUtil extends Object
  • Constructor Details

    • IOUtil

      public IOUtil()
  • Method Details

    • copyFile

      public static void copyFile(File page, File outputDir) throws IOException
      Throws:
      IOException
    • copyBytes

      private static void copyBytes(InputStream in, OutputStream out) throws IOException
      Throws:
      IOException
    • deleteAllFiles

      public static void deleteAllFiles(File dir) throws IOException
      Throws:
      IOException
    • openStreamAtUrl

      public static @Nullable InputStream openStreamAtUrl(String uri)
      Attempts to open a connection, and a stream, to the URI provided. timeouts will be set for opening the connection and reading from it. will return the stream, or null if unable to open or read or a timeout occurred. Does not buffer the stream.
    • getInputStream

      @CheckReturnValue public static @Nullable InputStream getInputStream(@Nullable String uri)
      Gets a Reader for the resource identified
      Returns:
      The stylesheet value
    • readBytes

      @CheckReturnValue public static byte @Nullable [] readBytes(String uri)
    • readBytes

      @CheckReturnValue public static byte[] readBytes(Path file) throws IOException
      Throws:
      IOException
    • readBytes

      @CheckReturnValue public static byte[] readBytes(InputStream is) throws IOException
      Throws:
      IOException
    • close

      @Deprecated public static void close(@Nullable Closeable in)
      Deprecated.
      Use try-with-resources idiom instead.