Creates a new PropertiesSettings from the given resource in the classpath of the context ClassLoader.

@param resource the resource to read
@return a new PropertiesSettings
@throws IOException if the resource cannot be read
@see #from(String, ClassLoader)
162327
public static PropertiesSettings from(String resource) throws IOException
    {
        return from(resource, Thread.currentThread().getContextClassLoader());
    }
202271
public static String getResourceAsString(Class<?> clazz, String resource) throws IOException {
        try (InputStream inputStream = clazz.getResourceAsStream(resource)) {
            return IoUtils.toString(inputStream);
        }
    }
1356071
public static Reader getResourceAsReader(ClassLoader loader, String resource) throws IOException {
        return new InputStreamReader(getResourceAsStream(loader, resource));
    }
67453
protected X509Certificate loadX509CertificateFromResource(String resource) throws CertificateException{
		InputStream derInputStream = this.getClass().getClassLoader().getResourceAsStream(resource);
		CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
		X509Certificate cert = (X509Certificate) certificateFactory.generateCertificate(derInputStream);
		try {
			derInputStream.close();
		} catch (IOException e) {
			// ignore
		}
		return cert;
	}
1093302
public static Properties readPropertiesFromClassLoader(String resource) {
        Properties properties = new Properties();
        try {
            properties.load(FsCrawlerUtil.class.getClassLoader().getResourceAsStream(resource));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return properties;
    }
90607
private Reader getResourceReader(String resource) throws ResourceNotFoundException {
		List<Class<?>> excluded = new ArrayList<>();
		excluded.add(ILessCssResourceGenerator.class);
		return rsReaderHandler.getResource(bundle, resource, false, excluded);
	}
709653
public static InputStream getResourceAsStream(String resource) {
        InputStream in = ClassUtils.getContextClassLoader().getResourceAsStream(resource);
        if (in == null) {
            in = IOUtils.class.getResourceAsStream(resource);
        }

        return in;
    }
229463
protected static JsonInput loadJsonFromResourceOrFile(String resource) {
    try {
      return new Json().newInput(readFileOrResource(resource));
    } catch (RuntimeException e) {
      throw new GridConfigurationException("Unable to read input", e);
    }
  }
716981
private void readResource(Document.Resources.Resource resource)
   {
      Resource mpxjResource = m_projectFile.addResource();
      mpxjResource.setName(resource.getName());
      mpxjResource.setResourceCalendar(m_calendarMap.get(resource.getCalendarID()));
      mpxjResource.setStandardRate(new Rate(resource.getCost(), resource.getCostTimeUnit()));
      mpxjResource.setEmailAddress(resource.getEMail());
      mpxjResource.setGroup(resource.getGroup());
      //resource.getHyperlinks()
      mpxjResource.setUniqueID(resource.getID());
      //resource.getMarkerID()
      mpxjResource.setNotes(resource.getNote());
      mpxjResource.setID(Integer.valueOf(resource.getOutlineNumber()));
      //resource.getStyleProject()
      mpxjResource.setType(resource.getSubType() == null ? resource.getType() : resource.getSubType());
   }
601192
public static LinkedProperties create(String... resources) {
        LinkedProperties properties = create();
        if (resources != null) {
            for (String res : resources) {
                if (StringUtils.isNotBlank(res)) {
                    Enumeration<URL> enumeration = IOUtils.getResources(res);
                    while (enumeration.hasMoreElements()) {
                        try (InputStream in = enumeration.nextElement().openStream()) {
                            properties.load(in);
                        } catch (IOException e) {
                            // no op
                        }
                    }
                }
            }
        }
        return properties;
    }
655768
def _set_properties(self, resource):
        
        resource = resource.copy()
        self._additions = tuple(
            [
                ResourceRecordSet.from_api_repr(added_res, self.zone)
                for added_res in resource.pop("additions", ())
            ]
        )
        self._deletions = tuple(
            [
                ResourceRecordSet.from_api_repr(added_res, self.zone)
                for added_res in resource.pop("deletions", ())
            ]
        )
        self._properties = resource
1017358
public static ConfigurationLoader from(final Properties props) throws IOException {
        return new ConfigurationLoader(new Function<String, String>() {
            public String apply(String from) {
                return props.getProperty(from);
            }
        });
    }
1061936
public static Properties asProperties(Class<?> contextClass, String resourceName) throws IOException {
		Closer closer = Closer.create();
		try {
			Properties p = new Properties();
			p.load(closer.register(asCharSource(contextClass, resourceName).openStream()));
			return p;
		} catch (Throwable e) {
			throw closer.rethrow(e);
		} finally {
			closer.close();
		}
	}
932992
public Object newInstance(String resource) {
        try {
            String name = resource.startsWith("/") ? resource : "/" + resource;
            File file = new File(this.getClass().getResource(name).toURI());
            return newInstance(classLoader.parseClass(new GroovyCodeSource(file), true));
        } catch (Exception e) {
            throw new GroovyClassInstantiationFailed(classLoader, resource, e);
        }
    }
359559
public static PropertiesConfigurationSource create(Reader reader)
      throws ConfigurationException, IOException {
    return new PropertiesConfigurationSource(
        createPropertiesConfiguration(reader), DEFAULT_PRIORITY);
  }
1222221
private Properties loadProperties(InputStream inputStream) throws IOException {
        Properties properties = new Properties();
        properties.load(inputStream);
        return properties;
    }
1005324
public static PropertiesSettings from(File file) throws IOException
    {
        FileInputStream stream = new FileInputStream(file);
        return from(stream);
    }