01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library 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 GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data;
17:
18: import java.io.IOException;
19: import java.net.URL;
20:
21: /**
22: * <p>
23: * This interface includes some new functionality, and acts as a method of
24: * discovery for DataStoreFactories which support singular files.
25: * </p>
26: *
27: * @author dzwiers
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/data/FileDataStoreFactorySpi.java $
29: */
30: public interface FileDataStoreFactorySpi extends DataStoreFactorySpi {
31: /**
32: * The list of filename extentions handled by this factory.
33: *
34: * @return An ordered list of file extensions which can be read by this
35: * dataStore.
36: */
37: public String[] getFileExtensions();
38:
39: /**
40: * True if the url can be handled by this factory.
41: *
42: * @param f URL a url to a real file (may not be local)
43: *
44: * @return True when this dataStore can resolve and read the data specified
45: * by the URL.
46: */
47: public boolean canProcess(URL f);
48:
49: /**
50: * A DataStore attached to the provided url, may be created if needed.
51: *
52: * @param url A URL to the data location for the single featureType of this
53: * DataStore
54: *
55: * @return Returns an AbstractFileDataStore created from the data source
56: * provided.
57: *
58: * @throws IOException
59: *
60: * @see AbstractFileDataStore
61: */
62: public DataStore createDataStore(URL url) throws IOException;
63:
64: /**
65: * The typeName represented by the provided url.
66: *
67: * @param url The location of the datum to parse into features
68: *
69: * @return Returns the typename of the datum specified (on occasion this
70: * may involve starting the parse as well to get the FeatureType
71: * -- may not be instantanious).
72: *
73: * @throws IOException
74: */
75: public String getTypeName(URL url) throws IOException;
76: }
|