svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.mdb / src / main / java / org / gvsig / fmap / dal / store / mdb / MDBExplorer.java @ 45647
History | View | Annotate | Download (1.85 KB)
1 | 44916 | omartinez | package org.gvsig.fmap.dal.store.mdb; |
---|---|---|---|
2 | |||
3 | import org.apache.commons.io.FilenameUtils; |
||
4 | import org.apache.commons.lang3.StringUtils; |
||
5 | import org.gvsig.fmap.dal.DataStore; |
||
6 | import org.gvsig.fmap.dal.exception.InitializeException; |
||
7 | import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices; |
||
8 | import org.gvsig.fmap.dal.spi.ZipResourcesStorage; |
||
9 | import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
||
10 | import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
||
11 | import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCServerExplorerBase; |
||
12 | import org.gvsig.tools.resourcesstorage.EmptyResourcesStorage; |
||
13 | import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
||
14 | //import sun.swing.StringUIClientPropertyKey;
|
||
15 | |||
16 | /**
|
||
17 | *
|
||
18 | * @author jjdelcerro
|
||
19 | */
|
||
20 | @SuppressWarnings("UseSpecificCatch") |
||
21 | public class MDBExplorer extends JDBCServerExplorerBase { |
||
22 | |||
23 | public MDBExplorer(JDBCServerExplorerParameters parameters, DataServerExplorerProviderServices services, JDBCHelper helper) throws InitializeException { |
||
24 | super(parameters, services, helper);
|
||
25 | } |
||
26 | |||
27 | @Override
|
||
28 | public MDBExplorerParameters getParameters() {
|
||
29 | return (MDBExplorerParameters) super.getParameters(); |
||
30 | } |
||
31 | |||
32 | @Override
|
||
33 | public ResourcesStorage getResourcesStorage(DataStore dataStore) {
|
||
34 | ResourcesStorage ress = super.getResourcesStorage(dataStore);
|
||
35 | if( ress instanceof EmptyResourcesStorage ) { |
||
36 | String zipPath = this.getParameters().getFile().getAbsolutePath(); |
||
37 | String zipPathName = FilenameUtils.removeExtension(zipPath);
|
||
38 | ress = new ZipResourcesStorage(zipPathName, dataStore.getName());
|
||
39 | } |
||
40 | return ress;
|
||
41 | } |
||
42 | |||
43 | @Override
|
||
44 | 45425 | jjdelcerro | public Object execute(String sql) { |
45 | 44916 | omartinez | if( StringUtils.equalsIgnoreCase(sql, "!SHUTDOWN") ) { |
46 | 45647 | fdiaz | MDBHelper.ConnectionProviderImpl.stopServer(); |
47 | 45425 | jjdelcerro | return null; |
48 | 44916 | omartinez | } |
49 | 45425 | jjdelcerro | return super.execute(sql); |
50 | 44916 | omartinez | } |
51 | } |