tgtools.tasklibrary.tasks.DelDirFilesTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tgtools.tasklibrary Show documentation
Show all versions of tgtools.tasklibrary Show documentation
base tgtools.tasklibrary task tools
package tgtools.tasklibrary.tasks;
import tgtools.tasklibrary.util.LogHelper;
import tgtools.tasks.Task;
import tgtools.tasks.TaskContext;
import tgtools.util.FileUtil;
import java.io.File;
/**
* 删除目录
*/
public class DelDirFilesTask extends Task {
public DelDirFilesTask(String p_Dir)
{
dir=p_Dir;
}
private String dir;
@Override
protected boolean canCancel() {
return false;
}
@Override
public void run(TaskContext taskContext) {
try{
String[] strs= FileUtil.listFiles(dir,null);
if(null!=strs&&strs.length>0)
{
for(int i=0;i