Class ExternalContentPathValidator


  • public class ExternalContentPathValidator
    extends org.fcrepo.kernel.api.utils.AutoReloadingConfiguration
    Validates external content paths to ensure that they are within a configured allowed list of paths.
    Author:
    bbpennel
    • Method Detail

      • validate

        public void validate​(String extPath)
                      throws org.fcrepo.kernel.api.exception.ExternalMessageBodyException
        Validates that an external path is valid. The path must be an HTTP or file URI within the allow list of paths, be absolute, and contain no relative modifier.
        Parameters:
        extPath - external binary path to validate
        Throws:
        org.fcrepo.kernel.api.exception.ExternalMessageBodyException - thrown if the path is invalid.
      • loadConfiguration

        protected void loadConfiguration()
                                  throws IOException
        Loads the allowed list.
        Specified by:
        loadConfiguration in class org.fcrepo.kernel.api.utils.AutoReloadingConfiguration
        Throws:
        IOException - thrown if the allowed list configuration file cannot be read.