Load a set of configured emitters into a single system

@param ref
The reference to the XML file (file or classpath)
@param mask
@return A configured particle system
@throws IOException
Indicates a failure to find, read or parse the XML file
514573
public static ParticleSystem loadConfiguredSystem(String ref, Color mask)
			throws IOException {
		return loadConfiguredSystem(ResourceLoader.getResourceAsStream(ref),
            null, null, mask);
	}
645608
public static <T extends RefCounted<T>> Refs<T> tryRef(Iterable<T> reference)
    {
        HashMap<T, Ref<T>> refs = new HashMap<>();
        for (T rc : reference)
        {
            Ref<T> ref = rc.tryRef();
            if (ref == null)
            {
                release(refs.values());
                return null;
            }
            refs.put(rc, ref);
        }
        return new Refs<T>(refs);
    }
743480
static IdentityTemplateLibrary load(InputStream in) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String line = null;
        IdentityTemplateLibrary library = new IdentityTemplateLibrary();
        while ((line = br.readLine()) != null) {
            // skip comments
            if (line.charAt(0) == '#') continue;
            library.add(decodeEntry(line));
        }
        return library;
    }
20713
protected void setXaResourceFactory(ServiceReference<ResourceFactory> ref) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "setXaResourceFactory, ref " + ref);

        _xaResourceFactoryReady = true;

        if (ableToStartRecoveryNow()) {
            // Can start recovery now
            try {
                startRecovery();
            } catch (Exception e) {
                FFDCFilter.processException(e, "com.ibm.tx.jta.util.impl.TxTMHelper.setXaResourceFactory", "148", this);
            }
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "setXaResourceFactory");
    }
213953
public static ConfigurableEmitter loadEmitter(String ref)
			throws IOException {
		return loadEmitter(ResourceLoader.getResourceAsStream(ref), null);
	}
894282
private Object getTarget(Map<String, Command> references) throws Exception
	{
		if (target == null)
		{
			if (isReference())
			{
				Command cmd = references.get(getAttr("idref")); //$NON-NLS-1$
				target = (cmd != null) ? cmd.getResultValue() : null;
			}
			else if (isExecutable())
			{
				String className = null;

				if (isPrimitive())
				{
					className = getPrimitiveClassName(tagName);
				}
				else if (isTag("class")) { //$NON-NLS-1$
					className = getPrimitiveClassName(tagName);
				}
				else if (isConstructor() || isStaticMethod() || isField())
				{
					className = getAttr("class"); //$NON-NLS-1$
				}
				else if (isArray())
				{
					className = getAttr("class"); //$NON-NLS-1$
					Class<?> componentType = isPrimitiveClassName(className) ? getPrimitiveClass(className) : Class.forName(className, true, Thread
							.currentThread().getContextClassLoader());
					className = Array.newInstance(componentType, 0).getClass().getName();
				}

				if (className != null)
				{
					try
					{
						target = Class.forName(className, true, Thread.currentThread().getContextClassLoader());
					}
					catch (ClassNotFoundException e)
					{
						target = Class.forName(className);
					}

					if (isField())
					{
						String fieldName = getAttr("field"); //$NON-NLS-1$
						target = ((Class<?>) target).getField(fieldName);
					}
				}
				else
				{
					throw new Exception(Messages.getString("beans.42", className)); //$NON-NLS-1$
				}
			}
			else if (ctx.isArray())
			{
				// target = ctx.getTarget(references);
				target = Class.forName("java.lang.reflect.Array"); //$NON-NLS-1$
			}
		}
		return target;
	}
1083651
public static Config loadStormConfig(File targetFile) throws IOException
    {
        Map<String, Object> yamlConfig = readYaml(targetFile);
        Config stormConf = convertYamlToStormConf(yamlConfig);

        // For track update config, has init file path.
        if (stormConf.containsKey(INIT_CONFIG_KEY) == false)
        {
            String absolutePath = targetFile.getAbsolutePath();
            stormConf.put(INIT_CONFIG_KEY, absolutePath);
        }

        return stormConf;
    }
638988
public static JSONObjectException wrapWithPath(Throwable src, Reference ref)
    {
        JSONObjectException jme;
        if (src instanceof JSONObjectException) {
            jme = (JSONObjectException) src;
        } else {
            String msg = src.getMessage();
            if (msg == null || msg.length() == 0) {
                msg = "(was "+src.getClass().getName()+")";
            }
            jme = new JSONObjectException(msg, null, src);
        }
        jme.prependPath(ref);
        return jme;
    }
356908
private static List<TransformationDescription> loadDescrtipionsFromXMLInputSource(InputSource source,
            String fileName) throws Exception {
        XMLReader xr = XMLReaderFactory.createXMLReader();
        TransformationDescriptionXMLReader reader = new TransformationDescriptionXMLReader(fileName);
        xr.setContentHandler(reader);
        xr.parse(source);
        return reader.getResult();
    }
700713
public void loadLibrary(Resolver resolver, Node base, Node descriptor, Node properties) throws IOException {
        Source source;
        Module module;
        Library library;
        File file;

        addReload(descriptor);
        source = Source.load(properties, base);
        library = (Library) Library.TYPE.loadXml(descriptor).get();
        autoFiles(resolver, library, source);
        for (net.oneandone.jasmin.descriptor.Module descriptorModule : library.modules()) {
            module = new Module(descriptorModule.getName(), source);
            notLinked.put(module, descriptorModule.dependencies());
            for (Resource resource : descriptorModule.resources()) {
                file = resolver.resolve(source.classpathBase, resource);
                addReload(file);
                resolver.resolve(source.classpathBase, resource);
                module.files().add(file);
            }
            add(module);
        }
    }
