Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding string URL #1770

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/main/java/com/rarchives/ripme/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@ public void mouseClicked(MouseEvent e) {
String chosenPath = null;
try {
chosenPath = chosenFile.getCanonicalPath();

File theDir = new File(chosenPath);
if (!theDir.exists()){
theDir.mkdirs();
}
} catch (Exception e) {
LOGGER.error("Error while getting selected path: ", e);
return;
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/rarchives/ripme/utils/Http.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

import com.rarchives.ripme.ripper.AbstractRipper;

import java.nio.charset.StandardCharsets;
import java.net.URLEncoder;

/**
* Wrapper around the Jsoup connection methods.
*
Expand All @@ -45,9 +48,11 @@ private Http(URL url) {
}

public static Http url(String url) {
return new Http(url);
String encodedURL = URLEncoder.encode(url, StandardCharsets.UTF_8);
return new Http(encodedURL);
}
public static Http url(URL url) {
// TODO: Endcode URL
return new Http(url);
}

Expand Down