def METHOD_NAME(self, path, request):
    fn = os.path.join(self.path, path)
    if os.path.isdir(fn):
        return ResourceScriptDirectory(fn, self.registry)
    if os.path.exists(fn):
        return ResourceScript(fn, self.registry)
    return resource._UnsafeNoResource()