Skip to content

Commit

Permalink
FileUtil增加方法
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed May 25, 2017
1 parent 3ede9c5 commit 79b6b78
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;

import com.xinyi.czbasedevtool.base.interfaces.listener.OnTaskDoneListener;
import com.xinyi.czbasedevtool.base.manager.SystemStaticInstanceManager;
Expand Down Expand Up @@ -56,6 +57,20 @@ private FileUtil(){
ExceptionUtil.throwRunmtimeExcpetionInPrivateConstructor(FileUtil.class);
}

/**
* 文件是否合法,微信热补丁。
* @param file
* @return
*/
public static boolean isLegalFile(File file) {
boolean c1 = file != null;
boolean c2 = file.exists();
boolean c3 = file.canRead();
boolean c4 = file.isFile();
long c5 = file.length();
Log.d(TAG, "isLegalFile: " + c1 + "," + c2 + "," + c3 + "," + c4 + "," + c5);
return c1 && c2 && c3 && c4 && c5 > 0;
}

//文件读写操作
/**
Expand Down

0 comments on commit 79b6b78

Please sign in to comment.