code: public static Resource from(String resource) {
        if (StringUtils.isNullOrBlank(resource)) {
           return new StringResource();
        }
        Matcher matcher = protocolPattern.matcher(resource);
        if (matcher.find()) {
           String schema = matcher.group("PROTOCOL");
           String options = matcher.group("OPTIONS");
           String path = matcher.group("PATH");
  
           if (StringUtils.isNullOrBlank(options)) {
              options = "";
           } else {
              options = options.replaceFirst("\\[", "").replaceFirst("\\]$", "");
           }
           ResourceProvider provider = resourceProviders.get(schema.toLowerCase());
  
  
           if (provider == null) {
              try {
                 return new URIResource(new URI(resource));
              } catch (URISyntaxException e) {
                 throw new IllegalStateException(schema + " is an unknown protocol.");
              }
           }
  
  
           if (provider.requiresProtocol()) {
              path = schema + ":" + path;
           }
  
           return provider.createResource(path, Val.of(options).asMap(String.class, String.class));
        }
  
        return new FileResource(resource);
     }
docs: Constructs a resource from a string representation. Defaults to a file based resource if no schema is present.
  
  @param resource The string representation of the resource
  @return A resource representing the string representation