Dashes no longer encoded in exported filenames

This commit is contained in:
Rsl1122 2019-09-26 10:08:10 +03:00
parent 7aca4fc0b1
commit 0c92fbbaa2

View File

@ -70,7 +70,11 @@ abstract class FileExporter {
String toFileName(String resourceName) {
try {
return URLEncoder.encode(resourceName, "UTF-8").replace(".", "%2E");
return StringUtils.replaceEach(
URLEncoder.encode(resourceName, "UTF-8"),
new String[]{".", "%2F"},
new String[]{"%2E", "-"}
);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Unexpected: UTF-8 encoding not supported", e);
}