Package org.xhtmlrenderer.util
Class IOUtil
- java.lang.Object
-
- org.xhtmlrenderer.util.IOUtil
-
@ParametersAreNonnullByDefault public class IOUtil extends Object
- Author:
- patrick
-
-
Constructor Summary
Constructors Constructor Description IOUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(Closeable in)static voidcopyFile(File page, File outputDir)static voiddeleteAllFiles(File dir)static InputStreamgetInputStream(String uri)Gets a Reader for the resource identifiedstatic InputStreamopenStreamAtUrl(String uri)Attempts to open a connection, and a stream, to the URI provided.static byte[]readBytes(InputStream is)static byte[]readBytes(String uri)static byte[]readBytes(Path file)
-
-
-
Method Detail
-
copyFile
public static void copyFile(File page, File outputDir) throws IOException
- Throws:
IOException
-
deleteAllFiles
public static void deleteAllFiles(File dir) throws IOException
- Throws:
IOException
-
openStreamAtUrl
public static 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
@Nullable @CheckReturnValue public static InputStream getInputStream(String uri)
Gets a Reader for the resource identified- Returns:
- The stylesheet value
-
readBytes
@Nullable @CheckReturnValue public static byte[] readBytes(String uri)
-
readBytes
@Nonnull @CheckReturnValue public static byte[] readBytes(Path file) throws IOException
- Throws:
IOException
-
readBytes
@Nonnull @CheckReturnValue public static byte[] readBytes(InputStream is) throws IOException
- Throws:
IOException
-
close
public static void close(@Nullable Closeable in)
-
-