Class SizeLimitedInputStream

java.lang.Object
java.io.InputStream
com.atlassian.confluence.util.http.SizeLimitedInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

@Deprecated(forRemoval=true) public class SizeLimitedInputStream extends InputStream
Deprecated, for removal: This API element is subject to removal in a future version.
since 7.0.1 will be removed in 9.0
This is a wrapper around an InputStream that limits the amount of data that can be returned. This allows admins to set maximum download sizes for Confluence retrieved content, so that people can't, say, point the RSS macro at an ISO file and cause the system to collapse painfully.

If you try to retrieve more than the maximum allowed size, the read() methods will fail with an IOException

  • Constructor Summary

    Constructors
    Constructor
    Description
    SizeLimitedInputStream(InputStream wrappedInputStream, int maxBytesToRead)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    mark(int readlimit)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    skip(long n)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SizeLimitedInputStream

      public SizeLimitedInputStream(InputStream wrappedInputStream, int maxBytesToRead)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • read

      public int read() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • skip

      public long skip(long n) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      skip in class InputStream
      Throws:
      IOException
    • close

      public void close() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException
    • available

      public int available() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      available in class InputStream
      Throws:
      IOException
    • mark

      public void mark(int readlimit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      mark in class InputStream
    • reset

      public void reset() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      reset in class InputStream
      Throws:
      IOException
    • markSupported

      public boolean markSupported()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      markSupported in class InputStream