jdmcmahan opened a new pull request #1477:
URL: https://github.com/apache/karaf/pull/1477


   `URI.create(String)` throws a `URISyntaxException` if any of the resolved 
URIs from `featuresRepositories` contains a space.
   
   This is common if customizing the boot features via the 
`karaf-maven-plugin`, then running the assembly from within a path containing 
spaces.
   
   For example:
   
   ```xml
   <plugin>
       <groupId>org.apache.karaf.tooling</groupId>
       <artifactId>karaf-maven-plugin</artifactId>
       <version>${karaf.version}</version>
       <configuration>
           <bootFeatures>
               <feature>standard</feature>
               <feature>my-feature</feature>
           </bootFeatures>
           ...
       </configuration>
   </plugin>
   ```
   
   will result in a new feature in `etc` as well as an entry in 
`etc/org.apache.karaf.features.cfg`:
   
   ```
   featuresRepositories = 
file:${karaf.etc}/2b260482-45bc-427c-af65-8909c1f2f7a3.xml
   ```
   
   However, if `karaf.etc` contains a space at runtime, Karaf fails to start 
because the URI cannot be parsed.
   
   This PR simply replaces all spaces with `%20` before passing the path to 
`URI.create(String)`. The `encodePath` method can be further enhanced if other 
characters prove to be problematic.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to