⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check.java

📁 用来下载网上图片
💻 JAVA
字号:
package downLoadImage;
import java.io.File;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Check {
  public static boolean isDigit(String s){
	  if(s==null||s.equals(""))
		  return false;
	  String str="[0-9]+";
	  return Pattern.matches(str, s);
  }
  
  public static boolean isRealDigit(String s){
        try{
           Integer.parseInt(s);
        }catch(Exception e){
        	return false;
        }
        return true;
}

  public static boolean isWord(String s){
      if(s==null)
    	  return false;
      String str="[a-zA-Z0-9]*";
      return Pattern.matches(str, s);
}
  
  public static boolean isTel(String s){
	  if(s==null)
		  return false;
	  String str="[0-9]+(-)?[0-9]+";
	  return Pattern.matches(str, s);
  }
  public static boolean isEmpty(String s){
	  if(s==null)
		  return false;
	  else if(s.equals("")||s.trim().equals(""))
		  return false;
	  else
		  return true;

  }


  public static boolean isTrue(String s){
	  if(s==null||s.equals(""))
		  return false;
	  else
		  return s.equals("true")||s.equals("TRUE");
  }
  
  public static boolean isPage(String s){
	  if(s==null||s.equals(""))
		  return false;
	  else{
		  
		  String str="^http://[^\\s]+/?";
	      return Pattern.matches(str, s);
	      
	  }
  }
  
  public static boolean isWeb(String s){
	  if(s==null||s.equals(""))
		  return false;
	  else{
		  
		  String str="^http://[^\\s]+/?";
	      return Pattern.matches(str, s);
	      
	  }
  }
  
  
  public static boolean checkSavePathExists(){
		File f=new File(WebInfo.SavePath);
		if(!f.exists()){
			return f.mkdir();
		}
		return true;
	}	
  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -