If you wanted to go to a bit more effort you could check the contents of the directory to ensure it has the files needed for your format, or as you say added an extra parameter. -- Jody Garnett
On Fri, 16 Oct 2020 at 07:44, Yang <dh...@foxmail.com> wrote: > The URI of my store is a directory. Now I have added an extra useless > parameter to the store, it works now. > > > ------------------ Original ------------------ > *From: * "Ian Turton";<ijtur...@gmail.com>; > *Send time:* Friday, Oct 16, 2020 10:02 PM > *To:* "Yang"<dh...@foxmail.com>; > *Cc:* "andrea.aime"<andrea.a...@geo-solutions.it>; "geoserver-users"< > geoserver-users@lists.sourceforge.net>; > *Subject: * Re: [Geoserver-users] why ResourcePool retrieve DataStore by > parameters? > > In that case you should be checking to see what the URL ends with a unique > extension - so for example GeoJSONDataStore and ShpDatastore both have a > URL but only match if it ends with the right extension. > > So you will only get a ShapefileDataStoreFactory back if the URL ends in > "shp" or "SHP" > > see > > public boolean canProcess(URL f) { > return f != null && f.getFile().toUpperCase().endsWith("SHP"); > } > > On Fri, 16 Oct 2020 at 14:44, Yang <dh...@foxmail.com> wrote: > >> Why I ask this is that I am trying to build a custom datastore which only >> require one parameter "url" to the path, and the path is a directory. >> >> So the `ShapefileDirectoryDataStore` will be returned back early. >> >> Fine, I will tried to add a new Param for the factory and to see if this >> can be solved. >> >> >> > Ian > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users >
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users