[ 
https://issues.apache.org/jira/browse/NIFI-13850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Stieglitz updated NIFI-13850:
------------------------------------
    Description: 
Some examples
* Use Files.readString(somePath) instead of new 
String(Files.readAllBytes(somePath))
* Use flowFile.getFirst() instead of flowFile.get(0)
* Use Path for runner.enqueue instead of Inputstream to to replace try( 
Files.newInputstream instead of InputStream is = new FileInputStream)
* Use flowFile.getFirst().getContent().split("\n")  instead of new 
String(runner.getContentAsByteArray(flowFile.get(0)))).split("\n")

  was:
Some examples
* Use Files.readString(somePath) instead of new 
String(Files.readAllBytes(somePath))
* Use flowFile.getFirst() instead of flowFile.get(0)
* Use Files.newInputstream instead of InputStream is = new FileInputStream
* Use flowFile.getFirst().getContent().split("\n")  instead of new 
String(runner.getContentAsByteArray(flowFile.get(0)))).split("\n")


> Simplify TestXMLReader 2.x with Java 21 constructs and NIFI MockFlowFile 
> methods
> --------------------------------------------------------------------------------
>
>                 Key: NIFI-13850
>                 URL: https://issues.apache.org/jira/browse/NIFI-13850
>             Project: Apache NiFi
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M4
>            Reporter: Daniel Stieglitz
>            Assignee: Daniel Stieglitz
>            Priority: Minor
>
> Some examples
> * Use Files.readString(somePath) instead of new 
> String(Files.readAllBytes(somePath))
> * Use flowFile.getFirst() instead of flowFile.get(0)
> * Use Path for runner.enqueue instead of Inputstream to to replace try( 
> Files.newInputstream instead of InputStream is = new FileInputStream)
> * Use flowFile.getFirst().getContent().split("\n")  instead of new 
> String(runner.getContentAsByteArray(flowFile.get(0)))).split("\n")



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to