I'm trying to load the contents of a file into an attribute and preface it with "Bearer ". This is how far I got:
def flowFile = session.get();
if (flowFile != null) {
def token = flowFile.getAttribute("token")
def message = "Bearer " + token
flowFile = session.putAttribute(flowFile, "message", message)
session.transfer(flowFile, REL_SUCCESS)
}
However I'm stuck trying to load file contents rather than using .getattribute. Can anyone please help me?
EDIT: To confirm, this is to load the contents of a txt file.