Search in sources :

Example 1 with RipStatusComplete

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

the class AbstractRipper method checkIfComplete.

/**
 * Notifies observers and updates state if all files have been ripped.
 */
void checkIfComplete() {
    if (observer == null) {
        LOGGER.debug("observer is null");
        return;
    }
    if (!completed) {
        completed = true;
        LOGGER.info("   Rip completed!");
        RipStatusComplete rsc = new RipStatusComplete(workingDir, getCount());
        RipStatusMessage msg = new RipStatusMessage(STATUS.RIP_COMPLETE, rsc);
        observer.update(this, msg);
        Logger rootLogger = Logger.getRootLogger();
        FileAppender fa = (FileAppender) rootLogger.getAppender("FILE");
        if (fa != null) {
            LOGGER.debug("Changing log file back to 'ripme.log'");
            fa.setFile("ripme.log");
            fa.activateOptions();
        }
        if (Utils.getConfigBoolean("urls_only.save", false)) {
            String urlFile = this.workingDir + File.separator + "urls.txt";
            try {
                Desktop.getDesktop().open(new File(urlFile));
            } catch (IOException e) {
                LOGGER.warn("Error while opening " + urlFile, e);
            }
        }
    }
}
Also used : FileAppender(org.apache.log4j.FileAppender) RipStatusComplete(com.rarchives.ripme.ui.RipStatusComplete) RipStatusMessage(com.rarchives.ripme.ui.RipStatusMessage) IOException(java.io.IOException) Logger(org.apache.log4j.Logger) File(java.io.File)

Aggregations

RipStatusComplete (com.rarchives.ripme.ui.RipStatusComplete)1 RipStatusMessage (com.rarchives.ripme.ui.RipStatusMessage)1 File (java.io.File)1 IOException (java.io.IOException)1 FileAppender (org.apache.log4j.FileAppender)1 Logger (org.apache.log4j.Logger)1