Initialize the map which links path to asset bundle

@param bundles
the list of bundles
@throws IOException
if an {@link IOException} occurs
180122
public synchronized void initPathToResourceBundleMap(List<JoinableResourceBundle> bundles) throws IOException {

		for (JoinableResourceBundle bundle : bundles) {

			// Remove bundle reference from existing mapping if exists
			removePathMappingFromPathMap(bundle);

			List<PathMapping> mappings = bundle.getMappings();
			for (PathMapping pathMapping : mappings) {
				register(pathMapping);
			}

			// Register file path mapping for linked resources
			List<FilePathMapping> fMappings = bundle.getLinkedFilePathMappings();
			for (FilePathMapping fMapping : fMappings) {
				register(fMapping);
			}
		}
	}
943525
@Override
	public void writeBundleTo(String bundlePath, Writer writer) throws ResourceNotFoundException {

		Reader rd = null;

		try {

			// If debug mode is on, resources are retrieved one by one.
			if (config.isDebugModeOn()) {

				rd = resourceHandler.getResource(null, bundlePath);
			} else {

				for (String prefix : bundlePrefixes) {
					if (bundlePath.startsWith(prefix)) {
						bundlePath = bundlePath.substring(prefix.length());
						break;
					}
				}

				// Prefixes are used only in production mode
				String path = PathNormalizer.removeVariantPrefixFromPath(bundlePath);
				rd = resourceBundleHandler.getResourceBundleReader(path);
				if (liveProcessBundles.contains(path)) {
					rd = processInLive(rd);
				}
			}

			IOUtils.copy(rd, writer);
			writer.flush();
		} catch (IOException e) {
			throw new BundlingProcessException("Unexpected IOException writing bundle[" + bundlePath + "]", e);
		} finally {
			IOUtils.close(rd);
			IOUtils.close(writer);
		}
	}
257120
public void registerDwBundles(final List<GuiceyBundle> bundles) {
        setScope(ConfigScope.DropwizardBundle.getType());
        for (GuiceyBundle bundle : bundles) {
            register(ConfigItem.Bundle, bundle);
        }
        closeScope();
        lifecycle().bundlesFromDwResolved(bundles);
    }
1103428
public void load() throws IOException {
        if (resource.toExternalForm().endsWith(".xml")) {
            // XML Format
            bundle = new XMLResourceBundle(resource.openStream());
        } else {
            // Properties file (loaded using UTF-8)
            bundle = new UTF8PropertiesResourceBundle(resource.openStream());
        }

        if (bundle.keySet().isEmpty()) {
            throw new IOException(resource.toExternalForm() + " is not a valid resource - no keys");
        }
    }
261339
public static void init(Map configProperties){
		if(configProperties != null && configProperties.size() > 0){
			ElasticSearchPropertiesFilePlugin.configProperties = configProperties;
			initType = 1;
		}
	}
570870
protected final void addBundleToMap(String bundleId, String mapping) throws DuplicateBundlePathException {

		for (JoinableResourceBundle bundle : currentBundles) {
			if (bundleId.equals(bundle.getId()) || this.bundleMapping.containsKey(bundleId)) {
				Marker fatal = MarkerFactory.getMarker("FATAL");
				LOGGER.error(fatal, "Duplicate bundle id resulted from mapping:" + bundleId);
				throw new DuplicateBundlePathException(bundleId);
			}
		}

		bundleMapping.put(bundleId, mapping);
	}
961500
protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
        ResourceBundle bundle)
    {
        try {
            TileSetBundle tsb = BundleUtil.extractBundle(bundle);
            // initialize it and add it to the list
            tsb.init(bundle);
            addBundle(idmap, namemap, tsb);

        } catch (Exception e) {
            log.warning("Unable to load tileset bundle '" + BundleUtil.METADATA_PATH +
                        "' from resource bundle [rbundle=" + bundle + "].", e);
        }
    }
245422
protected void initBundlePrefixes() {
		bundlePrefixes = new CopyOnWriteArrayList<>();
		for (JoinableResourceBundle bundle : globalBundles) {
			if (StringUtils.isNotEmpty(bundle.getBundlePrefix())) {
				bundlePrefixes.add(bundle.getBundlePrefix());
			}
		}
		for (JoinableResourceBundle bundle : contextBundles) {
			if (StringUtils.isNotEmpty(bundle.getBundlePrefix())) {
				bundlePrefixes.add(bundle.getBundlePrefix());
			}
		}
	}
788567
protected void initBundles (ResourceManager rmgr, String name)
    {
        // first we obtain the resource set from which we will load up our
        // tileset bundles
        ResourceBundle[] rbundles = rmgr.getResourceSet(name);

        // sanity check
        if (rbundles == null) {
            log.warning("Unable to fetch tileset resource set " +
                        "[name=" + name + "]. Perhaps it's not defined " +
                        "in the resource manager config?");
            return;
        }

        HashIntMap<TileSet> idmap = new HashIntMap<TileSet>();
        HashMap<String, Integer> namemap = Maps.newHashMap();

        // iterate over the resource bundles in the set, loading up the
        // tileset bundles in each resource bundle
        for (ResourceBundle rbundle : rbundles) {
            addBundle(idmap, namemap, rbundle);
        }

        // fill in our bundles array and wake up any waiters
        synchronized (this) {
            _idmap = idmap;
            _namemap = namemap;
            notifyAll();
        }
    }
