1 package org.enhydra.snapper.utils; 2 3 4 public class Utils { 5 6 public static boolean isText(String link) { 7 String lowerLink = link.toLowerCase(); 8 if ((lowerLink.endsWith(".java")) || (lowerLink.endsWith(".txt")) 9 || (lowerLink.endsWith(".ini"))) 10 return true; 11 else 12 return false; 13 14 } 15 16 17 public static boolean isOO(String link) { 18 String lowerLink = link.toLowerCase(); 19 if (lowerLink.endsWith(".sxc") || (lowerLink.endsWith(".sxw"))) 20 return true; 21 else 22 return false; 23 } 24 public static boolean isDoc(String link) { 25 String lowerLink = link.toLowerCase(); 26 if (lowerLink.endsWith(".doc")) 27 return true; 28 else 29 return false; 30 } 31 32 public static boolean isExcel(String link) { 33 String lowerLink = link.toLowerCase(); 34 if (lowerLink.endsWith(".xls")) 35 return true; 36 else 37 return false; 38 } 39 40 public static boolean isPPt(String link) { 41 String lowerLink = link.toLowerCase(); 42 if (lowerLink.endsWith(".ppt")) 43 return true; 44 else 45 return false; 46 } 47 48 public static boolean isHTML(String link) { 49 String lowerLink = link.toLowerCase(); 50 if (lowerLink.endsWith(".html") || lowerLink.endsWith(".htm")) 51 return true; 52 else 53 return false; 54 } 55 56 public static boolean isRTF(String link) { 57 String lowerLink = link.toLowerCase(); 58 if (lowerLink.endsWith(".rtf")) 59 return true; 60 else 61 return false; 62 } 63 64 public static boolean isPDF(String link) { 65 String lowerLink = link.toLowerCase(); 66 if (lowerLink.endsWith(".pdf")) 67 return true; 68 else 69 return false; 70 } 71 72 public static boolean isMSG(String link) { 73 String lowerLink = link.toLowerCase(); 74 if (lowerLink.endsWith(".msg")) 75 return true; 76 else 77 return false; 78 } 79 80 public static boolean isPPT(String link) { 81 String lowerLink = link.toLowerCase(); 82 if (lowerLink.endsWith(".ppt")) 83 return true; 84 else 85 return false; 86 } 87 88 public static boolean isPPS(String link) { 89 String lowerLink = link.toLowerCase(); 90 if (lowerLink.endsWith(".pps")) 91 return true; 92 else 93 return false; 94 } 95 96 public static boolean isEML(String link) { 97 String lowerLink = link.toLowerCase(); 98 if (lowerLink.endsWith(".eml")) 99 return true; 100 else 101 return false; 102 } 103 104 public static boolean isZIP(String link) { 105 String lowerLink = link.toLowerCase(); 106 if (lowerLink.endsWith(".zip")) 107 return true; 108 else 109 return false; 110 } 111 112 } | Popular Tags |