/** * Reads properties from an InputStream and stores them in this class's properties object. * If a new property already exists, the property value is replaced. * * @param inputStream * an input stream containing property name/value pairs in a format that can be read by * {@link Properties#load(InputStream)}. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. * * @throws IOException */ public void loadAndReplaceProperties(InputStream inputStream, String propertiesSource) throws IOException { Properties newProperties = new Properties(); newProperties.load(inputStream); loadAndReplaceProperties(newProperties, propertiesSource); }
/** * Reads properties from an InputStream and stores them in this class's properties object. * If a new property already exists, the property value is replaced. * * @param inputStream * an input stream containing property name/value pairs in a format that can be read by * {@link Properties#load(InputStream)}. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. * * @throws IOException */ public void loadAndReplaceProperties(InputStream inputStream, String propertiesSource) throws IOException { Properties newProperties = new Properties(); newProperties.load(inputStream); loadAndReplaceProperties(newProperties, propertiesSource); }
/** * Merges properties from another JetS3tProperties object into this instance. * If a new property already exists, the property value is replaced. * * @param properties * the object containing properties that will be merged into this set of properties. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. */ public void loadAndReplaceProperties(Jets3tProperties properties, String propertiesSource) { Properties newProperties = properties.getProperties(); loadAndReplaceProperties(newProperties, propertiesSource); }
/** * Merges properties from another JetS3tProperties object into this instance. * If a new property already exists, the property value is replaced. * * @param properties * the object containing properties that will be merged into this set of properties. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. */ public void loadAndReplaceProperties(Jets3tProperties properties, String propertiesSource) { Properties newProperties = properties.getProperties(); loadAndReplaceProperties(newProperties, propertiesSource); }
Jets3tProperties jets3=new Jets3tProperties(); jets3.loadAndReplaceProperties(new FileInputStream("/root/Desktop/jets3t.properties"), "jets3t.properties");
/** * Return a properties instance based on properties read from an input stream, and stores * the properties object in a cache referenced by the propertiesIdentifier. * * @param inputStream * an input stream containing property name/value pairs in a format that can be read by * {@link Properties#load(InputStream)}. * @param propertiesIdentifer * the name under which the properties are cached * * @return * a properties object initialised with property values from the input stream * * @throws IOException */ public static synchronized Jets3tProperties getInstance( InputStream inputStream, String propertiesIdentifer) throws IOException { Jets3tProperties jets3tProperties = null; // Keep static references to properties classes by propertiesIdentifer. if (propertiesHashtable.containsKey(propertiesIdentifer)) { jets3tProperties = propertiesHashtable.get(propertiesIdentifer); } else { jets3tProperties = new Jets3tProperties(); propertiesHashtable.put(propertiesIdentifer, jets3tProperties); } jets3tProperties.loadAndReplaceProperties(inputStream, propertiesIdentifer); return jets3tProperties; }
/** * Return a properties instance based on properties read from an input stream, and stores * the properties object in a cache referenced by the propertiesIdentifier. * * @param inputStream * an input stream containing property name/value pairs in a format that can be read by * {@link Properties#load(InputStream)}. * @param propertiesIdentifer * the name under which the properties are cached * * @return * a properties object initialised with property values from the input stream * * @throws IOException */ public static synchronized Jets3tProperties getInstance( InputStream inputStream, String propertiesIdentifer) throws IOException { Jets3tProperties jets3tProperties = null; // Keep static references to properties classes by propertiesIdentifer. if (propertiesHashtable.containsKey(propertiesIdentifer)) { jets3tProperties = propertiesHashtable.get(propertiesIdentifer); } else { jets3tProperties = new Jets3tProperties(); propertiesHashtable.put(propertiesIdentifer, jets3tProperties); } jets3tProperties.loadAndReplaceProperties(inputStream, propertiesIdentifer); return jets3tProperties; }
jets3tProperties.loadAndReplaceProperties(cpIS, "Resource '" + propertiesFileName + "' in classpath"); } catch (IOException e) {
jets3tProperties.loadAndReplaceProperties(cpIS, "Resource '" + propertiesFileName + "' in classpath"); } catch (IOException e) {
@Override public void configure(final boolean enable, final Path file) { final Jets3tProperties options = session.getClient().getJetS3tProperties(); if(enable) { // Set accelerated endpoint options.setProperty("s3service.s3-endpoint", hostname); options.setProperty("s3service.disable-dns-buckets", String.valueOf(false)); options.setProperty("s3service.disable-expect-continue", String.valueOf(true)); } else { // Revert default configuration options.loadAndReplaceProperties(session.configure(), this.toString()); } }
try { Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME) .loadAndReplaceProperties(new FileInputStream(jets3tPropertiesFile), "jets3t.properties in Cockpit's home folder " + cockpitHomeDirectory); } catch (IOException e) {
try { Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME) .loadAndReplaceProperties(new FileInputStream(jets3tPropertiesFile), "jets3t.properties in Cockpit's home folder " + cockpitHomeDirectory); } catch (IOException e) {
Jets3tProperties.getInstance(propertiesFileName); if (synchronizeProperties.isLoaded()) { myProperties.loadAndReplaceProperties(synchronizeProperties, propertiesFileName + " in classpath"); System.exit(2); myProperties.loadAndReplaceProperties( new FileInputStream(propertiesFileName), propertiesFile.getName()); } else {
Jets3tProperties.getInstance(propertiesFileName); if (synchronizeProperties.isLoaded()) { myProperties.loadAndReplaceProperties(synchronizeProperties, propertiesFileName + " in classpath"); System.exit(2); myProperties.loadAndReplaceProperties( new FileInputStream(propertiesFileName), propertiesFile.getName()); } else {