01: /*
02: $Header: /cvsroot/xorm/xorm/src/org/xorm/datastore/xml/XMLConnectionInfo.java,v 1.2 2002/12/17 17:51:09 wbiggs Exp $
03:
04: This file is part of XORM.
05:
06: XORM is free software; you can redistribute it and/or modify
07: it under the terms of the GNU General Public License as published by
08: the Free Software Foundation; either version 2 of the License, or
09: (at your option) any later version.
10:
11: XORM is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with XORM; if not, write to the Free Software
18: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20: package org.xorm.datastore.xml;
21:
22: import java.net.URL;
23: import java.net.MalformedURLException;
24:
25: import org.xorm.datastore.ConnectionInfo;
26: import org.xorm.datastore.DatastoreDriver;
27:
28: public class XMLConnectionInfo extends ConnectionInfo {
29: private DocumentHolder documentHolder;
30:
31: private DocumentHolder getDocumentHolder() {
32: if (documentHolder == null) {
33: try {
34: URL url = new URL(getConnectionURL());
35: documentHolder = new DocumentHolder(url);
36: } catch (MalformedURLException e) {
37: // TODO
38: e.printStackTrace();
39: }
40: }
41: return documentHolder;
42: }
43:
44: public DatastoreDriver getDriver() {
45: return new JDOMDocumentDriver(getDocumentHolder());
46: }
47: }
|