

@wsgify
def __call__(self, req):
    path = os.path.abspath(os.path.join(self.path, req.path_info.lstrip('/')))
    if (os.path.isdir(path) and self.index_page):
        return self.index(req, path)
    if (self.index_page and self.hide_index_with_redirect and path.endswith((os.path.sep + self.index_page))):
        new_url = req.path_url.rsplit('/', 1)[0]
        new_url += '/'
        if req.query_string:
            new_url += ('?' + req.query_string)
        return Response(status=301, location=new_url)
    if (not os.path.isfile(path)):
        return exc.HTTPNotFound(comment=path)
    elif (not path.startswith(self.path)):
        return exc.HTTPForbidden()
    else:
        return self.make_fileapp(path)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webob-1.2.3/webob/static.py DirectoryApp.__call__/original