Skip to content

Commit

Permalink
new URI instead of new URL, abstractjsonripper.
Browse files Browse the repository at this point in the history
  • Loading branch information
soloturn committed Nov 18, 2023
1 parent 14c0779 commit f54aa6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand Down Expand Up @@ -56,7 +57,7 @@ public boolean canRip(URL url) {
}

@Override
public URL sanitizeURL(URL url) throws MalformedURLException {
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException {
return url;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -37,7 +39,7 @@ public String getDomain() {
}

@Override
public URL sanitizeURL(URL url) throws MalformedURLException {
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException {
String u = url.toExternalForm();
String[] uu = u.split("\\?", 2);
String newU = uu[0];
Expand All @@ -54,7 +56,7 @@ public URL sanitizeURL(URL url) throws MalformedURLException {
newU += "&key=" + key;
}

return new URL(newU);
return new URI(newU).toURL();
}

@Override
Expand Down

0 comments on commit f54aa6f

Please sign in to comment.