Search in sources :

Example 11 with RipStatusMessage

use of com.rarchives.ripme.ui.RipStatusMessage in project ripme by RipMeApp.

the class AbstractHTMLRipper method downloadExists.

@Override
public /**
 * Tells user that a single file in the album they wish to download has
 * already been downloaded in the past.
 */
void downloadExists(URL url, File 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()));
    checkIfComplete();
}
Also used : RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage)

Example 12 with RipStatusMessage

use of com.rarchives.ripme.ui.RipStatusMessage in project ripme by RipMeApp.

the class AlbumRipper method downloadExists.

@Override
public /**
 * Tells user that a single file in the album they wish to download has
 * already been downloaded in the past.
 */
void downloadExists(URL url, File 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()));
    checkIfComplete();
}
Also used : RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage)

Example 13 with RipStatusMessage

use of com.rarchives.ripme.ui.RipStatusMessage in project ripme by RipMeApp.

the class AlbumRipper method downloadErrored.

@Override
public /**
 * Cleans up & tells user about failed download.
 */
void downloadErrored(URL url, String reason) {
    if (observer == null) {
        return;
    }
    itemsPending.remove(url);
    itemsErrored.put(url, reason);
    observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_ERRORED, url + " : " + reason));
    checkIfComplete();
}
Also used : RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage)

Example 14 with RipStatusMessage

use of com.rarchives.ripme.ui.RipStatusMessage in project ripme by RipMeApp.

the class AlbumRipper method downloadCompleted.

@Override
public /**
 * Cleans up & tells user about successful download
 */
void downloadCompleted(URL url, File saveAs) {
    if (observer == null) {
        return;
    }
    try {
        String path = Utils.removeCWD(saveAs);
        RipStatusMessage msg = new RipStatusMessage(STATUS.DOWNLOAD_COMPLETE, path);
        itemsPending.remove(url);
        itemsCompleted.put(url, saveAs);
        observer.update(this, msg);
        checkIfComplete();
    } catch (Exception e) {
        LOGGER.error("Exception while updating observer: ", e);
    }
}
Also used : RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException)

Example 15 with RipStatusMessage

use of com.rarchives.ripme.ui.RipStatusMessage in project ripme by RipMeApp.

the class VideoRipper method downloadExists.

/**
 * Runs if user tries to redownload an already existing File.
 *
 * @param url  Target URL
 * @param file Existing file
 */
@Override
public void downloadExists(URL url, File file) {
    if (observer == null) {
        return;
    }
    observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
    checkIfComplete();
}
Also used : RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage)

Aggregations

RipStatusMessage (com.rarchives.ripme.ui.RipStatusMessage)16 IOException (java.io.IOException)7 MalformedURLException (java.net.MalformedURLException)4 File (java.io.File)2 FileWriter (java.io.FileWriter)2 RipStatusComplete (com.rarchives.ripme.ui.RipStatusComplete)1 FileAppender (org.apache.log4j.FileAppender)1 Logger (org.apache.log4j.Logger)1