Package org.drools.core.util
Class IoUtils
- java.lang.Object
-
- org.drools.core.util.IoUtils
-
public class IoUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Charset
UTF8_CHARSET
-
Constructor Summary
Constructors Constructor Description IoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areByteArraysEqual(byte[] b1, byte[] b2)
static String
asSystemSpecificPath(String urlPath, int colonIndex)
static long
copy(InputStream input, OutputStream output)
static void
copyFile(File sourceFile, File destFile)
static File
copyInTempFile(InputStream input, String fileExtension)
static int
findPort()
static byte[]
readBytes(File f)
static byte[]
readBytesFromInputStream(InputStream input)
static byte[]
readBytesFromInputStream(InputStream input, boolean closeInput)
static byte[]
readBytesFromZipEntry(File file, ZipEntry entry)
static String
readFileAsString(File file)
static List<String>
recursiveListFile(File folder)
static List<String>
recursiveListFile(File folder, String prefix, Predicate<File> filter)
static boolean
validPort(int port)
static void
write(File f, byte[] data)
static void
writeBytes(File f, byte[] data)
-
-
-
Field Detail
-
UTF8_CHARSET
public static final Charset UTF8_CHARSET
-
-
Method Detail
-
findPort
public static int findPort()
-
validPort
public static boolean validPort(int port)
-
copy
public static long copy(InputStream input, OutputStream output) throws IOException
- Throws:
IOException
-
copyInTempFile
public static File copyInTempFile(InputStream input, String fileExtension) throws IOException
- Throws:
IOException
-
recursiveListFile
public static List<String> recursiveListFile(File folder, String prefix, Predicate<File> filter)
-
readBytesFromInputStream
public static byte[] readBytesFromInputStream(InputStream input) throws IOException
- Throws:
IOException
-
readBytesFromInputStream
public static byte[] readBytesFromInputStream(InputStream input, boolean closeInput) throws IOException
- Throws:
IOException
-
readBytesFromZipEntry
public static byte[] readBytesFromZipEntry(File file, ZipEntry entry) throws IOException
- Throws:
IOException
-
readBytes
public static byte[] readBytes(File f) throws IOException
- Throws:
IOException
-
write
public static void write(File f, byte[] data) throws IOException
- Throws:
IOException
-
writeBytes
public static void writeBytes(File f, byte[] data) throws IOException
- Throws:
IOException
-
areByteArraysEqual
public static boolean areByteArraysEqual(byte[] b1, byte[] b2)
-
-