Registers the provided File with our ClassLoader. This allows this resource to be looked up
via ClassLoader.getResource(fileName).
505045
public void registerFileResource(final String file) {
        try {
            _resourceMap.put(file, new File(file).toURI().toURL());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1072008
public <A> A register(final boolean autoSync, final String name, final A rs) {
        checkResourceName(name);
        final Class<?> claz = rs.getClass();
        ResourceType rtype = claz.getAnnotation(ResourceType.class);
        if (rtype == null) {
            return (A) register(autoSync, name, claz, rs);
        } else {
            A old = null;
            A t = (A) register(autoSync, name, rtype.value(), rs);
            if (t != null) old = t;
            return old;
        }
    }
1001753
public void addFile(String sourceFolder, String name, ClassLoaderFile file) {
		Assert.notNull(sourceFolder, "SourceFolder must not be null");
		Assert.notNull(name, "Name must not be null");
		Assert.notNull(file, "File must not be null");
		removeAll(name);
		getOrCreateSourceFolder(sourceFolder).add(name, file);
	}
1091762
@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String[] staticResourceMappingPath = {"classpath:/static/"};

        registry.addResourceHandler("/**").addResourceLocations(
                staticResourceMappingPath);
    }
1330
public void registerApplicationClasspathSPIs() {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        Iterator<Class<?>> categories = categories();

        while (categories.hasNext()) {
            Class<?> category = categories.next();

            try {
                // Find all META-INF/services/ + name on class path
                String name = SERVICES + category.getName();
                Enumeration<URL> spiResources = loader.getResources(name);

                while (spiResources.hasMoreElements()) {
                    URL resource = spiResources.nextElement();
                    registerSPIs(resource, category, loader);
                }
            }
            catch (IOException e) {
                throw new ServiceConfigurationError(e);
            }
        }
    }
863559
private void register(Path dir, List<PathMapping> pathMapping) throws IOException {

		WatchKey key = dir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
		keys.put(key, dir);

		List<PathMapping> m = pathToResourceBundle.get(dir);
		if (m == null) {
			m = new ArrayList<>();
			pathToResourceBundle.put(dir, m);
		}
		m.addAll(pathMapping);
	}
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);
		}
	}
1150339
public static void registerResource(Object resource, TaskManager tm) {
		if (resource == null) return;
		synchronized (resources) {
			resources.put(resource, tm);
		}
	}
70851
public void initialize(final BaseJavaFileObject javaSourceFileObject,
		final BaseJavaFileObject compiledJavaFileObject)
	{
		this.javaSourceFileObject = javaSourceFileObject;
		this.compiledJavaFileObject = compiledJavaFileObject;
		this.runtimeCompilerClassLoader.setCompiledJavaFileObject(this.compiledJavaFileObject);
	}
7073
public void load(File file) {
    try {
      PropertiesConfiguration config = new PropertiesConfiguration();
      // disabled to prevent accumulo classpath value from being shortened
      config.setDelimiterParsingDisabled(true);
      config.load(file);
      ((CompositeConfiguration) internalConfig).addConfiguration(config);
    } catch (ConfigurationException e) {
      throw new IllegalArgumentException(e);
    }
  }
166213
public void registerGenerator(String clazz) {

		ResourceGenerator generator = (ResourceGenerator) ClassLoaderResourceUtils.buildObjectInstance(clazz);

		if (null == generator.getResolver()) {
			throw new IllegalStateException("The getResolver() method must return something at " + clazz);
		}

		ResourceGeneratorResolver resolver = generator.getResolver();

		// Checks if another generator is already define with the same resolver
		for (ResourceGeneratorResolver resourceGeneratorResolver : resolverRegistry) {
			if (resourceGeneratorResolver.isSameAs(resolver)) {
				String generatorName = generator.getClass().getName();
				if (!clazz.equals(generatorName)) {
					String errorMsg = "Cannot register the generator of class " + generator.getClass().getName()
							+ " since the same resolver is being used by " + generatorName
							+ ". Please specify a different resolver in the getResolver() method.";
					throw new IllegalStateException(errorMsg);
				}
			}
		}

		// Warns the user about if the generator override a built-in generator
		Set<ResourceGeneratorResolver> commonResolvers = commonGenerators.keySet();
		for (ResourceGeneratorResolver commonGeneratorResolver : commonResolvers) {
			if (commonGeneratorResolver.isSameAs(resolver)) {
				String generatorName = generator.getClass().getName();
				LOGGER.warn("The custom generator '" + generatorName + "' override a built-in generator");
			}
		}

		initGenerator(generator);
	}
1124564
def register_rml(self, filepath, **kwargs):
        
        name = os.path.split(filepath)[-1]
        if name in self.rml_maps and self.rml_maps[name] != filepath:
            raise Exception("RML name already registered. Filenames must be "
                            "unique.",
                            (self.rml_maps[name], filepath))
        self.rml_maps[name] = filepath
1009827
void register(URL url, InMemoryMappingFile immf) {
        _data.put(url.getFile(), immf);
    }
1184738
private void tryRegister(String className, String fromStringMethodName) throws ClassNotFoundException {
        Class<?> cls = loadType(className);
        registerMethods(cls, "toString", fromStringMethodName);
    }
574465
private void initializeConfigPropertiesFiles(ClassLoader cl, String fileName) {
        final String methodName = "initializeConfigPropertiesFiles()";

        if (tc.isEntryEnabled())
            Tr.entry(tc, methodName + " classLoader=" + cl + " fileName=" + fileName);
        try {
            Enumeration<URL> resources = cl.getResources(fileName);
            while (resources.hasMoreElements()) {
                URL url = resources.nextElement();
                if (!processedUrls.contains(url))
                    processConfigUrl(url);
            }
        } catch (Exception ex) {
        }
        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName);
    }
788433
public void addResourceClassPath(ClassLoader loader)
  {
    String classpath = null;

    if (loader instanceof DynamicClassLoader)
      classpath = ((DynamicClassLoader) loader).getResourcePathSpecificFirst();
    else
      classpath = CauchoUtil.getClassPath();

    addClassPath(classpath);
  }
1268255
public URL registerInMemoryResource(final InMemoryMappingFile file) {
        URL url = DoPrivHelper.newInMemoryMappingFileURL(file);
        _resourceMap.put(file.getName(), url);

        return url;
    }