class AcmFileSystemResourceFactory implements ResourceFactory {

    @Override
    public Resource getResource(String host, String path) throws NotAuthorizedException, BadRequestException
    {
        log.trace("host: {}, path: {}", host, path);

        // if the path does not end in some-number.some-extension let's suppose it is an OPTIONS request.

        Matcher m = realDocumentUrl.matcher(path);
        if (m.matches())
        {
            log.debug("The path {} seems to be a real file request", path);
            String noExtensionPath = removeFileExtension(path);
            String strippedPath = noExtensionPath.substring(path.indexOf(filterMapping) + filterMapping.length());
            if (strippedPath.endsWith("/"))
            {
                strippedPath = strippedPath.substring(0, strippedPath.length() - 1);
            }

            log.trace("stripped path: {}", strippedPath);

            ResourceHandler handler = getResourceHandler(strippedPath);
            return handler.getResource(host, strippedPath);
        }
        else
        {
            log.debug("The path {} seems to be an list folder structure request or OPTIONS request", path);
            // FIXME return always root folder, we should fix this to return correct folder, but since url consists of
            // "/" it will be hard to implement
            if (acmRootResource == null)
            {
                acmRootResource = new AcmRootResource(this);
            }
            return acmRootResource;
        }
    }

}