gvsig-sqlite / trunk / org.gvsig.spatialite / org.gvsig.spatialite.provider / src / main / java / org / gvsig / spatialite / dal / SpatiaLiteExplorer.java @ 192
History | View | Annotate | Download (1.41 KB)
1 |
package org.gvsig.spatialite.dal; |
---|---|
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 SpatiaLiteExplorer extends JDBCServerExplorerBase { |
19 |
|
20 |
public SpatiaLiteExplorer(JDBCServerExplorerParameters parameters, DataServerExplorerProviderServices services, JDBCHelper helper) throws InitializeException { |
21 |
super(parameters, services, helper);
|
22 |
} |
23 |
|
24 |
@Override
|
25 |
public SpatiaLiteExplorerParameters getParameters() {
|
26 |
return (SpatiaLiteExplorerParameters) 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 + ".gvres";
|
34 |
SpatiaLiteResource resource = new SpatiaLiteResource(new File(zipPath), dataStore.getName(), resourceName); |
35 |
return resource;
|
36 |
} |
37 |
|
38 |
} |