public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copyToFile(InputStream in,
File file)
Writes bytes from the specified inputStream to output stream.
|
static boolean |
createNewFile(File file)
Create new file.
|
static boolean |
exists(File file)
Tests in privileged mode whether the file or directory denoted by this
abstract pathname exists.
|
static boolean |
mkdirs(File file)
Creates the directory in privileged mode.
|
static byte[] |
readBytes(InputStream in)
Reads bytes of data from the input stream into an array of bytes.
|
static void |
writeFile(File file,
byte[] buf)
Writes bytes from byte array to output stream.
|
public static boolean createNewFile(File file) throws IOException
file - new fileIOException - Signals that an I/O exception of some sort has
occurred.public static boolean exists(File file)
file - filepublic static boolean mkdirs(File file)
file - new directory to createpublic static byte[] readBytes(InputStream in) throws IOException
in - InputStreamIOException - signals that an I/O exception of some sort has
occurred.public static void copyToFile(InputStream in, File file) throws IOException
in - InputStreamfile - fileIOException - signals that an I/O exception of some sort has
occurred.public static void writeFile(File file, byte[] buf) throws IOException
buf - byte arrayfile - fileIOException - signals that an I/O exception of some sort has
occurred.Copyright © 2003–2019 eXo Platform SAS. All rights reserved.