public class FileManagementUtil extends Object
| Constructor and Description |
|---|
FileManagementUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addAnotherNodeToPath(String currentPath,
String newNode) |
static String |
addNodesToPath(StringBuffer currentPath,
String[] pathNodes) |
static String |
addNodesToPath(String currentPath,
String[] newNode) |
static String |
addNodesToURL(String currentPath,
String[] newNode) |
static void |
copy(File src,
File dst) |
static void |
copyDirectory(File srcDir,
File dstDir) |
static void |
copyDirectory(File srcPath,
File dstPath,
List filesToBeCopied) |
static void |
copyFile(String src,
String dest) |
static boolean |
createDirectory(String directory) |
static boolean |
createDirectorys(String directory) |
static File |
createFileAndParentDirectories(String fileName) |
static void |
createTargetFile(String sourceFileName,
String targetFileName) |
static void |
createTargetFile(String sourceFileName,
String targetFileName,
boolean overwrite) |
static boolean |
deleteDir(File dir) |
static void |
deleteDirectories(File dir) |
static void |
deleteDirectories(String dir) |
static void |
filterOutRestrictedFiles(String sourceDir,
String fileNamePrefix,
String extension)
Filter out files inside a
sourceDir with matching extension |
static List |
getAllFilesPresentInFolder(File srcPath) |
static File[] |
getMatchingFiles(String sourceDir,
String fileNamePrefix,
String extension)
Get the list of file with a prefix of
fileNamePrefix & an extension of
extension |
static void |
removeEmptyDirectories(File srcPath) |
static void |
unzip(File archiveFile,
File destination) |
static void |
zipFolder(String srcFolder,
String destZipFile) |
public static void copyDirectory(File srcPath, File dstPath, List filesToBeCopied) throws IOException
IOExceptionpublic static void removeEmptyDirectories(File srcPath)
public static File createFileAndParentDirectories(String fileName) throws Exception
Exceptionpublic static boolean deleteDir(File dir)
public static void deleteDirectories(File dir)
public static void deleteDirectories(String dir)
public static void createTargetFile(String sourceFileName, String targetFileName) throws Exception
Exceptionpublic static void createTargetFile(String sourceFileName, String targetFileName, boolean overwrite) throws Exception
Exceptionpublic static boolean createDirectory(String directory)
public static boolean createDirectorys(String directory)
public static void copyDirectory(File srcDir, File dstDir) throws IOException
IOExceptionpublic static void copy(File src, File dst) throws IOException
IOExceptionpublic static String addNodesToPath(StringBuffer currentPath, String[] pathNodes)
public static File[] getMatchingFiles(String sourceDir, String fileNamePrefix, String extension)
fileNamePrefix & an extension of
extensionsourceDir - The directory in which to search the filesfileNamePrefix - The prefix to look forextension - The extension to look forfileNamePrefix & an extension of
extensionpublic static void filterOutRestrictedFiles(String sourceDir, String fileNamePrefix, String extension)
sourceDir with matching extensionsourceDir - The directory to filter the filesfileNamePrefix - The filtering filename prefixextension - The filtering file extensionCopyright © 2024 WSO2. All rights reserved.