Builds the File path mapping and add it to the file mappings of the bundle

@param bundle the bundle
@param path the resource path
@param rsHandler the resource reader handler
@return the file path mapping
11253
public static FilePathMapping buildFilePathMapping(JoinableResourceBundle bundle, String path,
			ResourceReaderHandler rsHandler) {

		FilePathMapping fPathMapping = null;
		String filePath = rsHandler.getFilePath(path);
		if(filePath != null){
			
			File f = new File(filePath);
			if(f.exists()){
				fPathMapping = new FilePathMapping(bundle, filePath, f.lastModified());
				if(bundle != null){
					bundle.getLinkedFilePathMappings().add(fPathMapping);
				}
			}else{
				if(LOGGER.isDebugEnabled()){
					LOGGER.debug("The file path '"+filePath+"'  associated to the URL '"+path+"' doesn't exixts.");
				}
			}
		}
		
		return fPathMapping;
	}
619958
public static Resource create(@NotNull ResourceResolver resourceResolver, @Nullable String path, @NotNull String resourceType) {
    return create(resourceResolver, path, resourceType, ValueMap.EMPTY);
  }
711023
@Override
	protected Reader generateResource(String path, GeneratorContext context) {

		Reader reader = null;
		ResourceReaderHandler readerHandler = context.getResourceReaderHandler();

		String skinRootDir = getSkinRootDir(path, skinMapping.keySet());
		Map<String, VariantSet> ctxVariantSetMap = skinMapping.get(skinRootDir);

		String skinVariantPath = path.substring(skinRootDir.length());
		String[] paths = skinVariantPath.split(JawrConstant.URL_SEPARATOR);

		VariantResourceReaderStrategy strategy = getVariantStrategy(context, ctxVariantSetMap);
		Map<String, String> variantMap = null;
		do {
			variantMap = strategy.nextVariantMapConbination();
			if (variantMap != null) {
				JoinableResourceBundle bundle = context.getBundle();
				reader = getResourceReader(bundle, path, readerHandler, skinRootDir, paths, variantMap);
			}
		} while (variantMap != null && reader == null);

		return reader;
	}
85548
private static Bundle _loadBundle(BundleContext context, String path, InputStream is, boolean closeStream) throws BundleException {
	log(Log.LEVEL_INFO, "add bundle:" + path);

	try {
	    // we make this very simply so an old loader that is calling this still works
	    return context.installBundle(path, is);
	}
	finally {
	    // we make this very simply so an old loader that is calling this still works
	    if (closeStream && is != null) {
		try {
		    is.close();
		}
		catch (Throwable t) {
		    ExceptionUtil.rethrowIfNecessary(t);
		}
	    }
	}
    }
469350
@Override
	protected Reader generateResource(String path, GeneratorContext context) {

		Reader reader = helper.createResource(context);

		String filePath = helper.getFilePath(path);
		if (filePath != null) {
			long lastModified = rsHandler.getLastModified(filePath);
			FilePathMapping fMapping = new FilePathMapping(filePath, lastModified);
			addLinkedResources(path, context, Arrays.asList(fMapping));
		}

		return reader;
	}
11196
public function addResource($name, $bundle, $format, $path = 'routing')
    {
        $resource = '@'.$bundle.$path.'.'.$format;
        $yaml = $this->getContent();
        if (!isset($yaml[$name]) || $yaml[$name]['resource'] != $resource) {
            $yaml[$name] = ['resource' => $resource];
            $this->setContent($yaml);
        }
    }
711021
@Deprecated
    public static ResourceHandler.Builder fileHandler(String directoryPath) {
        return fileHandler(Paths.get(directoryPath));
    }
