public InputStream downloadArtifact(Artifact a) throws IOException, URISyntaxException { //We can't just put the artifact's relative path at the end of the url string, //as there could be characters that need to be escaped. URI uri = new URI(getUrl()); String artifactPath = uri.getPath() + "artifact/" + a.getRelativePath(); URI artifactUri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), artifactPath, "", ""); return client.getFile(artifactUri); } }