org.apache.jmeter.report.core

## Class CsvSampleReader

- java.lang.Object
- - org.apache.jmeter.report.core.CsvSampleReader

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class CsvSampleReader
      extends java.lang.Object
      implements java.io.Closeable

  Reader class for reading CSV files.

  Handles `SampleMetadata` reading and sample extraction.

  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CsvSampleReader(java.io.File inputFile, char separator, boolean useSaveSampleCfg)` Instantiates a new csv sample reader.
    `CsvSampleReader(java.io.File inputFile, SampleMetadata metadata)` Instantiates a new csv sample reader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `SampleMetadata` | `getMetadata()`
    `boolean` | `hasNext()`
    `Sample` | `peek()`
    `Sample` | `readSample()`

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

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

- - ### Constructor Detail

    - #### CsvSampleReader

          public CsvSampleReader(java.io.File inputFile,
                                 char separator,
                                 boolean useSaveSampleCfg)

      Instantiates a new csv sample reader.
      Parameters:
        `inputFile` - the input file (must not be `null`)
        `separator` - the separator
        `useSaveSampleCfg` - indicates whether the reader uses jmeter SampleSaveConfiguration to define metadata

    - #### CsvSampleReader

          public CsvSampleReader(java.io.File inputFile,
                                 SampleMetadata metadata)

      Instantiates a new csv sample reader.
      Parameters:
        `inputFile` - the input file (must not be `null`)
        `metadata` - the metadata

  - ### Method Detail

    - #### getMetadata

          public SampleMetadata getMetadata()

    - #### readSample

          public Sample readSample()

      Returns:
        next sample from the file.

    - #### peek

          public Sample peek()

      Returns:
        next sample from file but keep the reading file position.

    - #### hasNext

          public boolean hasNext()

      Returns:
        flag, that indicates whether the file contains more samples

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.