You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2019/12/14 09:23:41 UTC
[lucene-solr] branch jira/solr-13662-fixes updated: SOLR-13662:
Handle repository name without trailing slash
This is an automated email from the ASF dual-hosted git repository.
ishan pushed a commit to branch jira/solr-13662-fixes
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/jira/solr-13662-fixes by this push:
new e3383d0 SOLR-13662: Handle repository name without trailing slash
e3383d0 is described below
commit e3383d0734f9e9feae9e12f4f252af89ecebd745
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Sat Dec 14 14:53:24 2019 +0530
SOLR-13662: Handle repository name without trailing slash
---
.../java/org/apache/solr/packagemanager/DefaultPackageRepository.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java b/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
index dee55a5..79cc1fa 100644
--- a/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
+++ b/solr/core/src/java/org/apache/solr/packagemanager/DefaultPackageRepository.java
@@ -82,7 +82,7 @@ public class DefaultPackageRepository extends PackageRepository {
public Path download(String artifactName) throws SolrException, IOException {
Path tmpDirectory = Files.createTempDirectory("solr-packages");
tmpDirectory.toFile().deleteOnExit();
- URL url = new URL(new URL(repositoryURL), artifactName);
+ URL url = new URL(new URL(repositoryURL.endsWith("/")? repositoryURL: repositoryURL+"/"), artifactName);
String fileName = url.getPath().substring(url.getPath().lastIndexOf('/') + 1);
Path destination = tmpDirectory.resolve(fileName);