Example usage for org.apache.commons.io FileExistsException printStackTrace

List of usage examples for org.apache.commons.io FileExistsException printStackTrace

Introduction

In this page you can find the example usage for org.apache.commons.io FileExistsException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.cytoscape.app.internal.manager.KarafArchiveApp.java

@Override
public void uninstall(AppManager appManager) throws AppUninstallException {

    // Use the default uninstallation procedure consisting of moving the app file
    // to the uninstalled apps directory
    // defaultUninstall(appManager);

    try {//from   www .  j  a  v  a  2  s  .  c  o  m
        File uninstallDirectoryTargetFile = new File(
                appManager.getUninstalledAppsPath() + File.separator + getAppFile().getName());

        if (uninstallDirectoryTargetFile.exists()) {
            uninstallDirectoryTargetFile.delete();
        }

        try {
            FileUtils.moveFile(getAppFile(), uninstallDirectoryTargetFile);
        } catch (FileExistsException e) {
        }

        this.setAppFile(uninstallDirectoryTargetFile);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();

        throw new AppUninstallException(
                "Unable to move app file to uninstalled apps directory: " + e.getMessage());
    }

    this.getAppTemporaryInstallFile().delete();

    this.setStatus(AppStatus.UNINSTALLED);
}