Search code examples
eclipseeclipse-plugineclipse-rcp

Escaping space in the URI


I am trying to create a linked folder programmatically in Eclipse and link the zip file which is at a location outside the workspace using Eclipse EFS.

I am getting the following exception

java.net.URISyntaxException: Illegal character in query at index 20: zip:/?file:///D:/New Folder/documentation.zip
    at java.net.URI$Parser.fail(URI.java:2810)
    at java.net.URI$Parser.checkChars(URI.java:2983)

the problem is the space in the URI.

I tried replacing the space with %20 and "+", but neither one worked.

How can I resolve this issue?


Solution

  • Double escape it with %2520 and it will work.