1121829
private void recurse(Bundle bundle, String path, IResourceVisitor visitor, String relPathName) throws IOException {
		Enumeration<?> entries = bundle.findEntries(path, "*", false); //$NON-NLS-1$
		if (entries != null) {
			while (entries.hasMoreElements()) {
				URL child = (URL)entries.nextElement();
				String childPath = child.getPath();
				String temp = childPath;
				if (temp.endsWith("/")) { //$NON-NLS-1$
					temp = temp.substring(0, temp.length()-1);
				}
				int idx = temp.lastIndexOf("/"); //$NON-NLS-1$
				String childName = temp.substring(idx+1);
				String relPath = relPathName
						+ (relPathName.length() == 0 ? "" : "/") //$NON-NLS-1$ //$NON-NLS-2$
						+ childName;
				boolean result = visitor.visitResource(
						new VisitorResource(child, relPath), relPath);
				if (result && child.getPath().endsWith("/")) { //$NON-NLS-1$
					recurse(bundle, childPath, visitor, relPath);
				}
			}
		}
	}
546261
@Override
    public Promise<FileProps> props(String path) {
        return adapter.toPromise(handler -> vertx.fileSystem().props(path, handler));
    }
28206
@Override
	public void streamBundleTo(String bundlePath, OutputStream out) throws ResourceNotFoundException {

		// Remove prefix, which are used only in production mode
		String path = PathNormalizer.removeVariantPrefixFromPath(bundlePath);
		ReadableByteChannel data = null;
		try {
			if (liveProcessBundles.contains(path)) {

				Reader rd = null;
				try {
					rd = resourceBundleHandler.getResourceBundleReader(path);
					StringReader strRd = processInLive(rd);
					StringWriter strWriter = new StringWriter();
					IOUtils.copy(strRd, strWriter);

					ByteArrayOutputStream bos = new ByteArrayOutputStream();
					try (GZIPOutputStream gzOut = new GZIPOutputStream(bos)) {
						byte[] byteData = strWriter.getBuffer().toString().getBytes(config.getResourceCharset().name());
						gzOut.write(byteData, 0, byteData.length);
					}
					ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
					data = Channels.newChannel(bis);
				} finally {
					IOUtils.close(rd);
				}

			} else {
				data = resourceBundleHandler.getResourceBundleChannel(path);
			}

			WritableByteChannel outChannel = Channels.newChannel(out);
			IOUtils.copy(data, outChannel);

		} catch (IOException e) {
			throw new BundlingProcessException("Unexpected IOException writing bundle [" + path + "]", e);
		} finally {
			IOUtils.close(data);
		}
	}
1297159
protected List<RenderedLink> createLinkToBundle(
			ResourceBundlesHandler handler, String path, String resourceType,
			Map<String, String> variantMap) throws IOException {

		ArrayList<RenderedLink> linksToBundle = new ArrayList<RenderedLink>();

		BasicBundleRenderer bundleRenderer = new BasicBundleRenderer(handler,
				resourceType);
		StringWriter sw = new StringWriter();

		// The gzip compression will be made by the CDN server
		// So we force it to false.
		boolean useGzip = false;

		// The generation of bundle is the same in SSL and non SSL mode
		boolean isSslRequest = false;

		// First deals with the production mode
		handler.getConfig().setDebugModeOn(false);
		handler.getConfig().setGzipResourcesModeOn(useGzip);

		BundleRendererContext ctx = new BundleRendererContext("", variantMap,
				useGzip, isSslRequest);
		bundleRenderer.renderBundleLinks(path, ctx, sw);

		// Then take in account the debug mode
		handler.getConfig().setDebugModeOn(true);
		ctx = new BundleRendererContext("", variantMap, useGzip, isSslRequest);
		bundleRenderer.renderBundleLinks(path, ctx, sw);

		List<RenderedLink> renderedLinks = bundleRenderer.getRenderedLinks();
		// Remove context override path if it's defined.
		String contextPathOverride = handler.getConfig()
				.getContextPathOverride();
		for (Iterator<RenderedLink> iterator = renderedLinks.iterator(); iterator
				.hasNext();) {
			RenderedLink renderedLink = iterator.next();
			String renderedLinkPath = renderedLink.getLink();
			// Remove the context path override
			if (StringUtils.isNotEmpty(contextPathOverride)
					&& renderedLinkPath.startsWith(contextPathOverride)) {
				renderedLinkPath = renderedLinkPath
						.substring(contextPathOverride.length());
			}
			renderedLink.setLink(PathNormalizer.asPath(renderedLinkPath));
			linksToBundle.add(renderedLink);
		}

		return linksToBundle;
	}
