use of io.gravitee.policy.api.annotations.OnResponseContent in project gravitee-gateway by gravitee-io.
the class OverrideResponseContentPolicy method onResponseContent.
@OnResponseContent
public ReadWriteStream onResponseContent(Request request) {
return new BufferedReadWriteStream() {
@Override
public SimpleReadWriteStream<Buffer> write(Buffer content) {
// We dot want to get the request content, skipping
return this;
}
@Override
public void end() {
Buffer content = Buffer.buffer(STREAM_POLICY_CONTENT);
// Write content
super.write(content);
// Mark the end of content
super.end();
}
};
}
Aggregations