public enum IOTools extends Enum<IOTools>
| Modifier and Type | Method and Description |
|---|---|
static void |
clean(ByteBuffer bb) |
static void |
createDirectories(Path dir) |
static Path |
createTempDirectory(String s) |
static File |
createTempFile(String s) |
static boolean |
deleteDirWithFiles(@NotNull File dir) |
static boolean |
deleteDirWithFiles(@NotNull File dir,
int maxDepth) |
static boolean |
deleteDirWithFiles(String... dirs) |
static boolean |
deleteDirWithFiles(@NotNull String dir,
int maxDepth) |
static void |
deleteDirWithFilesOrThrow(File... dirs)
Canonical usage is to call this *before* your test so you fail fast if you can't delete
|
static void |
deleteDirWithFilesOrThrow(String... dirs) |
static InputStream |
open(URL url) |
static byte[] |
readAsBytes(InputStream is) |
static byte[] |
readFile(Class clazz,
@NotNull String name) |
static byte[] |
readFile(@NotNull String name)
This method first looks for the file in the classpath.
|
static boolean |
shallowDeleteDirWithFiles(@NotNull File dir) |
static boolean |
shallowDeleteDirWithFiles(@NotNull String directory) |
static @NotNull String |
tempName(@NotNull String filename) |
static void |
unmonitor(Object t) |
static @NotNull URL |
urlFor(ClassLoader classLoader,
String name) |
static @NotNull URL |
urlFor(Class clazz,
String name) |
static URL |
urlFor(String name)
Deprecated.
|
static IOTools |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IOTools[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static void |
writeFile(@NotNull String filename,
@NotNull byte[] bytes) |
public static IOTools[] values()
for (IOTools c : IOTools.values()) System.out.println(c);
public static IOTools valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static boolean shallowDeleteDirWithFiles(@NotNull
@NotNull String directory)
throws IORuntimeException
IORuntimeExceptionpublic static boolean shallowDeleteDirWithFiles(@NotNull
@NotNull File dir)
throws IORuntimeException
IORuntimeExceptionpublic static boolean deleteDirWithFiles(@NotNull
String... dirs)
throws IORuntimeException
IORuntimeExceptionpublic static boolean deleteDirWithFiles(@NotNull
@NotNull String dir,
int maxDepth)
throws IORuntimeException
IORuntimeExceptionpublic static boolean deleteDirWithFiles(@NotNull
@NotNull File dir)
throws IORuntimeException
IORuntimeExceptionpublic static boolean deleteDirWithFiles(@NotNull
@NotNull File dir,
int maxDepth)
throws IORuntimeException
IORuntimeExceptionpublic static void deleteDirWithFilesOrThrow(@NotNull
String... dirs)
throws IORuntimeException
IORuntimeExceptionpublic static void deleteDirWithFilesOrThrow(@NotNull
File... dirs)
throws IORuntimeException
dirs - dirsIORuntimeException@Deprecated public static URL urlFor(String name) throws FileNotFoundException
FileNotFoundException@NotNull public static @NotNull URL urlFor(Class clazz, String name) throws FileNotFoundException
FileNotFoundException@NotNull public static @NotNull URL urlFor(ClassLoader classLoader, String name) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream open(URL url) throws IOException
IOExceptionpublic static byte[] readFile(@NotNull
@NotNull String name)
throws IOException
name - Name of the fileIOException - FileNotFoundException thrown if file is not foundpublic static byte[] readFile(Class clazz, @NotNull @NotNull String name) throws IOException
IOExceptionpublic static byte[] readAsBytes(InputStream is) throws IOException
IOExceptionpublic static void writeFile(@NotNull
@NotNull String filename,
@NotNull
@NotNull byte[] bytes)
throws IOException
IOExceptionpublic static void clean(ByteBuffer bb)
public static void createDirectories(Path dir) throws IOException
IOExceptionpublic static void unmonitor(Object t)
Copyright © 2020. All rights reserved.