@Test public void testAddEntryAndWrite() throws IOException { CompressionProvider provider = outStream.getCompressionProvider(); ByteArrayOutputStream out = new ByteArrayOutputStream(); outStream = new ZIPCompressionOutputStream( out, provider ); outStream.addEntry( "./test.zip", null ); outStream.write( "Test".getBytes() ); }
@Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Kettle" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); }
ZIPCompressionOutputStream extends CompressionOutputStream { @Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Kettle" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); } }
ZIPCompressionOutputStream extends CompressionOutputStream { @Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Kettle" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); } ZIPCompressionOutputStream( OutputStream out, CompressionProvider provider ); }
ZIPCompressionOutputStream extends CompressionOutputStream { @Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Kettle" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); } ZIPCompressionOutputStream( OutputStream out, CompressionProvider provider ); @Override void close(); @Override void addEntry( String filename, String extension ); }
ZIPCompressionOutputStream extends CompressionOutputStream { @Override public void addEntry( String filename, String extension ) throws IOException { int index = filename.lastIndexOf( Const.FILE_SEPARATOR ); String entryPath; if ( index != -1 ) { entryPath = filename.substring( index + 1 ); } else { entryPath = filename; } index = entryPath.toLowerCase().lastIndexOf( ".zip" ); if ( index != -1 ) { entryPath = entryPath.substring( 0, index ) + entryPath.substring( index + ".zip".length() ); } if ( !Utils.isEmpty( extension ) ) { entryPath += "." + extension; } ZipEntry zipentry = new ZipEntry( entryPath ); zipentry.setComment( "Compressed by Kettle" ); ( (ZipOutputStream) delegate ).putNextEntry( zipentry ); } ZIPCompressionOutputStream( OutputStream out, CompressionProvider provider ); @Override void close(); @Override void addEntry( String filename, String extension );  }