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.h2 / src / main / java / org / gvsig / fmap / dal / store / h2 / H2SpatialExplorer.java @ 44189
History | View | Annotate | Download (1.4 KB)
1 |
package org.gvsig.fmap.dal.store.h2; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import org.apache.commons.io.FilenameUtils; |
5 |
import org.gvsig.fmap.dal.DataStore; |
6 |
import org.gvsig.fmap.dal.exception.DataException; |
7 |
import org.gvsig.fmap.dal.exception.InitializeException; |
8 |
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices; |
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 |
|
13 |
/**
|
14 |
*
|
15 |
* @author jjdelcerro
|
16 |
*/
|
17 |
@SuppressWarnings("UseSpecificCatch") |
18 |
public class H2SpatialExplorer extends JDBCServerExplorerBase { |
19 |
|
20 |
public H2SpatialExplorer(JDBCServerExplorerParameters parameters, DataServerExplorerProviderServices services, JDBCHelper helper) throws InitializeException { |
21 |
super(parameters, services, helper);
|
22 |
} |
23 |
|
24 |
@Override
|
25 |
public H2SpatialExplorerParameters getParameters() {
|
26 |
return (H2SpatialExplorerParameters) super.getParameters(); |
27 |
} |
28 |
|
29 |
@Override
|
30 |
public DataResource getResource(DataStore dataStore, String resourceName) throws DataException { |
31 |
String zipPath = this.getParameters().getFile().getAbsolutePath(); |
32 |
zipPath = FilenameUtils.removeExtension(zipPath); |
33 |
zipPath = zipPath + "." + resourceName;
|
34 |
H2SpatialResource resource = new H2SpatialResource(new File(zipPath), dataStore.getName()); |
35 |
return resource;
|
36 |
} |
37 |
|
38 |
} |