Class Goldenfile

java.lang.Object
ee.jakarta.tck.ws.rs.common.webclient.Goldenfile

public class Goldenfile extends Object
A representation of a Goldenfile that may be used by a particular test case.
  • Constructor Details

    • Goldenfile

      public Goldenfile(String path, String encoding)
      Creates a new GoldenFile based on the fully qualified filename provided.
      Parameters:
      path - Fully qualified file name
      encoding - to use when reading the goldenfile
  • Method Details

    • getLength

      public long getLength()
      Returns the length of the Goldenfile.
      Returns:
      long length
    • getGoldenFileAsBytes

      public byte[] getGoldenFileAsBytes() throws IOException
      Returns the byte content of the specified goldenfile using the charset encoding specified in the response from the server.
      Returns:
      the goldenfile as a byte array
      Throws:
      IOException - if an error occurs processing the file.
    • getGoldenFileAsString

      public String getGoldenFileAsString() throws IOException
      Retuns a string representation of the specified goldenfile using the charset encoding specified in the response from the server.
      Returns:
      the goldenfile as a String.
      Throws:
      IOException - if an error occurs processing the file.
    • getGoldenFileAsStream

      public InputStream getGoldenFileAsStream() throws IOException
      Returns the goldenfile as an InputStream using the charset encoding specified in the response from the server.
      Returns:
      goldenfile as an InputStream
      Throws:
      IOException - If an error occurs processing the file.