Merge pull request #282 from bsinno/fix_filename_encondig

Added missing filename encondig
This commit is contained in:
Kai Zimmermann
2016-09-07 09:34:34 +02:00
committed by GitHub

View File

@@ -19,6 +19,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.net.UrlEscapers;
/** /**
* Implementation for ArtifactUrlHandler for creating urls to download resource * Implementation for ArtifactUrlHandler for creating urls to download resource
@@ -55,8 +56,8 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
} }
String urlPattern = properties.getPattern(); String urlPattern = properties.getPattern();
final Set<Entry<String, String>> entrySet = getReplaceMap(targetId, softwareModuleId, filename, sha1Hash, final Set<Entry<String, String>> entrySet = getReplaceMap(targetId, softwareModuleId,
protocolString, properties).entrySet(); UrlEscapers.urlFragmentEscaper().escape(filename), sha1Hash, protocolString, properties).entrySet();
for (final Entry<String, String> entry : entrySet) { for (final Entry<String, String> entry : entrySet) {
if (entry.getKey().equals(PORT_PLACEHOLDER)) { if (entry.getKey().equals(PORT_PLACEHOLDER)) {
urlPattern = urlPattern.replace(":{" + entry.getKey() + "}", urlPattern = urlPattern.replace(":{" + entry.getKey() + "}",