All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tgtools.tasklibrary.tasks.DelDirFilesTask Maven / Gradle / Ivy

There is a newer version: 0.1.12
Show newest version
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy