artifactory-client-java
artifactory-client-java copied to clipboard
Issue with Spaces in Description
Hi,
When I try to upload an artifact with a property description with spaces, it throws an URI exception.
` Artifactory artifactory;
artifactory.repository(<repo>)
.upload(<Path>, <tarfileName>).toString(),
Channels.newInputStream(<tarFileBlob>.reader()))
.withProperty("npm.name", <name>)
.withProperty("npm.version",<version>)
.withProperty("npm.keywords",<keywords>)
.withProperty("npm.description", "Test Test Lib">)
.withProperty("artifactory.licenses", <licenses>);
`
I get the following exception thrown because of the spaces in the description.
https://<organization>.jfrog.io/<organization>/<repo>/<name>/<version>/<tar>;npm.version=<version>;artifactory.licenses=<license>;npm.description=Test Test Lib;npm.name=<name>;npm.keywords=<keywords> at java.net.URI.create(URI.java:852)
I'm using the newest tag version 2.8.5.
Are we expected to encode the values passed into withProperty?
Thanks, Derek
Looks like if i go
.withProperty("npm.description", URLEncoder.encode("Test Test Lib", StandardCharsets.UTF_8.toString()))
it works.
Is this stated in the documentation? I couldn't find it. Wouldn't it be better to just encode it vs. relying on the caller to do it?