public class IoUtils extends Object
| Constructor and Description |
|---|
IoUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(OutputStream out,
InputStream in) |
static Path |
copy(Path source,
Path target) |
static void |
createOrEmptyDir(Path dir)
Creates a new empty directory or empties an existing one.
|
static Path |
createRandomDir(Path parentDir) |
static Path |
createRandomTmpDir() |
static Path |
createTmpDir(String name) |
static Path |
mkdirs(Path dir) |
static String |
readFile(Path file) |
static void |
recursiveDelete(Path root) |
static void |
writeFile(Path file,
String content) |
public static Path createRandomTmpDir()
public static void recursiveDelete(Path root)
public static void createOrEmptyDir(Path dir) throws IOException
dir - directoryIOException - in case of a failurepublic static Path copy(Path source, Path target) throws IOException
IOExceptionpublic static String readFile(Path file) throws IOException
IOExceptionpublic static void copy(OutputStream out, InputStream in) throws IOException
IOExceptionpublic static void writeFile(Path file, String content) throws IOException
IOExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.