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