Class FileUtils
java.lang.Object
org.mule.maven.client.internal.util.FileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUrlsWithinJar(File file, String directory) Gets all the URL of files within a directorystatic URLgetUrlWithinJar(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.
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
loadFileContentFrom
Loads the content of a file within a jar into a byte array.- Parameters:
jarFile- the jar file- Returns:
- the content of the file as byte array or empty if the file does not exists within the jar file.
- Throws:
IOException- if there was a problem reading from the jar file.
-
getUrlWithinJar
Creates an URL to a path within a jar file.- Parameters:
jarFile- the jar filefilePath- the path within the jar file- Returns:
- an URL to the
filePathwithin thejarFile - Throws:
MalformedURLException- if the providedfilePathis malformed
-
getUrlsWithinJar
Gets all the URL of files within a directory- Parameters:
file- the jar filedirectory- the directory within the jar file- Returns:
- a collection of URLs to files within the directory
directory. Empty collection if the directory does not exists or is empty. - Throws:
IOException
-