mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-09-02 18:33:13 +02:00
downloadexists java.nio
This commit is contained in:
@@ -403,14 +403,14 @@ public abstract class AbstractHTMLRipper extends AbstractRipper {
|
||||
Tells user that a single file in the album they wish to download has
|
||||
already been downloaded in the past.
|
||||
*/
|
||||
public void downloadExists(URL url, File file) {
|
||||
public void downloadExists(URL url, Path file) {
|
||||
if (observer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
itemsPending.remove(url);
|
||||
itemsCompleted.put(url, file);
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
|
||||
itemsCompleted.put(url, file.toFile());
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
|
||||
|
||||
checkIfComplete();
|
||||
}
|
||||
|
@@ -242,14 +242,14 @@ public abstract class AbstractJSONRipper extends AbstractRipper {
|
||||
* Tells user that a single file in the album they wish to download has
|
||||
* already been downloaded in the past.
|
||||
*/
|
||||
public void downloadExists(URL url, File file) {
|
||||
public void downloadExists(URL url, Path file) {
|
||||
if (observer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
itemsPending.remove(url);
|
||||
itemsCompleted.put(url, file);
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
|
||||
itemsCompleted.put(url, file.toFile());
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
|
||||
|
||||
checkIfComplete();
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -464,7 +465,7 @@ public abstract class AbstractRipper
|
||||
* @param url
|
||||
* @param file
|
||||
*/
|
||||
public abstract void downloadExists(URL url, File file);
|
||||
public abstract void downloadExists(URL url, Path file);
|
||||
|
||||
/**
|
||||
* @return Number of files downloaded.
|
||||
|
@@ -151,14 +151,14 @@ public abstract class AlbumRipper extends AbstractRipper {
|
||||
* Tells user that a single file in the album they wish to download has
|
||||
* already been downloaded in the past.
|
||||
*/
|
||||
public void downloadExists(URL url, File file) {
|
||||
public void downloadExists(URL url, Path file) {
|
||||
if (observer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
itemsPending.remove(url);
|
||||
itemsCompleted.put(url, file);
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
|
||||
itemsCompleted.put(url, file.toFile());
|
||||
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
|
||||
|
||||
checkIfComplete();
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ class DownloadFileThread extends Thread {
|
||||
} else {
|
||||
logger.info("[!] " + Utils.getLocalizedString("skipping") + " " + url + " -- "
|
||||
+ Utils.getLocalizedString("file.already.exists") + ": " + prettySaveAs);
|
||||
observer.downloadExists(url, saveAs);
|
||||
observer.downloadExists(url, saveAs.toPath());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ class DownloadVideoThread extends Thread {
|
||||
}
|
||||
} else {
|
||||
logger.info("[!] Skipping " + url + " -- file already exists: " + prettySaveAs);
|
||||
observer.downloadExists(url, saveAs.toFile());
|
||||
observer.downloadExists(url, saveAs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -153,12 +153,11 @@ public abstract class VideoRipper extends AbstractRipper {
|
||||
|
||||
/**
|
||||
* Runs if user tries to redownload an already existing File.
|
||||
*
|
||||
* @param url Target URL
|
||||
* @param url Target URL
|
||||
* @param file Existing file
|
||||
*/
|
||||
@Override
|
||||
public void downloadExists(URL url, File file) {
|
||||
public void downloadExists(URL url, Path file) {
|
||||
if (observer == null) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user