private static void applyInfo ( final TarArchiveEntry entry, final EntryInformation entryInformation, TimestampProvider timestampProvider ) { if ( entryInformation == null ) { return; } if ( entryInformation.getUser () != null ) { entry.setUserName ( entryInformation.getUser () ); } if ( entryInformation.getGroup () != null ) { entry.setGroupName ( entryInformation.getGroup () ); } entry.setMode ( entryInformation.getMode () ); entry.setModTime ( timestampProvider.getModTime () ); }
private void buildAndAddControlFile () throws IOException, FileNotFoundException { final File controlFile = File.createTempFile ( "control", null ); try { try ( GZIPOutputStream gout = new GZIPOutputStream ( new FileOutputStream ( controlFile ) ); TarArchiveOutputStream tout = new TarArchiveOutputStream ( gout ) ) { tout.setLongFileMode ( TarArchiveOutputStream.LONGFILE_GNU ); addControlContent ( tout, "control", createControlContent (), -1 ); addControlContent ( tout, "md5sums", createChecksumContent (), -1 ); addControlContent ( tout, "conffiles", createConfFilesContent (), -1 ); addControlContent ( tout, "preinst", this.preinstScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "prerm", this.prermScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "postinst", this.postinstScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "postrm", this.postrmScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); } addArFile ( controlFile, "control.tar.gz" ); } finally { controlFile.delete (); } }
if ( entryInformation.isConfigurationFile () )
final EntryInformation ei = new EntryInformation ( fileInformation.getOwner (), fileInformation.getGroup (), fileInformation.getMode (), conf );
private void buildAndAddControlFile () throws IOException, FileNotFoundException { final File controlFile = File.createTempFile ( "control", null ); try { try ( GZIPOutputStream gout = new GZIPOutputStream ( new FileOutputStream ( controlFile ) ); TarArchiveOutputStream tout = new TarArchiveOutputStream ( gout ) ) { tout.setLongFileMode ( TarArchiveOutputStream.LONGFILE_GNU ); addControlContent ( tout, "control", createControlContent (), -1 ); addControlContent ( tout, "md5sums", createChecksumContent (), -1 ); addControlContent ( tout, "conffiles", createConfFilesContent (), -1 ); addControlContent ( tout, "preinst", this.preinstScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "prerm", this.prermScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "postinst", this.postinstScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); addControlContent ( tout, "postrm", this.postrmScript, EntryInformation.DEFAULT_FILE_EXEC.getMode () ); } addArFile ( controlFile, "control.tar.gz" ); } finally { controlFile.delete (); } }
if ( entryInformation.isConfigurationFile () )
final EntryInformation ei = new EntryInformation ( fileInformation.getOwner (), fileInformation.getGroup (), fileInformation.getMode (), conf );
private static void applyInfo ( final TarArchiveEntry entry, final EntryInformation entryInformation, TimestampProvider timestampProvider ) { if ( entryInformation == null ) { return; } if ( entryInformation.getUser () != null ) { entry.setUserName ( entryInformation.getUser () ); } if ( entryInformation.getGroup () != null ) { entry.setGroupName ( entryInformation.getGroup () ); } entry.setMode ( entryInformation.getMode () ); entry.setModTime ( timestampProvider.getModTime () ); }