254069
private ProfileFileElement loadProfileFile(Path base, String path) throws IOException {
    Source source = source(base, path);
    if (source == null) return null;
    try {
      Location location = Location.get(base.toString(), path);
      String data = Okio.buffer(source).readUtf8();
      return new ProfileParser(location, data).read();
    } catch (IOException e) {
      throw new IOException("Failed to load " + source + " from " + base, e);
    } finally {
      source.close();
    }
  }
325169
public static ArrayList<MtasTreeHit<?>> searchMtasTree(int position,
      IndexInput in, long ref, long objectRefApproxOffset) throws IOException {
    return searchMtasTree(position, position, in, ref, objectRefApproxOffset);
  }
863477
@Override
    public LoadedResource<Templates> loadResource(Resource resource) throws IOException {
        final TransformerFactory transformerFactory = TransformerFactory.newInstance();

        if (this.transformerAttributes != null) {
            for (final Map.Entry<String, Object> attributeEntry :
                    this.transformerAttributes.entrySet()) {
                transformerFactory.setAttribute(attributeEntry.getKey(), attributeEntry.getValue());
            }
        }

        final ResourceTrackingURIResolver uriResolver =
                new ResourceTrackingURIResolver(this.resourceLoader);
        transformerFactory.setURIResolver(uriResolver);

        final URI uri = resource.getURI();
        final String systemId = uri.toString();

        final InputStream stream = resource.getInputStream();
        final Templates templates;
        try {
            final StreamSource source = new StreamSource(stream, systemId);
            templates = transformerFactory.newTemplates(source);
        } catch (TransformerConfigurationException e) {
            throw new IOException("Failed to parse stream into Templates", e);
        } finally {
            IOUtils.closeQuietly(stream);
        }

        final Map<Resource, Long> resolvedResources = uriResolver.getResolvedResources();

        return new LoadedResourceImpl<Templates>(templates, resolvedResources);
    }
1032789
private Map<String, Reference> getReferences(ReadGroupSet readGroupSet) 
      throws IOException, GeneralSecurityException {
    Set<String> referenceSetIds = Sets.newHashSet();
    if (!Strings.isNullOrEmpty(readGroupSet.getReferenceSetId())) {
      LOG.info("Found reference set from read group set: " + 
          readGroupSet.getReferenceSetId());
      referenceSetIds.add(readGroupSet.getReferenceSetId());
    }
    if (readGroupSet.getReadGroups() != null) {
      LOG.info("Found read groups");
      for (ReadGroup readGroup : readGroupSet.getReadGroups()) {
        if (!Strings.isNullOrEmpty(readGroup.getReferenceSetId())) {
          LOG.info("Found reference set from read group: " + 
              readGroup.getReferenceSetId());
          referenceSetIds.add(readGroup.getReferenceSetId());
        }
      }
    }
    
    Map<String, Reference> references = Maps.newHashMap();
    for (String referenceSetId : referenceSetIds) {
      LOG.info("Getting reference set " + referenceSetId);
      ReferenceSet referenceSet = getApi().referencesets().get(referenceSetId).execute();
      if (referenceSet == null || referenceSet.getReferenceIds() == null) {
        continue;
      }
      for (String referenceId : referenceSet.getReferenceIds()) {
        LOG.fine("Getting reference  " + referenceId);
        Reference reference = getApi().references().get(referenceId).execute();
        if (!Strings.isNullOrEmpty(reference.getName())) {
          references.put(reference.getName(), reference);
          LOG.fine("Adding reference  " + reference.getName());
        }
      }
    }
    return references;
  }
266264
public void setWebAppSecurityCollaborator(ServiceReference<IWebAppSecurityCollaborator> ref) {
        String securityType = getSecurityType(ref);

        webAppSecurityCollaborators.putReference(securityType, ref);
    }
1148532
function(refPath) {
		var require = function(relModuleId) {
			var moduleId = resolveModuleId(relModuleId, refPath),
				module = getModule(moduleId);

			if (!module) {
				throw "Module not loaded";
			}
			else if (module.error) {
				throw "Error loading module";
			}

			if (!module.exports) {
				module.exports = {};
				var moduleDir = moduleId.substring(0, moduleId.lastIndexOf('/')+1),
					injects = module.injects,
					args = [];

				for (var i = 0, n = injects.length; i<n; i++) {
					if (injects[i] == 'require') {
						args.push(createRequireFunc(moduleDir));
					}
					else if (injects[i] == 'exports') {
						args.push(module.exports);
					}
					else if (injects[i] == 'module') {
						args.push(module.module);
					}
				}

				module.factory.apply(null, args);
			}
			return module.exports;
		};

		require.ensure = function(deps, cb) {
			ensureImpl(deps, cb, refPath);
		};

		if (_mainProgram != null) {
			require.main = getModule(_mainProgram).module;
		}

		return require;
	}
366130
public static Object load(Reader reader) throws IOException {
    Map<String, Object> data = getSnakeYaml().load(reader);
    return modelMapper(data);
  }