static Map<ForceConnectionProperty, String> loadConnectorPropsFromFile(URL fileUrl) throws IOException { if (fileUrl == null) throw new IllegalArgumentException("Connector property file cannot be null."); Properties connectorProps = new Properties(); InputStream is = null; try { is = fileUrl.openStream(); connectorProps.load(is); } finally { if (is != null) is.close(); } if (connectorProps.containsKey("url")) { return loadConnectorPropsFromUrl(connectorProps.getProperty("url")); } Map<ForceConnectionProperty, String> connectorPropMap = new HashMap<ForceConnectionProperty, String>(connectorProps.size()); for (String propName : connectorProps.stringPropertyNames()) { ForceConnectionProperty connProp = ForceConnectionProperty.fromPropertyName(propName); if (connProp != null) { connectorPropMap.put(connProp, connectorProps.getProperty(propName)); } } return connectorPropMap; }
static Map<ForceConnectionProperty, String> loadConnectorPropsFromFile(URL fileUrl) throws IOException { if (fileUrl == null) throw new IllegalArgumentException("Connector property file cannot be null."); Properties connectorProps = new Properties(); InputStream is = null; try { is = fileUrl.openStream(); connectorProps.load(is); } finally { if (is != null) is.close(); } if (connectorProps.containsKey("url")) { return loadConnectorPropsFromUrl(connectorProps.getProperty("url")); } Map<ForceConnectionProperty, String> connectorPropMap = new HashMap<ForceConnectionProperty, String>(connectorProps.size()); for (String propName : connectorProps.stringPropertyNames()) { ForceConnectionProperty connProp = ForceConnectionProperty.fromPropertyName(propName); if (connProp != null) { connectorPropMap.put(connProp, connectorProps.getProperty(propName)); } } return connectorPropMap; }
ForceConnectionProperty connProp = ForceConnectionProperty.fromPropertyName(parsedUrlProperty[0]);
ForceConnectionProperty connProp = ForceConnectionProperty.fromPropertyName(parsedUrlProperty[0]);