def get(req): param = json.loads(req.body) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) app_iter = s.get() response = Response(app_iter=app_iter,request=req) return req.get_response(response)
def delete(req): param = json.loads(req.body) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) ecode = s.delete() return Response(status=ecode)
def post(req): param = json.loads(req.body) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status = 404) attrs = req.headers ecode = s.setm(attrs) return Response(status=ecode)
def put(): req = request param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5,datatype,fileinput,req.content_length) return Response(status=ecode)
def copy(req): param = json.loads(req.body) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.copy(d) return Response(status = ecode)
def put(req): param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5,datatype,fileinput) return Response(status=ecode)
def post(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) attrs = req.headers ecode = s.setm(attrs) return Response(status=ecode)
def put(): req = request param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5, datatype, fileinput, req.content_length) return Response(status=ecode)
def delete(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) ecode = s.delete() return Response(status=ecode)
def get(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) app_iter = s.get() response = Response(response=app_iter) # return req.get_response(response) return response
def copy(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.copy(d) return Response(status=ecode)
def move(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.move(d) return Response(status=ecode)
def head(req): param = json.loads(req.body) path = path2o(param.get('path')) is_swift = param.get('is_swift') s = FSt(path) ecode = 200 if not s.exists: ecode = 404 return Response(ecode) data = s.getm() if 'true' == is_swift: return Response(status=ecode,headers=data) else: return Response(json.dumps(data),status=ecode)
def head(): req = request param = json.loads(req.data) path = path2o(param.get('path')) is_swift = param.get('is_swift') s = FSt(path) ecode = 200 if not s.exists: ecode = 404 return Response(ecode) data = s.getm() if 'true' == is_swift: return Response(status=ecode, headers=data) else: return Response(response=json.dumps(data), status=ecode)
def url2st(urlObj): return FSt(urlObj.subject)