Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
import ch.qos.logback.core.spi.ContextAwareBase;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -90,11 +92,16 @@ public boolean changeDetected() {
// SENTINEL);
}

@SuppressWarnings("deprecation")
File convertToFile(URL url) {
String protocol = url.getProtocol();
if ("file".equals(protocol)) {
return new File(URLDecoder.decode(url.getFile()));
try {
return new File(URLDecoder.decode(url.getFile(), Charset.defaultCharset().name()));
} catch (UnsupportedEncodingException e) {
// This can't (?) happen, and if it did, we would not see this message
addInfo("Invalid defaultCharset encoding");
return null;
}
} else {
addInfo("URL [" + url + "] is not of type file");
return null;
Expand Down