Example usage for org.springframework.boot.gradle.tasks.bundling BootZipCopyAction CONSTANT_TIME_FOR_ZIP_ENTRIES

List of usage examples for org.springframework.boot.gradle.tasks.bundling BootZipCopyAction CONSTANT_TIME_FOR_ZIP_ENTRIES

Introduction

In this page you can find the example usage for org.springframework.boot.gradle.tasks.bundling BootZipCopyAction CONSTANT_TIME_FOR_ZIP_ENTRIES.

Prototype

long CONSTANT_TIME_FOR_ZIP_ENTRIES

To view the source code for org.springframework.boot.gradle.tasks.bundling BootZipCopyAction CONSTANT_TIME_FOR_ZIP_ENTRIES.

Click Source Link

Usage

From source file:org.springframework.boot.gradle.tasks.bundling.AbstractBootArchiveTests.java

@Test
public void fileTimestampPreservationCanBeDisabled() throws IOException {
    this.task.setMainClassName("com.example.Main");
    this.task.setPreserveFileTimestamps(false);
    this.task.execute();
    assertThat(this.task.getArchivePath()).exists();
    try (JarFile jarFile = new JarFile(this.task.getArchivePath())) {
        Enumeration<JarEntry> entries = jarFile.entries();
        while (entries.hasMoreElements()) {
            JarEntry entry = entries.nextElement();
            assertThat(entry.getTime()).isEqualTo(BootZipCopyAction.CONSTANT_TIME_FOR_ZIP_ENTRIES);
        }/*from w  w w  . j  av a 2  s.c om*/
    }
}