jython2.7 创建本地文件目录
创建本地文件目录
1 import os 2 import uuid 3 def mkdir(path): 4 folder = os.path.exists(path) 5 if not folder: 6 os.makedirs(path) 7 try: 8 flowFile = session.get() 9 sharePath = flowFile.getAttribute('共享目录'.decode('utf8')) 10 filePath = flowFile.getAttribute('目录路径'.decode('utf8')) 11 attrName = flowFile.getAttribute('存放属性名'.decode('utf8')) 12 dir = filePath+str(uuid.uuid1()) 13 mkdir(sharePath+dir) 14 flowFile = session.putAttribute(flowFile, attrName, dir) 15 session.transfer(flowFile, REL_SUCCESS) 16 except: 17 session.transfer(flowFile, REL_FAILURE)
做你说过的 说你能做的;