Package org.wso2.maven.p2.generate.utils
Class FileManagementUtil
java.lang.Object
org.wso2.maven.p2.generate.utils.FileManagementUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddAnotherNodeToPath(String currentPath, String newNode) static StringaddNodesToPath(StringBuffer currentPath, String[] pathNodes) static StringaddNodesToPath(String currentPath, String[] newNode) static StringaddNodesToURL(String currentPath, String[] newNode) static voidchangeConfigIniProperty(File configIniFile, String propKey, String value) static voidstatic voidcopyDirectory(File srcDir, File dstDir) static voidcopyDirectory(File srcPath, File dstPath, List filesToBeCopied) static voidstatic booleancreateDirectory(String directory) static booleancreateDirectorys(String directory) static FilecreateFileAndParentDirectories(String fileName) static voidcreateTargetFile(String sourceFileName, String targetFileName) static voidcreateTargetFile(String sourceFileName, String targetFileName, boolean overwrite) static booleanstatic voiddeleteDirectories(File dir) static voiddeleteDirectories(String dir) static voidfilterOutRestrictedFiles(String sourceDir, String fileNamePrefix, String extension) Filter out files inside asourceDirwith matchingand extensionstatic ListgetAllFilesPresentInFolder(File srcPath) static File[]getMatchingFiles(String sourceDir, String fileNamePrefix, String extension) Get the list of file with a prefix offileNamePrefix& an extension ofextensionstatic FilegetProfileConfigIniFile(String destination, String profile) static voidremoveEmptyDirectories(File srcPath) static voidstatic void
-
Constructor Details
-
FileManagementUtil
public FileManagementUtil()
-
-
Method Details
-
getProfileConfigIniFile
- Parameters:
destination-profile-- Returns:
- the config.ini file for the Profile
-
changeConfigIniProperty
-
copyDirectory
public static void copyDirectory(File srcPath, File dstPath, List filesToBeCopied) throws IOException - Throws:
IOException
-
getAllFilesPresentInFolder
-
removeEmptyDirectories
-
zipFolder
-
copyFile
-
createFileAndParentDirectories
- Throws:
Exception
-
deleteDir
-
deleteDirectories
-
deleteDirectories
-
createTargetFile
- Throws:
Exception
-
createTargetFile
public static void createTargetFile(String sourceFileName, String targetFileName, boolean overwrite) throws Exception - Throws:
Exception
-
createDirectory
-
createDirectorys
-
copyDirectory
- Throws:
IOException
-
copy
- Throws:
IOException
-
addAnotherNodeToPath
-
addNodesToPath
-
addNodesToPath
-
addNodesToURL
-
getMatchingFiles
Get the list of file with a prefix offileNamePrefix& an extension ofextension- Parameters:
sourceDir- The directory in which to search the filesfileNamePrefix- The prefix to look forextension- The extension to look for- Returns:
- The list of file with a prefix of
fileNamePrefix& an extension ofextension
-
filterOutRestrictedFiles
public static void filterOutRestrictedFiles(String sourceDir, String fileNamePrefix, String extension) Filter out files inside asourceDirwith matchingand extension- Parameters:
sourceDir- The directory to filter the filesfileNamePrefix- The filtering filename prefixextension- The filtering file extension
-
unzip
- Throws:
Exception
-