Package org.drools.util
Class FileUtils
- java.lang.Object
-
- org.drools.util.FileUtils
-
public class FileUtils extends java.lang.ObjectUtility to access files
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteDirectory(java.nio.file.Path path)delete a directory and all its contentstatic java.io.FilegetFile(java.lang.String fileName)Retrieve theFileof the given filestatic java.lang.StringgetFileContent(java.lang.String fileName)Retrieve the content of the given filestatic java.io.FileInputStreamgetFileInputStream(java.lang.String fileName)Retrieve theFileInputStreamof the given filestatic java.util.Optional<java.io.InputStream>getInputStreamFromFileNameAndClassLoader(java.lang.String fileName, java.lang.ClassLoader classLoader)
-
-
-
Method Detail
-
getFile
public static java.io.File getFile(java.lang.String fileName)
Retrieve theFileof the given file- Parameters:
fileName-- Returns:
-
getFileInputStream
public static java.io.FileInputStream getFileInputStream(java.lang.String fileName) throws java.io.IOExceptionRetrieve theFileInputStreamof the given file- Parameters:
fileName-- Returns:
- Throws:
java.io.IOException
-
getFileContent
public static java.lang.String getFileContent(java.lang.String fileName) throws java.io.IOExceptionRetrieve the content of the given file- Parameters:
fileName-- Returns:
- Throws:
java.io.IOException
-
getInputStreamFromFileNameAndClassLoader
public static java.util.Optional<java.io.InputStream> getInputStreamFromFileNameAndClassLoader(java.lang.String fileName, java.lang.ClassLoader classLoader)- Parameters:
fileName-classLoader-- Returns:
-
deleteDirectory
public static void deleteDirectory(java.nio.file.Path path)
delete a directory and all its content- Parameters:
path- path to the directory to delete
-
-