ftp
来源:互联网 发布:信诺尔软件 编辑:程序博客网 时间:2024/06/07 22:32
public static boolean deleteDir(String fileName,String modId){
Map map = commonConfJdbcDao.getFtpConfig(modId);
if(map == null || map.size() < 1){
return false;
}
String ip = map.get("ip") == null ? "" : map.get("ip").toString();
String account = map.get("account") == null ? "" : map.get("account").toString();
String password = map.get("password") == null ? "" : map.get("password").toString();
String path_root = map.get("path_root") == null ? "" : map.get("path_root").toString();
if( "".equals(ip) || "".equals(account) || "".equals(password)){
return false;
}
FtpUtil ftp = new FtpUtil(ip,account,password);
if(!ftp.connectServer()){
return false;
}
boolean flag = ftp.deleteDirectory(path_root + "/" + fileName);
ftp.closeServer();
return flag;
}
/**
* 删除文件夹及文件夹中的文件
* @param fileName
* @param modId
* @return
*/
public static boolean deleteDirAndFile(String fileName,String modId){
Map map = commonConfJdbcDao.getFtpConfig(modId);
if(map == null || map.size() < 1){
return false;
}
String ip = map.get("ip") == null ? "" : map.get("ip").toString();
String account = map.get("account") == null ? "" : map.get("account").toString();
String password = map.get("password") == null ? "" : map.get("password").toString();
String path_root = map.get("path_root") == null ? "" : map.get("path_root").toString();
if( "".equals(ip) || "".equals(account) || "".equals(password)){
return false;
}
try{
ApacheFtpUtil ftp = ApacheFtpUtil.getInstance(ip, 21, account, password);
if(!ftp.isPositive()){
return false;
}
ftp.recursionDele(path_root + "/" + fileName);
}catch(Exception e){
e.printStackTrace();
return false;
}
return true;
}
Map map = commonConfJdbcDao.getFtpConfig(modId);
if(map == null || map.size() < 1){
return false;
}
String ip = map.get("ip") == null ? "" : map.get("ip").toString();
String account = map.get("account") == null ? "" : map.get("account").toString();
String password = map.get("password") == null ? "" : map.get("password").toString();
String path_root = map.get("path_root") == null ? "" : map.get("path_root").toString();
if( "".equals(ip) || "".equals(account) || "".equals(password)){
return false;
}
FtpUtil ftp = new FtpUtil(ip,account,password);
if(!ftp.connectServer()){
return false;
}
boolean flag = ftp.deleteDirectory(path_root + "/" + fileName);
ftp.closeServer();
return flag;
}
/**
* 删除文件夹及文件夹中的文件
* @param fileName
* @param modId
* @return
*/
public static boolean deleteDirAndFile(String fileName,String modId){
Map map = commonConfJdbcDao.getFtpConfig(modId);
if(map == null || map.size() < 1){
return false;
}
String ip = map.get("ip") == null ? "" : map.get("ip").toString();
String account = map.get("account") == null ? "" : map.get("account").toString();
String password = map.get("password") == null ? "" : map.get("password").toString();
String path_root = map.get("path_root") == null ? "" : map.get("path_root").toString();
if( "".equals(ip) || "".equals(account) || "".equals(password)){
return false;
}
try{
ApacheFtpUtil ftp = ApacheFtpUtil.getInstance(ip, 21, account, password);
if(!ftp.isPositive()){
return false;
}
ftp.recursionDele(path_root + "/" + fileName);
}catch(Exception e){
e.printStackTrace();
return false;
}
return true;
}
0 0
- FTP
- ftp
- ftp
- ftp
- ftp
- ftp
- FTP
- FTP
- ftp
- ftp
- ftp
- FTP
- FTP
- FTP
- FTP
- FTP
- ftp
- FTP
- IOS NSArray,NSMutableArray
- ftp
- 欢迎使用CSDN-markdown编辑器
- 查看静态库(.a)是否支持64bit
- AIX 在线扩充文件系统
- ftp
- android:inputType参数类型说明
- libevent源码阅读笔记——通用时间队列
- Linux LCD驱动(三)--图形显示
- 结束所有相同名称的进程如conhost.exe
- golang测试技术
- 为什么libevent 放弃红黑树选择小根堆
- PackageManager queryIntentActivities查找不全的解决方法
- 时间对话框。。。datePickerDialog&timePickerDialog