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; }
return jets3tProperties; } else { jets3tProperties = new Jets3tProperties(); propertiesHashtable.put(propertiesFileName, jets3tProperties);
return jets3tProperties; } else { jets3tProperties = new Jets3tProperties(); propertiesHashtable.put(propertiesFileName, jets3tProperties);
try { service = new RestS3Service(new AWSCredentials(credentials.getLogin(), credentials.getPassword())); Jets3tProperties props = new Jets3tProperties(); props.setProperty("s3service.s3-endpoint", url.getHost());
protected Jets3tProperties configure() { final Jets3tProperties configuration = new Jets3tProperties(); if(log.isDebugEnabled()) { log.debug(String.format("Configure for endpoint %s", host));
protected void initialize() { if (mpUtils == null) { // not injected mpUtils = new MultipartUtils(maxPartSize); } try { Jets3tProperties properties = new Jets3tProperties(); properties.setProperty("s3service.s3-endpoint", s3Endpoint); if (credentialsProvider.getCredentials() instanceof AWSSessionCredentials) { s3Service = new RestS3Service( new AWSSessionCredentialsAdapter(credentialsProvider), null, null, properties); } else { s3Service = new RestS3Service( new AWSCredentials( credentialsProvider.getCredentials().getAWSAccessKeyId(), credentialsProvider.getCredentials().getAWSSecretKey()), null, null, properties); } } catch (S3ServiceException e) { throw new RuntimeException(e); } grantAcl = new GrantAcl(s3Service, s3Acl, s3AclRetries == 0 ? 5 : s3AclRetries); notice.init(); }