org.apache.cxf.attachment.As4AttachmentDataSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oxalis-as4 Show documentation
Show all versions of oxalis-as4 Show documentation
Extension adding AS4 support to Oxalis
package org.apache.cxf.attachment;
import lombok.Getter;
import lombok.SneakyThrows;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@Getter
public class As4AttachmentDataSource extends AttachmentDataSource {
List inputStreams = new ArrayList<>();
public As4AttachmentDataSource(String ctParam, InputStream inParam) throws IOException {
super(ctParam, inParam);
}
@Override
public InputStream getInputStream() {
InputStream inputStream = super.getInputStream();
inputStreams.add(inputStream);
return inputStream;
}
public void closeAll() {
inputStreams.forEach(this::close);
}
@SneakyThrows
private void close(InputStream inputStream) {
inputStream.close();
}
}