001: /*
002: * $Header: /cvsroot/mvnforum/myvietnam/src/net/myvietnam/mvncore/info/LibInfo.java,v 1.14 2007/09/13 03:52:09 tbtrung Exp $
003: * $Author: tbtrung $
004: * $Revision: 1.14 $
005: * $Date: 2007/09/13 03:52:09 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding MyVietnam and MyVietnam CoreLib
012: * MUST remain intact in the scripts and source code.
013: *
014: * This library is free software; you can redistribute it and/or
015: * modify it under the terms of the GNU Lesser General Public
016: * License as published by the Free Software Foundation; either
017: * version 2.1 of the License, or (at your option) any later version.
018: *
019: * This library is distributed in the hope that it will be useful,
020: * but WITHOUT ANY WARRANTY; without even the implied warranty of
021: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
022: * Lesser General Public License for more details.
023: *
024: * You should have received a copy of the GNU Lesser General Public
025: * License along with this library; if not, write to the Free Software
026: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
027: *
028: * Correspondence and Marketing Questions can be sent to:
029: * info at MyVietnam net
030: *
031: * @author: Minh Nguyen
032: * @author: Mai Nguyen
033: */
034: package net.myvietnam.mvncore.info;
035:
036: import java.awt.image.BufferedImage;
037: import java.awt.Graphics2D;
038:
039: public class LibInfo {
040:
041: boolean supportJNDI = false;
042: boolean supportJavaxSql = false;
043: boolean supportJAF = false;
044: boolean supportMail = false;
045:
046: boolean supportBeanUtils = false;
047: boolean supportCommonLogging = false;
048: boolean supportCommonCodec = false;
049: boolean supportCommonCollection = false;
050: boolean supportCommonDigester = false;
051: boolean supportCommonLang = false;
052: boolean supportJakartaRegExp = false;
053: boolean supportLucene = false;
054:
055: boolean supportDom4j = false;
056:
057: boolean supportMmMysqlDriver = false;
058: boolean supportComMysqlDriver = false;
059:
060: boolean supportImageProcessing = false;
061:
062: boolean supportCommonIo = false;
063: boolean supportPager_Taglib = false;
064: boolean supportWhirlycache = false;
065: boolean supportJDom = false;
066: boolean supportJzonic = false;
067:
068: boolean supportDNSJava = false;
069: boolean supportAspirinSMTPServer = false;
070:
071: public LibInfo() {
072: try {
073: Class.forName("javax.naming.Name");
074: supportJNDI = true;
075: } catch (ClassNotFoundException ex) {
076: }
077:
078: try {
079: Class.forName("javax.sql.DataSource");
080: supportJavaxSql = true;
081: } catch (ClassNotFoundException ex) {
082: }
083:
084: try {
085: Class.forName("javax.activation.DataSource");
086: supportJAF = true;
087: } catch (ClassNotFoundException ex) {
088: }
089:
090: try {
091: Class.forName("javax.mail.Message");
092: supportMail = true;
093: } catch (ClassNotFoundException ex) {
094: }
095:
096: try {
097: Class.forName("org.apache.commons.beanutils.MethodUtils");
098: supportBeanUtils = true;
099: } catch (ClassNotFoundException ex) {
100: }
101:
102: try {
103: Class.forName("org.apache.commons.logging.LogFactory");
104: supportCommonLogging = true;
105: } catch (ClassNotFoundException ex) {
106: }
107:
108: try {
109: Class.forName("org.apache.commons.codec.Decoder");
110: supportCommonCodec = true;
111: } catch (ClassNotFoundException ex) {
112: }
113:
114: try {
115: Class.forName("org.apache.commons.collections.ArrayStack");
116: supportCommonCollection = true;
117: } catch (ClassNotFoundException ex) {
118: }
119:
120: try {
121: Class.forName("org.apache.commons.digester.Digester");
122: supportCommonDigester = true;
123: } catch (ClassNotFoundException ex) {
124: }
125:
126: try {
127: Class.forName("org.apache.commons.lang.SystemUtils");
128: supportCommonLang = true;
129: } catch (ClassNotFoundException ex) {
130: }
131:
132: try {
133: Class.forName("org.apache.regexp.RE");
134: supportJakartaRegExp = true;
135: } catch (ClassNotFoundException ex) {
136: }
137:
138: try {
139: Class.forName("org.apache.lucene.index.IndexWriter");
140: supportLucene = true;
141: } catch (ClassNotFoundException ex) {
142: }
143:
144: try {
145: Class.forName("org.dom4j.Document");
146: supportDom4j = true;
147: } catch (ClassNotFoundException ex) {
148: }
149:
150: try {
151: Class.forName("org.gjt.mm.mysql.Driver");
152: supportMmMysqlDriver = true;
153: } catch (ClassNotFoundException ex) {
154: }
155:
156: try {
157: Class.forName("com.mysql.jdbc.Driver");
158: supportComMysqlDriver = true;
159: } catch (ClassNotFoundException ex) {
160: }
161:
162: try {
163: Class.forName("org.apache.commons.io.CopyUtils");
164: supportCommonIo = true;
165: } catch (ClassNotFoundException ex) {
166: }
167:
168: try {
169: Class.forName("com.jsptags.navigation.pager.PageTag");
170: supportPager_Taglib = true;
171: } catch (ClassNotFoundException ex) {
172: }
173:
174: try {
175: Class.forName("com.whirlycott.cache.Cache");
176: supportWhirlycache = true;
177: } catch (ClassNotFoundException ex) {
178: }
179:
180: try {
181: Class.forName("org.jdom.Attribute");
182: supportJDom = true;
183: } catch (ClassNotFoundException ex) {
184: }
185:
186: try {
187: Class.forName("org.jzonic.jlo.Channel");
188: supportJzonic = true;
189: } catch (ClassNotFoundException ex) {
190: }
191:
192: try {
193: Class.forName("org.xbill.DNS.TextParseException");
194: supportDNSJava = true;
195: } catch (ClassNotFoundException ex) {
196: }
197:
198: try {
199: Class.forName("org.masukomi.aspirin.core.QueManager");
200: supportAspirinSMTPServer = true;
201: } catch (ClassNotFoundException ex) {
202: }
203:
204: try {
205: BufferedImage bufferedImage = new BufferedImage(10, 10,
206: BufferedImage.TYPE_INT_RGB);
207: Graphics2D g = bufferedImage.createGraphics();
208: g.drawLine(0, 0, 10, 10);
209: g.dispose();// free resource
210:
211: supportImageProcessing = true;
212: } catch (Throwable ex) {
213: }
214:
215: }
216:
217: public boolean isSupportJAF() {
218: return supportJAF;
219: }
220:
221: public boolean isSupportJavaxSql() {
222: return supportJavaxSql;
223: }
224:
225: public boolean isSupportJNDI() {
226: return supportJNDI;
227: }
228:
229: public boolean isSupportMail() {
230: return supportMail;
231: }
232:
233: public boolean isSupportBeanUtils() {
234: return supportBeanUtils;
235: }
236:
237: public boolean isSupportCommonLogging() {
238: return supportCommonLogging;
239: }
240:
241: public boolean isSupportCommonCodec() {
242: return supportCommonCodec;
243: }
244:
245: public boolean isSupportCommonCollection() {
246: return supportCommonCollection;
247: }
248:
249: public boolean isSupportCommonDigester() {
250: return supportCommonDigester;
251: }
252:
253: public boolean isSupportCommonLang() {
254: return supportCommonLang;
255: }
256:
257: public boolean isSupportJakartaRegExp() {
258: return supportJakartaRegExp;
259: }
260:
261: public boolean isSupportLucene() {
262: return supportLucene;
263: }
264:
265: public boolean isSupportDom4j() {
266: return supportDom4j;
267: }
268:
269: public boolean isSupportMmMysqlDriver() {
270: return supportMmMysqlDriver;
271: }
272:
273: public boolean isSupportComMysqlDriver() {
274: return supportComMysqlDriver;
275: }
276:
277: public boolean isSupportImageProcessing() {
278: return supportImageProcessing;
279: }
280:
281: public boolean isSupportCommonIo() {
282: return supportCommonIo;
283: }
284:
285: public boolean isSupportPager_Taglib() {
286: return supportPager_Taglib;
287: }
288:
289: public boolean isSupportWhirlycache() {
290: return supportWhirlycache;
291: }
292:
293: public boolean isSupportJDom() {
294: return supportJDom;
295: }
296:
297: public boolean isSupportJzonic() {
298: return supportJzonic;
299: }
300:
301: public boolean isSupportDNSJava() {
302: return supportDNSJava;
303: }
304:
305: public boolean isSupportAspirinSMTPServer() {
306: return supportAspirinSMTPServer;
307: }
308:
309: }
|