public class FileUtils
extends java.lang.Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.io.File |
create(java.io.File file,
java.lang.String... parts)
Create a file from a parent file and an array of parts.
|
static java.io.File |
create(java.lang.String... parts)
Create a file from an array of parts.
|
static java.util.List<java.io.File> |
listFiles(java.io.File file)
List all files in a directory recursively.
|
static java.util.List<java.io.File> |
listFiles(java.io.File file,
java.util.function.Predicate<java.io.File> filter)
List all files in a directory recursively.
|
static void |
read(java.io.File file,
java.io.InputStream is)
Read all bytes from a stream and write them to a file.
|
static void |
write(java.io.File file,
java.io.OutputStream os)
Read all bytes from a file and write them to a stream.
|
public static java.io.File create(java.lang.String... parts)
parts - The partspublic static java.io.File create(java.io.File file,
java.lang.String... parts)
file - The parent fileparts - The partspublic static java.util.List<java.io.File> listFiles(java.io.File file)
file - The directory to listjava.io.IOException - If an I/O error occurspublic static java.util.List<java.io.File> listFiles(java.io.File file,
java.util.function.Predicate<java.io.File> filter)
file - The directory to listfilter - The filter to usejava.io.IOException - If an I/O error occurs@WillNotClose
public static void read(java.io.File file,
java.io.InputStream is)
throws java.io.IOException
file - The file to write tois - The stream to read fromjava.io.IOException - If an I/O error occurs@WillNotClose
public static void write(java.io.File file,
java.io.OutputStream os)
throws java.io.IOException
file - The file to read fromos - The stream to write tojava.io.IOException - If an I/O error occurs