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

Reply via email to