@ -22,9 +22,9 @@ import java.io.IOException;
import java.io.InputStream ;
import java.io.InputStream ;
import java.io.OutputStream ;
import java.io.OutputStream ;
import java.io.OutputStreamWriter ;
import java.io.OutputStreamWriter ;
import java.time.OffsetDateTime ;
import java.util.Calendar ;
import java.time.ZoneOffset ;
import java.util.Collection ;
import java.util.Collection ;
import java.util.GregorianCalendar ;
import java.util.LinkedHashSet ;
import java.util.LinkedHashSet ;
import java.util.List ;
import java.util.List ;
import java.util.Map ;
import java.util.Map ;
@ -63,11 +63,12 @@ import org.springframework.util.StringUtils;
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Phillip Webb
* @author Phillip Webb
* @author Scott Frederick
* /
* /
class BootZipCopyAction implements CopyAction {
class BootZipCopyAction implements CopyAction {
static final long CONSTANT_TIME_FOR_ZIP_ENTRIES = OffsetDateTime . of ( 1980 , 2 , 1 , 0 , 0 , 0 , 0 , ZoneOffset . UTC )
static final long CONSTANT_TIME_FOR_ZIP_ENTRIES = new GregorianCalendar ( 1980 , Calendar . FEBRUARY , 1 , 0 , 0 , 0 )
. toInstant( ) . toEpochMilli ( ) ;
. getTimeInMillis ( ) ;
private final File output ;
private final File output ;
@ -261,7 +262,7 @@ class BootZipCopyAction implements CopyAction {
if ( parentDirectory ! = null & & this . writtenDirectories . add ( parentDirectory ) ) {
if ( parentDirectory ! = null & & this . writtenDirectories . add ( parentDirectory ) ) {
writeParentDirectoriesIfNecessary ( parentDirectory , time ) ;
writeParentDirectoriesIfNecessary ( parentDirectory , time ) ;
ZipArchiveEntry entry = new ZipArchiveEntry ( parentDirectory + '/' ) ;
ZipArchiveEntry entry = new ZipArchiveEntry ( parentDirectory + '/' ) ;
entry . setUnixMode ( UnixStat . DIR_FLAG ) ;
entry . setUnixMode ( UnixStat . DIR_FLAG | UnixStat . DEFAULT_DIR_PERM ) ;
entry . setTime ( time ) ;
entry . setTime ( time ) ;
this . out . putArchiveEntry ( entry ) ;
this . out . putArchiveEntry ( entry ) ;
this . out . closeArchiveEntry ( ) ;
this . out . closeArchiveEntry ( ) ;
@ -372,7 +373,7 @@ class BootZipCopyAction implements CopyAction {
ZipEntryCustomizer entryCustomizer ) throws IOException {
ZipEntryCustomizer entryCustomizer ) throws IOException {
writeParentDirectoriesIfNecessary ( name , CONSTANT_TIME_FOR_ZIP_ENTRIES ) ;
writeParentDirectoriesIfNecessary ( name , CONSTANT_TIME_FOR_ZIP_ENTRIES ) ;
ZipArchiveEntry entry = new ZipArchiveEntry ( name ) ;
ZipArchiveEntry entry = new ZipArchiveEntry ( name ) ;
entry . setUnixMode ( UnixStat . FILE_FLAG ) ;
entry . setUnixMode ( UnixStat . FILE_FLAG | UnixStat . DEFAULT_FILE_PERM ) ;
entry . setTime ( CONSTANT_TIME_FOR_ZIP_ENTRIES ) ;
entry . setTime ( CONSTANT_TIME_FOR_ZIP_ENTRIES ) ;
entryCustomizer . customize ( entry ) ;
entryCustomizer . customize ( entry ) ;
this . out . putArchiveEntry ( entry ) ;
this . out . putArchiveEntry ( entry ) ;