The URI of my store is a directory. Now I have added an extra useless parameter 
to the store, it works now.




------------------ Original ------------------
From: &nbsp;"Ian Turton";<[email protected]&gt;;
Send time:&nbsp;Friday, Oct 16, 2020 10:02 PM
To:&nbsp;"Yang"<[email protected]&gt;; 
Cc:&nbsp;"andrea.aime"<[email protected]&gt;; 
"geoserver-users"<[email protected]&gt;; 
Subject: &nbsp;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&nbsp;both have a 
URL but only match if it ends with the right extension.&nbsp;

So you will only get a ShapefileDataStoreFactory back if the URL ends in "shp" 
or "SHP"&nbsp;


see&nbsp;


&nbsp; &nbsp;public boolean canProcess(URL f) {
&nbsp; &nbsp; &nbsp; &nbsp; return f != null &amp;&amp; 
f.getFile().toUpperCase().endsWith("SHP");
&nbsp; &nbsp; }



On Fri, 16 Oct 2020 at 14:44, Yang <[email protected]&gt; 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&nbsp; early.


Fine, I will tried to add a new Param for the factory and to see if this can be 
solved.







Ian&nbsp;
_______________________________________________
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


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to