Loads from json.

@param props
the props
@param is
the is
@throws IOException
Signals that an I/O exception has occurred.
777003
public void loadFromJson(final Properties props, final InputStream is) throws IOException {
		try {
			((PrefixedProperties) props).loadFromJSON(is);
		} catch (final NoSuchMethodError err) {
			throw new IOException(
					"Cannot load properties JSON file - not using PrefixedProperties: " + err.getMessage());
		}
	}
116875
protected void loadFromUrl(Properties props, URL url) {
		InputStream is = null;
		try {
			is = url.openStream();
			props.load(is);
		} catch (IOException ex) {
			if (log.isLoggable(Level.WARNING)) {
				log.log(Level.WARNING, ex.getMessage(), ex);
			}
		} finally {
			try { if (is != null) is.close(); } catch (IOException ignore) {}
		}
	}
1292485
public static ExampleProperties loadProperties() throws IOException {
    String propsName = "Example.properties";

    try ( InputStream propsStream = openStream(propsName) ) {
      if (propsStream == null)
        throw new IOException("Could not read properties "+propsName);

      Properties props = new Properties();
      props.load(propsStream);

      return new ExampleProperties(props);
    }
  }
901512
private void readObject (ObjectInputStream s)
         throws IOException, ClassNotFoundException
    {
        // read in number of buckets and allocate the bucket array
        _buckets = new Record[s.readInt()];
        _loadFactor = s.readFloat();

        // read in size (number of mappings)
        int size = s.readInt();

        // read the keys and values
        for (int i=0; i<size; i++) {
            put(s.readInt(), s.readInt());
        }
    }
761848
public static Props loadProps(final Props parent, final File... propFiles) {
    try {
      Props props = new Props(parent);
      for (final File f : propFiles) {
        if (f.isFile()) {
          props = new Props(props, f);
        }
      }

      return props;
    } catch (final IOException e) {
      throw new RuntimeException("Error loading properties.", e);
    }
  }
435856
public void setInput(int index, InputStream is) {
        if (index >= inputStreams.length) {
            inputStreams = Arrays.copyOf(inputStreams, index + 1);
        }
        this.inputStreams[index] = is;
    }
1186206
public void load(Properties map, DynamicInitializer<C> di) throws ClassNotFoundException {
        load(map, di, /* assign key? */ false);
    }
1179606
private void readFromStream(InputStream in) throws IOException {
        document = DocumentFactory.newDocument(Json.read(in));
    }
612471
public void configure(InputStream is) throws IOException {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
            int lineNumber = 0;

            while (true) {
                String line = reader.readLine();
                if (line == null) break;

                line = line.trim();
                lineNumber++;

                if (line.startsWith("#") || line.length() == 0) continue;

                if (line.startsWith(LOAD_PREFIX)) {
                    String loadPath = line.substring(LOAD_PREFIX.length()).trim();
                    loadPath = assignProperties(loadPath);
                    loadFilteredPath(loadPath);
                } else if (line.startsWith(GRAB_PREFIX)) {
                    String grabParams = line.substring(GRAB_PREFIX.length()).trim();
                    grabList.add(assignProperties(grabParams));
                } else if (line.startsWith(MAIN_PREFIX)) {
                    if (main != null)
                        throw new IOException("duplicate definition of main in line " + lineNumber + " : " + line);
                    main = line.substring(MAIN_PREFIX.length()).trim();
                } else if (line.startsWith(PROP_PREFIX)) {
                    String params = line.substring(PROP_PREFIX.length()).trim();
                    String key = SystemUtil.setSystemPropertyFrom(params);
                    System.setProperty(key, assignProperties(System.getProperty(key)));
                } else if (line.startsWith(CONFIGSCRIPT_PREFIX)) {
                    String script = line.substring(CONFIGSCRIPT_PREFIX.length()).trim();
                    configScripts.add(assignProperties(script));
                } else {
                    throw new IOException("unexpected line in " + lineNumber + " : " + line);
                }
            }
        }

        if (requireMain && main == null) throw new IOException("missing main class definition in config file");
        if (!configScripts.isEmpty()) {
            System.setProperty("groovy.starter.configscripts", DefaultGroovyMethods.join((Iterable)configScripts, ","));
        }
    }
125651
@SuppressWarnings("unchecked")
    public static <T> T readObject(InputStream is) {
        try {
            ObjectInputStream ois = new ObjectInputStream(is);
            T ret = (T) ois.readObject();
            ois.close();
            return ret;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
817181
public void loadFromYAML(final InputStream is) throws IOException {
		lock.writeLock().lock();
		try {
			final YAMLFactory f = new YAMLFactory();
			final YAMLParser jp = f.createParser(is);
			configureJsonParser(jp);
			if (jp.nextToken() == JsonToken.START_OBJECT) {
				traverseJSON(jp, null);
			}
		} finally {
			lock.writeLock().unlock();
		}
	}
641165
public static Props fromJSONString(final String json) throws IOException {
    final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
    final Props props = new Props(null, obj);
    return props;
  }
501339
public static Properties load(InputStream input) throws IOException {
		Properties prop = new Properties();
		try {
			prop.load(input);
		} catch (IOException e) {
			throw new IOException("Failed to read properties from input");
		}
		return prop;
	}
113754
public static Properties load (File from)
        throws IOException
    {
        Properties props = new Properties();
        BufferedInputStream bin = new BufferedInputStream(new FileInputStream(from));
        try {
            props.load(bin);
            return props;
        } finally {
            StreamUtil.close(bin);
        }
    }
332288
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
		if (this.children != null) {
			final N me = toN();
			for (final NaryTreeNode<D, N> child : this.children) {
				if (child != null) {
					child.setParentNodeReference(me, false);
				}
			}
		}
	}
837462
private final Properties loadPropertiesFile(WsResource res) throws IOException {

        Properties props = new Properties();
        InputStream is = res.get();
        try {
            props.load(is);
        } catch (IOException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(this, tc, "Error loading properties; " + e);
            }
            throw e;
        } finally {
            if (is != null)
                try {
                    is.close();
                } catch (IOException e) {
                }
        }
        return props;
    }
346074
public static void loadCustomerProperties(Properties props){
        for(Entry<Object, Object> entry : props.entrySet()){
            setProperty((String)entry.getKey(), entry.getValue());
        }
    }