KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > snapper > utils > Utils


1 package org.enhydra.snapper.utils;
2
3
4 public class Utils {
5
6     public static boolean isText(String JavaDoc link) {
7         String JavaDoc 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 JavaDoc link) {
18         String JavaDoc 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 JavaDoc link) {
25         String JavaDoc lowerLink = link.toLowerCase();
26         if (lowerLink.endsWith(".doc"))
27             return true;
28         else
29             return false;
30     }
31     
32     public static boolean isExcel(String JavaDoc link) {
33         String JavaDoc lowerLink = link.toLowerCase();
34         if (lowerLink.endsWith(".xls"))
35             return true;
36         else
37             return false;
38     }
39     
40     public static boolean isPPt(String JavaDoc link) {
41         String JavaDoc lowerLink = link.toLowerCase();
42         if (lowerLink.endsWith(".ppt"))
43             return true;
44         else
45             return false;
46     }
47     
48     public static boolean isHTML(String JavaDoc link) {
49         String JavaDoc 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 JavaDoc link) {
57         String JavaDoc lowerLink = link.toLowerCase();
58         if (lowerLink.endsWith(".rtf"))
59             return true;
60         else
61             return false;
62     }
63     
64     public static boolean isPDF(String JavaDoc link) {
65         String JavaDoc lowerLink = link.toLowerCase();
66         if (lowerLink.endsWith(".pdf"))
67             return true;
68         else
69             return false;
70     }
71     
72     public static boolean isMSG(String JavaDoc link) {
73         String JavaDoc lowerLink = link.toLowerCase();
74         if (lowerLink.endsWith(".msg"))
75             return true;
76         else
77             return false;
78     }
79     
80     public static boolean isPPT(String JavaDoc link) {
81         String JavaDoc lowerLink = link.toLowerCase();
82         if (lowerLink.endsWith(".ppt"))
83             return true;
84         else
85             return false;
86     }
87     
88     public static boolean isPPS(String JavaDoc link) {
89         String JavaDoc lowerLink = link.toLowerCase();
90         if (lowerLink.endsWith(".pps"))
91             return true;
92         else
93             return false;
94     }
95     
96     public static boolean isEML(String JavaDoc link) {
97         String JavaDoc lowerLink = link.toLowerCase();
98         if (lowerLink.endsWith(".eml"))
99             return true;
100         else
101             return false;
102     }
103     
104     public static boolean isZIP(String JavaDoc link) {
105         String JavaDoc lowerLink = link.toLowerCase();
106         if (lowerLink.endsWith(".zip"))
107             return true;
108         else
109             return false;
110     }
111     
112     // etc
113
}
Popular Tags