Example usage for org.eclipse.jgit.util FileUtils canonicalize

List of usage examples for org.eclipse.jgit.util FileUtils canonicalize

Introduction

In this page you can find the example usage for org.eclipse.jgit.util FileUtils canonicalize.

Prototype

public static File canonicalize(File file) 

Source Link

Document

Best-effort variation of java.io.File#getCanonicalFile() returning the input file if the file cannot be canonicalized instead of throwing java.io.IOException .

Usage

From source file:org.eclipse.egit.ui.internal.repository.tree.command.AddCommand.java

License:Open Source License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    RepositorySearchWizard wizard = new RepositorySearchWizard(util.getConfiguredRepositories(), true);
    WizardDialog dialog = new WizardDialog(getShell(event), wizard);
    if (dialog.open() == Window.OK) {
        for (String dir : wizard.getDirectories()) {
            File repositoryDir = FileUtils.canonicalize(new File(dir));
            addRepository(repositoryDir);
        }// w w w.j  ava2  s .  com
    }
    return null;
}