throw new UnsupportedOperationException();
}
@Override
public ServletInputStream getInputStream() throws IOException {
RawBuffer raw = request.body().asRaw();
byte[] buf;
try {
buf = raw.asBytes();
} catch (NullPointerException e) {
// asBytes() raises NullPointerException if the raw body is larger
// than the limit defined by BodyParser.of annotation at
// SvnApp.service() method.
throw new IOException("Request entity is too large.", e);
}
final InputStream in;
// If the content size is bigger than memoryThreshold, which is defined
// as Integer.MAX_VALUE in play.core.j.JavaParsers.raw method, the
// content is stored as a file.
if (buf != null) {
in = new ByteArrayInputStream(buf);
} else {
File file = raw.asFile();
if (file == null) {
// asFile() may return null if the raw body is larger than the limit defined by
// BodyParser.of annotation at SvnApp.service() method.
throw new IOException("Request entity is too large.");
}