Example usage for java.nio.file InvalidPathException getLocalizedMessage

List of usage examples for java.nio.file InvalidPathException getLocalizedMessage

Introduction

In this page you can find the example usage for java.nio.file InvalidPathException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.jboss.tools.common.launcher.ui.wizard.NewLauncherProjectWizardController.java

private void unzipEntry(IPath location, ZipInputStream stream, ZipEntry entry) throws IOException {
    try {/*w w w . j  av  a  2s  .c om*/
        String name = skipOneLevel(entry.getName());
        if (!name.isEmpty()) {
            Path path = Paths.get(location.toOSString(), name);
            if (entry.isDirectory()) {
                Files.createDirectories(path);
            } else {
                try (OutputStream output = new FileOutputStream(path.toFile())) {
                    IOUtils.copy(stream, output);
                }
            }
        }
    } catch (InvalidPathException e) {
        LauncherUIPlugin.getDefault().getLog()
                .log(new Status(IStatus.WARNING, LauncherUIPlugin.PLUGIN_ID, e.getLocalizedMessage(), e));
    }
}