de.esprit.appsuite.io

## Class ProgressReader

- java.lang.Object
- - java.io.Reader
  - - java.io.BufferedReader
    - - java.io.LineNumberReader
      - - de.esprit.appsuite.io.ProgressReader

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable
  Direct Known Subclasses:
    DownloadReader

      public class ProgressReader
      extends java.io.LineNumberReader

  This is a `LineNumberReader` that just wraps a `ProgressInputStream`
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class java.io.Reader

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProgressReader(java.io.File file)`
    `ProgressReader(java.io.File file, int buffSize)`
    `ProgressReader(ProgressInputStream inStream)`
    `ProgressReader(ProgressInputStream inStream, int buffSize)`
    `ProgressReader(ResourceInfo resourceInfo)`
    `ProgressReader(ResourceInfo resourceInfo, int buffSize)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `FileInfo` | `getFileInfo()`
    `ProgressInputStream` | `getInputStream()`
    `AsyncExecutable` | `getProgressorTask()` Returns the `AsyncExecutable` which is executing this progress reader.
    `long` | `getReadBytes()`
    `int` | `getReadPercentage()`
    `long` | `getTotalBytes()`
    `boolean` | `isClosed()` Allows to check whether `close()` has yet been called on this stream.
    `void` | `setProgressorTask(AsyncExecutable progressor)` Sets the `AsyncExecutable` which receives PROGRESS notifications.

    - ### Methods inherited from class java.io.LineNumberReader

      `getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip`

    - ### Methods inherited from class java.io.BufferedReader

      `markSupported, ready`

    - ### Methods inherited from class java.io.Reader

      `read, read`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProgressReader

          public ProgressReader(ProgressInputStream inStream,
                        int buffSize)

    - #### ProgressReader

          public ProgressReader(ProgressInputStream inStream)

    - #### ProgressReader

          public ProgressReader(ResourceInfo resourceInfo)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### ProgressReader

          public ProgressReader(ResourceInfo resourceInfo,
                        int buffSize)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### ProgressReader

          public ProgressReader(java.io.File file,
                        int buffSize)
                         throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

    - #### ProgressReader

          public ProgressReader(java.io.File file)
                         throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

  - ### Method Detail

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `java.io.BufferedReader`
      Throws:
        `java.io.IOException`

    - #### isClosed

          public boolean isClosed()

      Allows to check whether `close()` has yet been called on this stream.

    - #### setProgressorTask

          public void setProgressorTask(AsyncExecutable progressor)

      Sets the `AsyncExecutable` which receives PROGRESS notifications. If no progressorTask is set, then no PROGRESS notifications are issued.

    - #### getProgressorTask

          public AsyncExecutable getProgressorTask()

      Returns the `AsyncExecutable` which is executing this progress reader.

    - #### getInputStream

          public ProgressInputStream getInputStream()

    - #### getTotalBytes

          public long getTotalBytes()

    - #### getReadBytes

          public long getReadBytes()

    - #### getReadPercentage

          public int getReadPercentage()

    - #### getFileInfo

          public FileInfo getFileInfo()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.