Example usage for java.nio.file FileAlreadyExistsException getOtherFile

List of usage examples for java.nio.file FileAlreadyExistsException getOtherFile

Introduction

In this page you can find the example usage for java.nio.file FileAlreadyExistsException getOtherFile.

Prototype

public String getOtherFile() 

Source Link

Document

Returns the other file used to create this exception.

Usage

From source file:org.zaproxy.zap.extension.autoupdate.ExtensionAutoUpdate.java

private void installLocalAddOn(AddOn ao) {
    File addOnFile;//ww w  . j av a2 s .c o  m
    try {
        addOnFile = copyAddOnFileToLocalPluginFolder(ao.getFile());
    } catch (FileAlreadyExistsException e) {
        showWarningMessageAddOnFileAlreadyExists(e.getFile(), e.getOtherFile());
        logger.warn("Unable to copy add-on, a file with the same name already exists.", e);
        return;
    } catch (IOException e) {
        showWarningMessageUnableToCopyAddOnFile();
        logger.warn("Unable to copy add-on to local plugin folder.", e);
        return;
    }

    ao.setFile(addOnFile);

    install(ao);
}