public class FolderPath extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 限定符和类型 | 类和说明 |
|---|---|
static class |
FolderPath.Config_getFileList
getFileList 配置
|
| 构造器和说明 |
|---|
FolderPath() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
createDirs(String path)
创建多级目录
|
static File |
createNewFolderName(File folder)
判断一个新文件夹是否存在。
|
static boolean |
deleteDirectory(String sPath)
删除目录(文件夹)以及目录下的文件
|
static boolean |
deleteFile(String sPath)
删除单个文件
|
static boolean |
DeleteFolder(String sPath)
根据路径删除指定的目录或文件,无论存在与否
|
static void |
deleteOnExit(Path path)
退出时删除文件夹
|
static void |
folderName_(File folder)
文件夹下面文件名包含-的转成_
|
static String |
getAbsolutePath(File file)
返回文件所在路径 不包括文件
|
static String |
getFileFormat(File file)
获取 文件格式
|
static List<File> |
getFileList(String strPath,
FolderPath.Config_getFileList config)
获取目录下所有文件
|
static boolean |
isexitsPath(String path)
返回是否创建目录 并创建目录
|
static boolean |
isexitsPathh(String path)
返回是否创建目录 并创建目录,最后一层文件夹设置为隐藏属性
|
public static boolean isexitsPath(String path) throws InterruptedException, IOException
public static boolean isexitsPathh(String path) throws InterruptedException, IOException
public static boolean DeleteFolder(String sPath)
sPath - 要删除的目录或文件public static boolean deleteFile(String sPath)
sPath - 被删除文件的文件名public static boolean deleteDirectory(String sPath)
sPath - 被删除目录的文件路径public static void deleteOnExit(Path path)
path - public static File createNewFolderName(File folder)
folder - public static void folderName_(File folder)
folder - public static void createDirs(String path)
path - public static List<File> getFileList(String strPath, FolderPath.Config_getFileList config)
strPath - 第一级目录config - 配置Copyright © 2020. All rights reserved.