Load resource from classpath.
439780
public static InputStream readResource(String name) {
        String classpath = System.getProperty("java.class.path");
        LOGGER.trace("Reading {} from classpath={}", name, classpath);
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader == null) {
            throw new IllegalStateException("Can not obtain classloader instance from current thread");
        }
        return classLoader.getResourceAsStream(name);
    }
303833
private static String readClasspathResource(String filename) {
        InputStream is = CreateEntities.class.getResourceAsStream(filename);
        if (is == null) {
            throw new IllegalArgumentException(
                    "Could not find the given file '" + filename + "' in the classpath.");
        }
        
        return readContents(is);
    }
1278326
public static void loadProperties(String classpathName, Properties toProps) {
        Validate.argumentIsNotNull(classpathName);
        Validate.argumentIsNotNull(toProps);

        InputStream inputStream = PropertiesUtil.class.getClassLoader().getResourceAsStream(classpathName);

        if (inputStream == null) {
            throw new JaversException(CLASSPATH_RESOURCE_NOT_FOUND, classpathName);
        }

        try {
            toProps.load(inputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
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);
	}
94923
def load(self, _override=True, _allow_undeclared=False, **kwargs):
    """"""
    self.load_from_dict(
        kwargs, _override=_override, _allow_undeclared=_allow_undeclared)
1161939
public static URI getResourceURI(String classpath) {
        try {
            return getResourceURL(classpath).toURI();
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "getResourceURI", classpath);
        }
    }
388097
protected void loadJars(Path pluginPath, PluginClassLoader pluginClassLoader) {
        for (String libDirectory : pluginClasspath.getLibDirectories()) {
            Path file = pluginPath.resolve(libDirectory);
            List<File> jars = FileUtils.getJars(file);
            for (File jar : jars) {
                pluginClassLoader.addFile(jar);
            }
        }
    }
323762
public URL getResource(String name) {
        for (int i = 0; i < classLoaders.length; i++) {
            URL url = classLoaders[i].getResource(name);
            if (url != null) {
                return url;
            }
        }
        if (getParent() != null) {
            return super.getResource(name);
        } else {
            return null;
        }
    }
900008
public static void loadResource(final String serializerId,
      @SuppressWarnings("rawtypes") final Map<String, ArtifactSerializer> artifactSerializers,
      final String resourcePath, final Map<String, Object> resources) {

    final File resourceFile = new File(resourcePath);
    if (resourceFile != null) {
      final String resourceId = IOUtils
          .normalizeLexiconName(resourceFile.getName());
      final ArtifactSerializer<?> serializer = artifactSerializers
          .get(serializerId);
      final InputStream resourceIn = IOUtils.openFromFile(resourceFile);
      try {
        resources.put(resourceId, serializer.create(resourceIn));
      } catch (final InvalidFormatException e) {
        e.printStackTrace();
      } catch (final IOException e) {
        e.printStackTrace();
      } finally {
        try {
          resourceIn.close();
        } catch (final IOException e) {
        }
      }
    }
  }
1233935
def load_dependencies_to_classpath
      jars = dependencies_classpath.split(File::PATH_SEPARATOR)
      Naether::Java.load_jars(jars)

      jars
    end
1262361
public void loadFile(Resource res, String resourcePath) throws IOException {
	res.createFile(true);
	InputStream is = InfoImpl.class.getResourceAsStream(resourcePath);
	IOUtil.copy(is, res, true);
    }
1012911
public Template load(String path) throws IOException, ParseException {
  	
    try(TemplateSource source = sourceLoader.find(path)) {
      
      if (source != null) {
        
        return load(path, source);
      }
      
  	}
    
    return null;
  }
269703
def load_class_by_path(taskpath):
    

    return getattr(
        importlib.import_module(
            re.sub(
                r"\.[^.]+$",
                "",
                taskpath)),
        re.sub(
            r"^.*\.",
            "",
            taskpath))
1228514
def load_object_at_path(path):
    """"""
    with open(path, 'r') as f:
        data = _deserialize(f.read())
        return aadict(data)
776282
public static HttpFileBuilder ofResource(ClassLoader classLoader, String path) {
        requireNonNull(classLoader, "classLoader");
        requireNonNull(path, "path");

        // Strip the leading slash.
        if (path.startsWith("/")) {
            path = path.substring(1);
        }

        // Retrieve the resource URL.
        final URL url = classLoader.getResource(path);
        if (url == null || url.getPath().endsWith("/")) {
            // Non-existent resource.
            return new NonExistentHttpFileBuilder();
        }

        // Convert to a real file if possible.
        if ("file".equals(url.getProtocol())) {
            File f;
            try {
                f = new File(url.toURI());
            } catch (URISyntaxException ignored) {
                f = new File(url.getPath());
            }

            return of(f);
        }

        return new ClassPathHttpFileBuilder(url);
    }
825389
function (classpath) {
            var basePath = Aria.getLogicalPath(classpath);
            for (var i = 0, l = atExtensions.length; i < l; i++) {
                try {
                    var logicalPath = basePath + atExtensions[i];
                    var cacheItem = require.cache[require.resolve(logicalPath)];
                    if (cacheItem) {
                        return logicalPath;
                    }
                } catch (e) {
                    // require.resolve can throw an exception in node.js if the file does not exist
                    // simply try other extensions in that case
                }
            }
            // it may be the classpath of a resource (which would not appear in the require cache):
            var resMgr = aria.core.ResMgr;
            if (resMgr) {
                return resMgr.getResourceLogicalPath(basePath);
            }
        }
884137
public static InputStream getResourceAsStream(String resourcePath, Object source) throws FileNotFoundException {

		// Try the current classloader
		InputStream is = source.getClass().getResourceAsStream(resourcePath);

		// Weblogic 10 likes this one better..
		if (null == is) {
			ClassLoader cl = source.getClass().getClassLoader();
			if (null != cl) {
				is = cl.getResourceAsStream(resourcePath);
			}
		}

		// If current classloader failed, try with the Threads context
		// classloader. If that fails ott, the resource is either not on the
		// classpath or inaccessible from the current context.

		if (null == is) {
			is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourcePath);
		}

		if (null == is) {

			// Try to use the classloader of the current Jawr Config Manager
			// MBean
			// This will be used when a refresh is done in the configuration
			// using the JMX MBean
			MBeanServer mbs = JmxUtils.getMBeanServer();
			if (mbs != null) {

				ObjectName name = ThreadLocalJawrContext.getJawrConfigMgrObjectName();
				if (name != null) {
					try {

						ClassLoader cl = mbs.getClassLoaderFor(name);
						is = cl.getResourceAsStream(resourcePath);
					} catch (Exception e) {
						LOGGER.error("Unable to instanciate the Jawr MBean '" + name.getCanonicalName() + "'", e);
					}
				}
			}

		}

		// Try to retrieve by URL
		if (null == is) {

			try {
				URL url = getResourceURL(resourcePath, source);
				is = new FileInputStream(new File(url.getFile()));
			} catch (ResourceNotFoundException | IOException e) {
				throw new FileNotFoundException(resourcePath + " could not be found. ");
			}
		}

		return is;
	}