Search in sources :

Example 16 with RipStatusMessage

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

the class VideoRipper method downloadCompleted.

/**
 * Runs if download successfully completed.
 *
 * @param url    Target URL
 * @param saveAs Path to file, including filename.
 */
@Override
public void downloadCompleted(URL url, File saveAs) {
    if (observer == null) {
        return;
    }
    try {
        String path = Utils.removeCWD(saveAs);
        RipStatusMessage msg = new RipStatusMessage(STATUS.DOWNLOAD_COMPLETE, path);
        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)

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