525691
protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
		linkedResourceMap.put(getResourceCacheKey(path, context), new CopyOnWriteArrayList<>(fMappings));
		JoinableResourceBundle bundle = context.getBundle();
		if (bundle != null) {

			List<FilePathMapping> bundleFMappings = bundle.getLinkedFilePathMappings();
			for (FilePathMapping fMapping : fMappings) {
				FilePathMapping fm = new FilePathMapping(bundle, fMapping.getPath(), fMapping.getLastModified());
				if (!bundleFMappings.contains(fm)) {
					bundleFMappings.add(fm);
				}
			}
		}

	}
1154783
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle) {

		Reader rd = null;
		if (processingBundle) {
			String path = getCssPath(resourceName);
			rd = ((TextResourceReader) resourceReader).getResource(bundle, path, processingBundle);
		}

		return rd;
	}
89078
protected ResourceBundle createResourceBundle (String setType, String path,
        List<ResourceBundle> dlist)
    {
        if (setType.equals(FILE_SET_TYPE)) {
            FileResourceBundle bundle =
                createFileResourceBundle(getResourceFile(path), true, _unpack);
            if (!bundle.isUnpacked() || !bundle.sourceIsReady()) {
                dlist.add(bundle);
            }
            return bundle;
        } else if (setType.equals(NETWORK_SET_TYPE)) {
            return createNetworkResourceBundle(_networkRootPath, path, getResourceList());
        } else {
            throw new IllegalArgumentException("Unknown set type: " + setType);
        }
    }
444453
protected String compile(JoinableResourceBundle bundle, String content, String path, GeneratorContext context) {

		try {
			JawrScssResolver scssResolver = new JawrScssResolver(bundle, rsHandler);
			JawrScssStylesheet sheet = new JawrScssStylesheet(bundle, content, path, scssResolver,
					context.getCharset());
			sheet.compile(urlMode);
			String parsedScss = sheet.printState();
			addLinkedResources(path, context, scssResolver.getLinkedResources());

			return parsedScss;
		} catch (Exception e) {
			throw new BundlingProcessException("Unable to generate content for resource path : '" + path + "'", e);
		}
	}
183748
@Override
	public BundlePathMapping build(List<String> strPathMappings) {

		BundlePathMapping bundlePathMapping = new BundlePathMapping(bundle);
		for (JoinableResourceBundle child : ((CompositeResourceBundle) bundle).getChildBundles()) {
			if (!child.getInclusionPattern().isIncludeOnlyOnDebug()) {
				bundlePathMapping.getItemPathList().addAll(child.getItemPathList());
				addFilePathMapping(bundlePathMapping, child.getItemPathList());
			}

			if (!child.getInclusionPattern().isExcludeOnDebug()) {
				bundlePathMapping.getItemDebugPathList().addAll(child.getItemDebugPathList());
				addFilePathMapping(bundlePathMapping, child.getItemDebugPathList());
			}
			bundlePathMapping.getLicensesPathList().addAll(child.getLicensesPathList());
			addFilePathMapping(bundlePathMapping, child.getLicensesPathList());
		}
		return bundlePathMapping;
	}
1102266
public Javalin put(@NotNull String path, @NotNull Handler handler, @NotNull Set<Role> permittedRoles) {
        return addHandler(HandlerType.PUT, path, handler, permittedRoles);
    }