Example usage for org.springframework.boot.loader.tools Repackager setBackupSource

List of usage examples for org.springframework.boot.loader.tools Repackager setBackupSource

Introduction

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

Prototype

public void setBackupSource(boolean backupSource) 

Source Link

Document

Sets if source files should be backed up when they would be overwritten.

Usage

From source file:org.springframework.boot.loader.tools.RepackagerTests.java

@Test
public void sameSourceAndDestinationWithoutBackup() throws Exception {
    this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class);
    File file = this.testJarFile.getFile();
    Repackager repackager = new Repackager(file);
    repackager.setBackupSource(false);
    repackager.repackage(NO_LIBRARIES);/* ww w  .ja  v a 2 s .  com*/
    assertThat(new File(file.getParent(), file.getName() + ".original")).doesNotExist();
    assertThat(hasLauncherClasses(file)).isTrue();
}