Example usage for org.springframework.boot.loader.tools Libraries Libraries

List of usage examples for org.springframework.boot.loader.tools Libraries Libraries

Introduction

In this page you can find the example usage for org.springframework.boot.loader.tools Libraries Libraries.

Prototype

Libraries

Source Link

Usage

From source file:org.eclipse.cft.server.standalone.ui.internal.application.JarArchivingUIHandler.java

protected void bootRepackage(final IPackageFragmentRoot[] roots, File packagedFile) throws CoreException {
    Repackager bootRepackager = new Repackager(packagedFile);
    try {//  w  ww .  jav a2 s .c om
        bootRepackager.repackage(new Libraries() {

            public void doWithLibraries(LibraryCallback callBack) throws IOException {
                for (IPackageFragmentRoot root : roots) {

                    if (root.isArchive()) {

                        File rootFile = new File(root.getPath().toOSString());
                        if (rootFile.exists()) {
                            callBack.library(new Library(rootFile, LibraryScope.COMPILE));
                        }
                    }
                }
            }
        });
    } catch (IOException e) {
        errorHandler.handleApplicationDeploymentFailure(
                NLS.bind(Messages.JavaCloudFoundryArchiver_ERROR_REPACKAGE_SPRING, e.getMessage()));
    }
}