Example usage for java.nio.file FileAlreadyExistsException getFile

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

Introduction

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

Prototype

public String getFile() 

Source Link

Document

Returns the file used to create this exception.

Usage

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

private void installLocalAddOn(AddOn ao) {
    File addOnFile;/*from  w  w w.  j a  v  a  2 s .com*/
    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);
}