public class IoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
NO_CONTENT |
Constructor and Description |
---|
IoUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
copy(File source,
File target) |
static byte[] |
copy(InputStream is,
File target) |
static void |
copyFile(File sourceFile,
File targetFile) |
static void |
copyStream(InputStream is,
OutputStream os)
Copy input stream to output stream without closing streams.
|
static void |
copyStreamAndClose(InputStream is,
OutputStream os)
Copy input stream to output stream and close them both
|
static File |
mkdir(File parent,
String... segments) |
static File |
newFile(File baseDir,
String... segments)
Return a new File object based on the baseDir and the segments.
|
static boolean |
recursiveDelete(File root) |
static void |
safeClose(Closeable closeable) |
static void |
safeClose(ZipFile closeable) |
public static void copyStreamAndClose(InputStream is, OutputStream os) throws IOException
is
- input streamos
- output streamIOException
- for any errorpublic static void copyStream(InputStream is, OutputStream os) throws IOException
is
- input streamos
- output streamIOException
- for any errorpublic static void copyFile(File sourceFile, File targetFile) throws IOException
IOException
public static byte[] copy(InputStream is, File target) throws IOException
IOException
public static byte[] copy(File source, File target) throws IOException
IOException
public static void safeClose(Closeable closeable)
public static void safeClose(ZipFile closeable)
public static boolean recursiveDelete(File root)
public static File mkdir(File parent, String... segments) throws IOException
IOException
Copyright © 2023 JBoss by Red Hat. All rights reserved.