public class FileUtils extends Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<URL> |
getUrlsWithinJar(File file,
String directory)
Gets all the URL of files within a directory
|
static URL |
getUrlWithinJar(File jarFile,
String filePath)
Creates an URL to a path within a jar file.
|
static Optional<byte[]> |
loadFileContentFrom(URL jarFile)
Loads the content of a file within a jar into a byte array.
|
public static Optional<byte[]> loadFileContentFrom(URL jarFile) throws IOException
jarFile - the jar fileIOException - if there was a problem reading from the jar file.public static URL getUrlWithinJar(File jarFile, String filePath) throws MalformedURLException
jarFile - the jar filefilePath - the path within the jar filefilePath within the jarFileMalformedURLException - if the provided filePath is malformedpublic static List<URL> getUrlsWithinJar(File file, String directory) throws IOException
file - the jar filedirectory - the directory within the jar filedirectory. Empty collection if the directory does not
exists or is empty.IOExceptionCopyright © 2025 MuleSoft, Inc.. All rights reserved.