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 CharsetUTF8_CHARSET
-
Constructor Summary
Constructors Constructor Description IoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareByteArraysEqual(byte[] b1, byte[] b2)static StringasSystemSpecificPath(String urlPath, int colonIndex)static longcopy(InputStream input, OutputStream output)static voidcopyFile(File sourceFile, File destFile)static FilecopyInTempFile(InputStream input, String fileExtension)static intfindPort()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 StringreadFileAsString(File file)static List<String>recursiveListFile(File folder)static List<String>recursiveListFile(File folder, String prefix, Predicate<File> filter)static booleanvalidPort(int port)static voidwrite(File f, byte[] data)static voidwriteBytes(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)
-
-