Derives the resource pattern from the path.

@param path the path
@return the pattern
488675
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
    protected static String derivePattern(String path) {
        String pattern;
        if ("/".equals(path)) {
            pattern = "/**";
        } else {
            String patternBase = path;
            if (patternBase.endsWith("/")) {
                patternBase = path.substring(0, path.length() - 1);
            }
            pattern = path + "," + path + "/**";
        }
        return pattern;
    }
179555
public static Resource getResourceObj(String path) {
		if(StrUtil.isNotBlank(path)) {
			if(path.startsWith(URLUtil.FILE_URL_PREFIX) || FileUtil.isAbsolutePath(path)) {
				return new FileResource(path);
			}
		}
		return new ClassPathResource(path);
	}
488429
public T path(String path) {
        if (path.length() == 0) {
            this.path += encodePath(path);
        } else {
            this.path += "/" + encodePath(path);
        }
        return returnThis();
    }
1004368
public static String convertToUnixStylePath(String path) {
		String retval = StringSupport.replaceAll(path, "\\", "/");
		retval = StringSupport.replaceAll(retval, new String[]{"///", "//"}, new String[]{"/", "/"});
		return retval;
	}
407149
public String getDebugModeGenerationPath(String path) {

		ResourceGenerator resourceGenerator = resolveResourceGenerator(path);
		return resourceGenerator.getDebugModeRequestPath();
	}
625303
public String getStringWithFallback(String path) throws MissingResourceException {
        // Optimized form of getWithFallback(path).getString();
        ICUResourceBundle actualBundle = this;
        String result = findStringWithFallback(path, actualBundle, null);

        if (result == null) {
            throw new MissingResourceException(
                "Can't find resource for bundle "
                + this.getClass().getName() + ", key " + getType(),
                path, getKey());
        }

        if (result.equals(NO_INHERITANCE_MARKER)) {
            throw new MissingResourceException("Encountered NO_INHERITANCE_MARKER", path, getKey());
        }
        return result;
    }
48714
@SuppressWarnings("unchecked")
  public <T> T get(String... path) {
    ExtensionAware root = searchRoot;
    for (String name : path) {
      ExtensionContainer children = root.getExtensions();
      root = (ExtensionAware) children.getByName(name);
    }
    return (T) root; // this is potentially unchecked.
  }
619958
public static Resource create(@NotNull ResourceResolver resourceResolver, @Nullable String path, @NotNull String resourceType) {
    return create(resourceResolver, path, resourceType, ValueMap.EMPTY);
  }
1021602
public static String path( String path ) {
		String pathToBase = getPathToBase();
		if( pathToBase == null )
			return path;
		return new File(pathToBase,path).getAbsolutePath();
	}
864253
@Override
	public Set<String> getResourceNames(String path) {
		return helper.getResourceNames(resolver.getResourcePath(path));
	}
312548
public URL getResource(String path) throws MalformedURLException {
		Result<URL,MalformedURLException> result = getResourceCache.get(path, getResourceRefresher);
		MalformedURLException exception = result.getException();
		if(exception != null) throw exception;
		return result.getValue();
	}
1208009
public String getRealPath(String path)
    {
        if(log.isDebugEnabled())log.debug("getRealPath of "+path+" in "+this);

        if (__Slosh2Slash)
            path=path.replace('\\','/');
        path=URI.canonicalPath(path);
        if (path==null)
            return null;

        Resource baseResource=getHttpContext().getBaseResource();
        if (baseResource==null )
            return null;

        try{
            Resource resource = baseResource.addPath(path);
            File file = resource.getFile();

            return (file==null)?null:(file.getAbsolutePath());
        }
        catch(IOException e)
        {
            log.warn(LogSupport.EXCEPTION,e);
            return null;
        }
    }
150728
@Override
	public Set<String> getResourceNames(String path) {
		path = path.replace('/', File.separatorChar);
		File resource = new File(baseDir, path);
		return FileUtils.getResourceNames(resource);
	}
1312793
public URL getResource(String path) throws MalformedURLException {

		URL url = null;
		File file = new File(baseDir + path);
		if (file.exists()) {
			url = file.toURI().toURL();
		}
		return url;
	}
1059200
@Override
	public Set<InputStream> getResourcesAsStream(final String path) throws IOException
	{
		// First, try the path as specified
		final Set<InputStream> streams = inner.getResourcesAsStream(path);

		// If no results were found and the path was absolute, retry without the leading slash
		if ((streams == null || streams.isEmpty()) && !path.isEmpty() && path.charAt(0) == '/')
		{
			// Strip the leading slash away and re-try the path
			// This lets us
			final String newPath = path.substring(1);

			return inner.getResourcesAsStream(newPath);
		}
		else
		{
			return streams;
		}
	}
1350408
public String fixPathInfo(String path)
    {
        if (path == null)
            return null;
        if (path.startsWith("/"))
            path = path.substring(1);   // Resources already start from root/baseURL
        if (baseURL == null)
            if (properties != null)
                if (this.getProperty(BASE_PATH) != null)
                    path = this.getProperty(BASE_PATH) + path;
        return path;
    }
177036
private static String rewritePath(String path) {
        while (path.startsWith("/")) {
            path = path.substring(1);
        }
        // Note, ClassLoader paths are always absolute, so , so no leading slash
        return "resources/" + path;
    }