I am using the GeoServer REST API to create a datastore. The path that I am using has a space in it. This does not seem to work well in GeoServer 2.11.2 since it generates an "Input type is not supported" error.

When I go in GeoServer and I use the datastore page directly this does not seem to work unless you replace the spaces with %20 and the file: to file://.

So it works if the url field looks like this: file://C:source/example%20source/example.ecw

I can not get it to work with these paths in the REST call:

  • C:/sources/example source/example.ecw (throws org.geoserver.rest.RestletException: java.lang.IllegalArgumentException: Unsupported input type)
  • C:/sources/example%20source/example.ecw (throws file not found)
  • file://C:/sources/example%20source/example.ecw (this converts in geoserver to file://file:) (throws file not found)

Is there a way I can make this work with the REST API? Maybe GeoServer should support spaces natively?

the last option works but there was something in my code already adding the "file:" part so it added it double


Your problem is not so much the space as that you are not using a proper URL.

A url must start with http://,https:// or file:// and it must have special characters encoded (so convert spaces to %20 etc).

You don't say which language you are using to create your rest request but most languages have a method for converting a file to a URL and for encoding the URL if it contains special characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.