public class FileManagementUtil extends Object
| Constructor and Description |
|---|
FileManagementUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
changeConfigIniProperty(File configIniFile,
String propKey,
String value,
org.apache.maven.plugin.logging.Log log)
Updated the given config.ini file with a given key value pair.
|
static void |
copy(File src,
File dst)
Copies src file to dst file.
|
static void |
copyDirectory(File srcDir,
File dstDir)
Copies all files under srcDir to dstDir.
|
static void |
deleteDirectories(File dir)
Delete a given directory.
|
static File |
getProfileConfigIniFile(String destination,
String profile)
For a given location and the profile, returns the File object represented by config.ini
|
static void |
unzip(File archiveFile,
File destination)
Unzip a given archive to a given destination
|
static void |
zipFolder(String srcFolder,
String destZipFile,
org.apache.maven.plugin.logging.Log log)
Zip a give folder to a give output zip file.
|
public static File getProfileConfigIniFile(String destination, String profile)
destination - path pointing the [carbon product]/repository/components folderprofile - name of the profilepublic static void changeConfigIniProperty(File configIniFile, String propKey, String value, org.apache.maven.plugin.logging.Log log)
configIniFile - File object representing the config.inipropKey - property keyvalue - property valuelog - Logger to log any warningspublic static void zipFolder(String srcFolder, String destZipFile, org.apache.maven.plugin.logging.Log log)
srcFolder - source folderdestZipFile - path to the output zip filelog - Logger to log any warningspublic static void deleteDirectories(File dir) throws IOException
dir - directory to be deletedIOException - throws when fail to delete a given directorypublic static void copyDirectory(File srcDir, File dstDir) throws IOException
srcDir - source directorydstDir - destination directoryIOException - throws when fail to create the directory structure when copying filespublic static void copy(File src, File dst) throws IOException
src - source filedst - destination fileIOException - throws when fail to copy a given filepublic static void unzip(File archiveFile, File destination) throws IOException
archiveFile - archive file to be unzippeddestination - location to put the unzipped fileIOException - throws when fail to create the directory structure when unzipping a file.Copyright © 2015 WSO2. All rights reserved.