code: public void validate(final String extPath) throws ExternalMessageBodyException {
          if (allowedList == null || allowedList.size() == 0) {
              throw new ExternalMessageBodyException("External content is disallowed by the server");
          }
  
          if (isEmpty(extPath)) {
              throw new ExternalMessageBodyException("External content path was empty");
          }
  
          final String path = normalizePath(extPath.toLowerCase());
  
          final URI uri;
          try {
              // Ensure that the path is a valid URL
              uri = new URI(path);
              uri.toURL();
          } catch (final Exception e) {
              throw new ExternalMessageBodyException("Path was not a valid URI: " + extPath);
          }
  
          // Decode the uri and ensure that it does not contain modifiers
          final String decodedPath = uri.getPath();
          if (RELATIVE_MOD_PATTERN.matcher(decodedPath).matches()) {
              throw new ExternalMessageBodyException("Path was not absolute: " + extPath);
          }
  
          // Require that the path is absolute
          if (!uri.isAbsolute()) {
              throw new ExternalMessageBodyException("Path was not absolute: " + extPath);
          }
  
          // Ensure that an accept scheme was provided
          final String scheme = uri.getScheme();
          if (!ALLOWED_SCHEMES.contains(scheme)) {
              throw new ExternalMessageBodyException("Path did not provide an allowed scheme: " + extPath);
          }
  
          // If a file, verify that it exists
          if (scheme.equals("file") && !Paths.get(uri).toFile().exists()) {
              throw new ExternalMessageBodyException("Path did not match any allowed external content paths: " +
                      extPath);
          }
  
          // Check that the uri is within an allowed path
          if (allowedList.stream().anyMatch(allowed -> path.startsWith(allowed))) {
              return;
          }
          throw new ExternalMessageBodyException("Path did not match any allowed external content paths: " + extPath);
      }
docs: 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.
  
  @param extPath external binary path to validate
  @throws ExternalMessageBodyException thrown if the path is invalid.