package com.tencent.mm.util;

import java.util.Iterator;

/**
 * Created by sun on 1/9/16.
 */
public class Utils {
    public static boolean isPresent(String str) {
        return str != null && str.length() > 0;
    }

    public static boolean isBlank(String str) {
        return !isPresent(str);
    }

    public static boolean isPresent(Iterator iterator) {
        return iterator != null && iterator.hasNext();
    }

    public static boolean isBlank(Iterator iterator) {
        return !isPresent(iterator);
    }

    public static String convetToPatternString(String input) {
        //将.换成\\.
        if (input.contains(".")) {
            input = input.replaceAll("\\.", "\\\\.");
        }
        //将？换成.,将*换成.*
        if (input.contains("?")) {
            input = input.replaceAll("\\?", "\\.");
        }
        if (input.contains("*")) {
            input = input.replace("*", ".+");
        }
        return input;
    }
}

@@ -23,16 +23,37 @@
 .util;%0A%0A
+import java.io.File;%0A
 import j
@@ -958,11 +958,168 @@
 t;%0A    %7D
+%0A%0A    public static void cleanDir(File dir) %7B%0A        if (dir.exists()) %7B%0A            FileOperation.deleteDir(dir);%0A            dir.mkdirs();%0A        %7D%0A    %7D
 %0A%7D%0A

add clean dir in utils