def do_GET(self, serv):
    qs = get_qs(serv.path)
    if (('name' not in qs) or ('accessToken' not in qs) or (('path' not in qs) and ('id' not in qs))):
        serv.send_error(400)
        return
    if ('..' in qs['name'][0]):
        serv.send_error(403)
        return
    tok = qs['accessToken'][0]
    userid = do_auth(tok)
    if (userid == None):
        serv.send_error(401)
        return
    if ('id' in qs):
        folderid = publicid_to_fileid(qs['id'][0])
    else:
        folderid = qs['path'][0]
    if (folderid == None):
        serv.send_error(400)
        return
    path = local_to_real(((folderid + '/') + qs['name'][0]))
    print('PATH', path, exists(path))
    if exists(path):
        serv.send_error(400)
        return
    os.makedirs(path)
    body = json.dumps({'success': True})
    body = bstr(body)
    serv.gen_headers('GET', len(body), json_mimetype)
    serv.wfile.write(body)
def do_GET(self, serv):
    qs = get_qs(serv.path)
    if (('name' not in qs) or ('accessToken' not in qs) or (('path' not in qs) and ('id' not in qs))):
        serv.send_error(400)
        return
    if ('..' in qs['name'][0]):
        serv.send_error(403)
        return
    tok = qs['accessToken'][0]
    userid = do_auth(tok)
    if (userid == None):
        serv.send_error(401)
        return
    if ('id' in qs):
        folderid = publicid_to_fileid(qs['id'][0])
    else:
        folderid = qs['path'][0]
    if (folderid == None):
        serv.send_error(400)
        return
    path = local_to_real(((folderid + '/') + qs['name'][0]))
    print('PATH', path, exists(path))
    if exists(path):
        serv.send_error(400)
        return
    os.makedirs(path)
    body = json.dumps({'success': True})
    body = bstr(body)
    serv.gen_headers('GET', len(body), json_mimetype)
    serv.wfile.write(body)