public class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utils.JarFileFilter |
| Modifier and Type | Field and Description |
|---|---|
static String |
JAR_TO_BUNDLE_DIR |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
archiveDir(String destArchive,
String sourceDir)
Archive a directory
|
static void |
clearPrefixedSystemProperties(String prefix,
Map<String,String> targetPropertyMap)
clearPrefixedSystemProperties clears System Properties by writing null properties in
the targetPropertyMap that match a prefix
|
static void |
copyFile(File src,
File dst)
Copies src file to dst file.
|
static void |
copyFileToDir(File src,
File dst)
Copies src file to dst directory.
|
static void |
createBundle(File jarFile,
File bundle,
Manifest manifest)
Create an OSGi bundle out of a JAR file
|
static void |
createBundle(File jarFile,
File targetDir,
Manifest mf,
String extensionPrefix)
Create an OSGi bundle out of a JAR file
|
static boolean |
deleteDir(File dir)
Deletes all files and subdirectories under dir.
|
static void |
extract(String archive,
String extractDir) |
static void |
extractFromStream(InputStream inputStream,
String extractDir) |
static String[] |
getArgs() |
static File |
getBundleConfigDirectory() |
static File |
getBundleDirectory(String bundleDir)
Create & return the bundle directory
|
static File |
getCarbonComponentRepo() |
static String |
getCarbonRepoPath() |
protected static String |
getZipEntryPath(File f,
String archiveSourceDir) |
static Properties |
loadProperties(String filePath)
loadProperties is a convenience method to load properties from a servlet context resource
|
static String |
parseJar(File jarFile) |
static void |
printUsages() |
static String |
searchFor(String target,
String start) |
protected static void |
zipDir(File zipDir,
ZipOutputStream zos,
String archiveSourceDir) |
public static final String JAR_TO_BUNDLE_DIR
public static String getCarbonRepoPath()
public static File getCarbonComponentRepo()
public static void printUsages()
public static String[] getArgs()
public static File getBundleDirectory(String bundleDir)
bundleDir - The relative path of directory which contains the jars to be made into bundlespublic static void createBundle(File jarFile, File targetDir, Manifest mf, String extensionPrefix) throws IOException
jarFile - The jarfile to be bundledtargetDir - The directory into which the created OSGi bundle needs to be placed into.mf - The bundle manifest fileextensionPrefix - Prefix, if any, for the bundleIOException - If an error occurs while reading the jar or creating the bundlepublic static void createBundle(File jarFile, File bundle, Manifest manifest) throws IOException
jarFile - The jarfile to be bundledbundle - The bundle to be createdmanifest - The manifest fileIOException - If an error occurs while reading the jar or creating the bundlepublic static boolean deleteDir(File dir)
public static void archiveDir(String destArchive, String sourceDir) throws IOException
destArchive - sourceDir - IOExceptionprotected static void zipDir(File zipDir, ZipOutputStream zos, String archiveSourceDir) throws IOException
IOExceptionpublic static void copyFileToDir(File src, File dst) throws IOException
IOExceptionpublic static void copyFile(File src, File dst) throws IOException
IOExceptionpublic static void extract(String archive, String extractDir) throws IOException
IOExceptionpublic static void extractFromStream(InputStream inputStream, String extractDir) throws IOException
IOExceptionpublic static String parseJar(File jarFile) throws IOException
jarFile - jar file locationIOException - IOExceptionpublic static File getBundleConfigDirectory()
public static void clearPrefixedSystemProperties(String prefix, Map<String,String> targetPropertyMap)
prefix - prefixtargetPropertyMap - targetPropertyMappublic static Properties loadProperties(String filePath)
filePath - - path to load properties fromCopyright © 2018 WSO2 Inc. All rights reserved.