Class MaxUploadSizeInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.BoundedInputStream
net.solarnetwork.central.web.MaxUploadSizeInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class MaxUploadSizeInputStream extends org.apache.commons.io.input.BoundedInputStream
Bounded input stream that throws a when reading beyond the configured maximum length.
  • Constructor Details

    • MaxUploadSizeInputStream

      public MaxUploadSizeInputStream(InputStream inputStream, long maxLength)
      Constructor.
      Parameters:
      inputStream - the stream to wrap
      maxLength - the maximum length
  • Method Details

    • onMaxLength

      protected void onMaxLength(long maxLength, long count) throws IOException
      Overrides:
      onMaxLength in class org.apache.commons.io.input.BoundedInputStream
      Throws:
      IOException