public final class JarUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MULE_LOCAL_JAR_FILENAME |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendJarFileEntries(File jarFile,
LinkedHashMap entries) |
static void |
createJarFileEntries(File jarFile,
LinkedHashMap entries) |
static File |
getMuleHomeFile() |
static File |
getMuleLibDir() |
static File |
getMuleLocalJarFile() |
static File |
getMuleModuleDir() |
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(File jarFile,
String filePath)
Loads the content of a file within a jar into a byte array.
|
static Optional<byte[]> |
loadFileContentFrom(URL jarFile)
Loads the content of a file within a jar into a byte array.
|
static LinkedHashMap |
readJarFileEntries(File jarFile) |
public static final String MULE_LOCAL_JAR_FILENAME
public static Optional<byte[]> loadFileContentFrom(File jarFile, String filePath) throws IOException
jarFile - the jar filefilePath - the path to the file within the jar fileIOException - if there was a problem reading from the jar file.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.IOExceptionpublic static LinkedHashMap readJarFileEntries(File jarFile) throws Exception
Exceptionpublic static void appendJarFileEntries(File jarFile, LinkedHashMap entries) throws Exception
Exceptionpublic static void createJarFileEntries(File jarFile, LinkedHashMap entries) throws Exception
Exceptionpublic static File getMuleHomeFile()
public static File getMuleLibDir()
public static File getMuleModuleDir()
public static File getMuleLocalJarFile()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.