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