Customer Portal

Reading a file from Custom Java Transformer

Comments 2

  • Avatar
    imriskal
    0
    Comment actions Permalink
    First, I recommend using CustomJavaReader instead of CustomJavaTransformer. Examples in the reader component are tailor made for various reading scenarios.

    In CustomJavaReader, you can use this simple syntax:
    InputStream in = getInputStream("data-in/myFile.txt")

    If you want to use a parameter value in the file path, this is the way:
    InputStream in = getInputStream(getGraph().getGraphParameters().getGraphParameter("DATAIN_DIR").getValueResolved(RefResFlag.REGULAR)+"/myFile.txt")
  • Avatar
    pareshjoshi
    0
    Comment actions Permalink
    Great thank you!

Please sign in to leave a comment.