1300788
@Override
	public void initAllBundles() {

		stopProcessIfNeeded();

		if (config.getUseBundleMapping()) {
			bundleMapping = resourceBundleHandler.getJawrBundleMapping();
		}

		boolean mappingFileExists = resourceBundleHandler.isExistingMappingFile();
		boolean processBundleFlag = !config.getUseBundleMapping() || !mappingFileExists;

		StopWatch stopWatch = ThreadLocalJawrContext.getStopWatch();

		List<JoinableResourceBundle> bundleToProcess = this.bundles;
		boolean forceStoreJawrBundleMapping = false;
		if (!processBundleFlag) {
			String storeJawrConfigHashcode = resourceBundleHandler.getJawrBundleMapping()
					.getProperty(JawrConstant.JAWR_CONFIG_HASHCODE);
			String jawrConfigHashcode = getJawrConfigHashcode();
			boolean rebuildAllBundles = !config.getUseSmartBundling()
					|| (!jawrConfigHashcode.equals(storeJawrConfigHashcode));
			if (!rebuildAllBundles) {
				bundleToProcess = getBundlesToRebuild();
				if (!bundleToProcess.isEmpty() && LOGGER.isDebugEnabled()) {

					StringBuilder msg = new StringBuilder(
							"Jawr has detect changes on the following bundles, which will be updated :\n");
					for (JoinableResourceBundle b : bundleToProcess) {
						msg.append(b.getName()).append("\n");
					}
					LOGGER.debug(msg.toString());
				}
			} else {
				bundleMapping.clear();
				if (LOGGER.isDebugEnabled() && !jawrConfigHashcode.equals(storeJawrConfigHashcode)) {
					LOGGER.debug("Jawr config has changed since last bundling process. All bundles will be processed.");
				}
			}

			forceStoreJawrBundleMapping = !bundleToProcess.isEmpty();
		}

		// Execute processing
		build(bundleToProcess, forceStoreJawrBundleMapping, stopWatch);
	}
958055
@Override
	public void initialize(Map<String, Object> properties) throws IOException {
		for(int index = elements.size() - 1; index >= 0; index--) {
			ITemplateProviderElement provider = elements.get(index);
			if(coreLogger.isTraceEnabled()) coreLogger.trace(Logs.LOG_02,
					ansiString(GREEN, provider.getClass().getSimpleName()),
					ansiString(GREEN, provider.getOrder())
			);
			Map<String, String> providerProperties = provider.initialize();
			if(providerProperties != null) {
				properties.putAll(providerProperties);
				properties.put(provider.getScope(), Collections.unmodifiableMap(providerProperties));
			}
		}
	}
1034079
private void init() {
		Collection<String> paths = StringSupport.split(classpath, ";:", false);

		for (String location : paths) {

			location = FileSupport.convertToUnixStylePath(location);
			if (location.endsWith(".zip") || location.endsWith(".jar")) {
				mapFilesInZip(location);
			} else {
				File dir = new File(location);
				if (dir.isDirectory()) {
					if (!location.endsWith("/")) {
						location += '/';
					}
					Collection<File> classFiles = FileSupport.getFilesInDirectoryTree(dir);
					for (File file : classFiles) {
						String fileName = file.getPath();
						if ((fileName.endsWith(".jar") || fileName.endsWith(".zip")) && !file.isHidden()) {
							mapFilesInZip(fileName);
						} else { // .class .properties etc.
							mapClassResourceEntry(file.getPath().substring(location.length()), file);
							fileCreationTimes.put(file, new Long(file.lastModified()));
						}
					}
				} else {
					//path can not be mapped
				}
			}
		}
	}
879381
private void register(PathMapping pathMapping) throws IOException {

		GeneratorRegistry generatorRegistry = bundlesHandler.getConfig().getGeneratorRegistry();
		List<PathMapping> mappings = new ArrayList<>();
		if (generatorRegistry.isPathGenerated(pathMapping.getPath())) {
			List<PathMapping> genPathMappings = generatorRegistry.getGeneratedPathMappings(pathMapping.getBundle(),
					pathMapping.getPath(), rsReader);
			if (genPathMappings != null) {
				mappings.addAll(genPathMappings);
			} else {
				mappings.add(pathMapping);
			}
		} else {
			mappings.add(pathMapping);
		}

		for (PathMapping pMapping : mappings) {
			String filePath = rsReader.getFilePath(pMapping.getPath());
			registerPathMapping(pMapping, filePath);
		}
	}
151501
private void initFileSystem() throws IOException {
		if (fs == null) {
			Path path = new Path(basePath);
			fs = createHadoopFileSystem(path, fsConfig);
		}
	}
107257
@Override
	public void storeBundle(String bundleName, JoinableResourceBundleContent bundleResourcesContent) {

		// Text version
		String bundleContent = bundleResourcesContent.getContent().toString();
		storeBundle(bundleName, bundleContent, false, textDirPath);

		// binary version
		storeBundle(bundleName, bundleContent, true, gzipDirPath);
	}
668880
private void startAsset(final String path, final Asset asset) throws IOException {
        putNextEntry(outputStream, path, asset);
    }
609985
public void setBundleIds(java.util.Collection<String> bundleIds) {
        if (bundleIds == null) {
            this.bundleIds = null;
            return;
        }

        this.bundleIds = new com.amazonaws.internal.SdkInternalList<String>(bundleIds);
    }