Java 类org.gradle.api.internal.file.copy.CopyActionProcessingStream 实例源码

项目:gradle-gzjar-plugin    文件:GzJarCopyAction.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    ZipOutputStream zipOutStr;

    try {
        zipOutStr = new ZipOutputStream(new FileOutputStream(zipFile));
    } catch (Exception e) {
        throw new GradleException(String.format("Could not create ZIP '%s'.", zipFile), e);
    }

    IoActions.withResource(zipOutStr, new Action<ZipOutputStream>() {
        public void execute(ZipOutputStream outputStream) {
            stream.process(new StreamAction(outputStream));
        }
    });

    return new SimpleWorkResult(true);
}