-
目录处理工具类 DealWithDir.java
- package com.util;
-
- import java.io.File;
-
- public class DealWithDir {
-
- public static boolean newDir(String path) throws Exception {
- File file = new File(path);
- return file.mkdirs();
- }
-
-
- public static boolean deleteDir(String path) throws Exception {
- File file = new File(path);
- if (!file.exists())
- return false;
- if (file.isFile())
- {
- file.delete();
- return false;
- }
- File[] files = file.listFiles();
- for (int i = 0; i < files.length; i++) {
- deleteDir(files[i].getAbsolutePath());
- }
- file.delete();
-
- return file.delete();
- }
-
-
- public static boolean updateDir(String path, String newPath) throws Exception {
- File file = new File(path);
- File newFile = new File(newPath);
- return file.renameTo(newFile);
- }
-
- public static void main(String d[]) throws Exception{
-
- updateDir("D:\TOOLS\Tomcat 6.0\webapps\BCCCSM\nationalExperiment/22222", "D:\TOOLS\Tomcat 6.0\webapps\BCCCSM\nationalExperiment/224222");
- }
-
-
- }
-
相关阅读:
Mysql高可用MHA
centos7.2 安装mysql5.7.13
keepalived+双主实现数据库的高可用
xtrabackup 完全备份+xtrabacup 增量备份
xtrabackup 进行 MySQL 数据库备份
mysql所有备份与恢复
sysbench压测工具 压测 mysql
查看CPU性能参数(mpstat, iostat, sar、vmstat)等命令详解
脚本
解决 Let’s Encrypt SSL 证书配置错误
-
原文地址:https://www.cnblogs.com/swite/p/5168706.html
Copyright © 2020-2023
润新知