|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.server.util.Utils
public class Utils
| Nested Class Summary | |
|---|---|
static class |
Utils.JarFileFilter
|
| Field Summary | |
|---|---|
static String |
JAR_TO_BUNDLE_DIR
|
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String JAR_TO_BUNDLE_DIR
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static String getCarbonRepoPath()
public static File getCarbonComponentRepo()
public static void printUsages()
public static String searchFor(String target,
String start)
public static String[] getArgs()
public static File getBundleDirectory(String bundleDir)
bundleDir - The relative path of directory which contains the jars to be made into bundles
public 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 bundle
IOException - If an error occurs while reading the jar or creating the bundle
public static void createBundle(File jarFile,
File bundle,
Manifest manifest)
throws IOException
jarFile - The jarfile to be bundledbundle - The bundle to be createdmanifest - The manifest file
IOException - 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 -
IOException
protected static void zipDir(File zipDir,
ZipOutputStream zos,
String archiveSourceDir)
throws IOException
IOException
protected static String getZipEntryPath(File f,
String archiveSourceDir)
public static void copyFileToDir(File src,
File dst)
throws IOException
IOException
public static void copyFile(File src,
File dst)
throws IOException
IOException
public static void extract(String archive,
String extractDir)
throws IOException
IOException
public static void extractFromStream(InputStream inputStream,
String extractDir)
throws IOException
IOException
public static String parseJar(File jarFile)
throws IOException
jarFile - jar file location
IOException - 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 from
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||