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

Fixed issue where spaces in name of PPTX would cause it not to be found #45

Open
wants to merge 1 commit 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
Binary file added imagesxxx/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/main/java/org/sikuli/slides/api/io/PPTXSlidesReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.slf4j.LoggerFactory;

import com.google.common.collect.Lists;
import java.net.URLDecoder;

public class PPTXSlidesReader implements SlidesReader {

Expand Down Expand Up @@ -51,7 +52,9 @@ public List<Slide> read(URL url) throws IOException {
throw new IOException("Unable to download from " + url);
}
}else if (url.getProtocol().compareToIgnoreCase("file") == 0){
pptxFile = new File(url.getFile());
// Need to unencode the URL because otherwise spaces in the name will cause the file not to be found.
String filename = URLDecoder.decode(url.getFile(), "UTF-8");
pptxFile = new File(filename);
}else{
throw new IOException("Unable to deal with " + url);
}
Expand Down