fixed: file ending not properly attached to images

This commit is contained in:
Hannes
2017-11-10 01:32:40 +01:00
parent 0f569edf72
commit 954c190002

View File

@@ -19,8 +19,7 @@ public class ImageDownloader {
private void downloadImage(final String url, final String folderPath, final int counter) throws IOException { private void downloadImage(final String url, final String folderPath, final int counter) throws IOException {
final InputStream in = new URL(url).openStream(); final InputStream in = new URL(url).openStream();
final String fileName = "Comic_" + counter; final String fileName = "Comic_" + counter + url.substring(url.lastIndexOf("."));
// url.substring(url.lastIndexOf("/")).replaceAll("[^A-Za-z0-9.]", "");
downloadedImages.add(folderPath + fileName); downloadedImages.add(folderPath + fileName);