import json
import java.io
from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import StreamCallback
from org.apache.nifi.processor.exception import ProcessException
class PPutfile(StreamCallback):
def __init__(self):
pass
def process(self,inputStream,outputStream):
text = IOUtils.toString(inputStream,StandardCharsets.UTF_8)
f.write(text)
flowfile = session.get()
try:
if (flowfile != None):
filename = flowfile.getAttribute("filename")
f = open("E:\\fdata\\t"+filename,'a+')
flowfile = session.write(flowfile,PPutfile())
f.close()
session.transfer(flowfile, REL_SUCCESS)
except:ProcessException
求职呀。。。。。。。。应届生 qq微信:1255745139