01: package org.geotools.catalog.property;
02:
03: import java.io.File;
04: import java.io.IOException;
05: import java.util.logging.Level;
06:
07: import org.geotools.catalog.AbstractFileGeoResource;
08: import org.geotools.catalog.FeatureSourceGeoResource;
09:
10: import org.geotools.data.property.PropertyDataStore;
11: import org.geotools.data.property.PropertyFeatureSource;
12: import org.geotools.util.ProgressListener;
13:
14: public class PropertyGeoResource extends FeatureSourceGeoResource {
15:
16: public PropertyGeoResource(PropertyService service, String name) {
17: super (service, name);
18: }
19:
20: public boolean canResolve(Class adaptee) {
21: if (adaptee == null)
22: return false;
23:
24: if (adaptee.isAssignableFrom(File.class)) {
25: return true;
26: }
27:
28: return super .canResolve(adaptee);
29: }
30:
31: public Object resolve(Class adaptee, ProgressListener monitor)
32: throws IOException {
33: if (adaptee == null)
34: return null;
35:
36: if (adaptee.isAssignableFrom(File.class)) {
37: PropertyService service = (PropertyService) parent(monitor);
38: return new File(service.directory, getName()
39: + ".properties");
40: }
41:
42: return super.resolve(adaptee, monitor);
43: }
44:
45: }
|