Class FileUtils
- java.lang.Object
-
- org.activiti.cloud.services.common.util.FileUtils
-
public class FileUtils extends Object
Utils for handling files
-
-
Constructor Summary
Constructors Constructor Description FileUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClassLoaderclassLoader()Get current class loaderstatic byte[]resourceAsByteArray(String path)Get classpath resource as byte arraystatic Optional<File>resourceAsFile(String name)Get classpath resource as filestatic Optional<InputStream>resourceAsStream(String name)Get classpath resource as file
-
-
-
Method Detail
-
resourceAsByteArray
public static byte[] resourceAsByteArray(String path) throws IOException
Get classpath resource as byte array- Parameters:
path- the path of the resource- Returns:
- the byte array of the resource
- Throws:
IOException- if the resource cannot be read
-
resourceAsFile
public static Optional<File> resourceAsFile(String name)
Get classpath resource as file- Parameters:
name- the name of the resource- Returns:
- the resource file, or
Optional.EMPTY
-
resourceAsStream
public static Optional<InputStream> resourceAsStream(String name)
Get classpath resource as file- Parameters:
name- the name of the resource- Returns:
- the resource file, or
Optional.EMPTY
-
classLoader
public static ClassLoader classLoader()
Get current class loader- Returns:
- the current class loader
-
-