@Override protected Jets3tProperties configure() { final Jets3tProperties configuration = super.configure(); configuration.setProperty("s3service.enable-storage-classes", String.valueOf(false)); configuration.setProperty("s3service.disable-dns-buckets", String.valueOf(true)); return configuration; }
@Override protected Jets3tProperties configure() { final Jets3tProperties configuration = super.configure(); configuration.setProperty("s3service.enable-storage-classes", String.valueOf(false)); configuration.setProperty("s3service.disable-dns-buckets", String.valueOf(true)); return configuration; }
protected RestS3Service getRestS3Service(ProviderCredentials credentials) throws S3ServiceException { if (!this.isTargetS3) { // Override endpoint property in JetS3t properties originalTargetEndpoint = cockpitProperties.getStringProperty( "s3service.s3-endpoint", Constants.S3_DEFAULT_HOSTNAME); cockpitProperties.setProperty( "s3service.s3-endpoint", Constants.GS_DEFAULT_HOSTNAME); } else if (originalTargetEndpoint != null) { cockpitProperties.setProperty( "s3service.s3-endpoint", originalTargetEndpoint); } return new RestS3Service(credentials, APPLICATION_DESCRIPTION, this, cockpitProperties); }
protected RestS3Service getRestS3Service(ProviderCredentials credentials) throws S3ServiceException { if (!this.isTargetS3) { // Override endpoint property in JetS3t properties originalTargetEndpoint = cockpitProperties.getStringProperty( "s3service.s3-endpoint", Constants.S3_DEFAULT_HOSTNAME); cockpitProperties.setProperty( "s3service.s3-endpoint", Constants.GS_DEFAULT_HOSTNAME); } else if (originalTargetEndpoint != null) { cockpitProperties.setProperty( "s3service.s3-endpoint", originalTargetEndpoint); } return new RestS3Service(credentials, APPLICATION_DESCRIPTION, this, cockpitProperties); }
/** * When a fatal error occurs, go straight to last screen to display the error message * and make the error code available as a variable (<code>${errorCode}</code>) to be used * in the error message displayed to the user. * <p> * If there is an Uploader property <code>errorCodeMessage.<code></code> corresponding * to this error code, the value of this property is made available as a variable * (<code>${errorMessage}</code>). If there is no such property available the * <code>${errorMessage}</code> variable will be an empty string. * * * @param errorCode * the error code, which may correspond with an error message in uploader.properties. */ private void failWithFatalError(String errorCode) { uploaderProperties.setProperty("errorCode", errorCode); String errorCodeMessagePropertyName = "errorCodeMessage." + errorCode; String errorCodeMessage = uploaderProperties.getStringProperty(errorCodeMessagePropertyName, ""); uploaderProperties.setProperty("errorMessage", errorCodeMessage); fatalErrorOccurred = true; drawWizardScreen(WIZARD_SCREEN_5); }
public RestS3Service makeObject() throws S3ServiceException { Jets3tProperties jProps = Jets3tProperties .getInstance(Constants.JETS3T_PROPERTIES_FILENAME); jProps.setProperty("httpclient.max-connections", Integer.toString(this.poolSize)); RestS3Service s3Service = new RestS3Service(awsCredentials, null, null, jProps); return s3Service; }
public AmazonS3Client makeObject() throws S3ServiceException { Jets3tProperties jProps = Jets3tProperties .getInstance(Constants.JETS3T_PROPERTIES_FILENAME); jProps.setProperty("httpclient.max-connections", Integer.toString(this.poolSize)); @SuppressWarnings("deprecation") AmazonS3Client s3Service = new AmazonS3Client(awsCredentials); return s3Service; }
/** * When a fatal error occurs, go straight to last screen to display the error message * and make the error code available as a variable (<code>${errorCode}</code>) to be used * in the error message displayed to the user. * <p> * If there is an Uploader property <code>errorCodeMessage.<code></code> corresponding * to this error code, the value of this property is made available as a variable * (<code>${errorMessage}</code>). If there is no such property available the * <code>${errorMessage}</code> variable will be an empty string. * * * @param errorCode * the error code, which may correspond with an error message in uploader.properties. */ private void failWithFatalError(String errorCode) { uploaderProperties.setProperty("errorCode", errorCode); String errorCodeMessagePropertyName = "errorCodeMessage." + errorCode; String errorCodeMessage = uploaderProperties.getStringProperty(errorCodeMessagePropertyName, ""); uploaderProperties.setProperty("errorMessage", errorCodeMessage); fatalErrorOccurred = true; drawWizardScreen(WIZARD_SCREEN_5); }
@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()); } }
configuration.setProperty("s3service.s3-endpoint", preferences.getProperty("s3.hostname.default")); configuration.setProperty("s3service.disable-dns-buckets", String.valueOf(preferences.getBoolean("s3.bucket.virtualhost.disable"))); configuration.setProperty("s3service.s3-endpoint", host.getHostname()); configuration.setProperty("s3service.disable-dns-buckets", String.valueOf(true)); configuration.setProperty("s3service.enable-storage-classes", String.valueOf(true)); if(StringUtils.isNotBlank(host.getProtocol().getContext())) { if(!Scheme.isURL(host.getProtocol().getContext())) { configuration.setProperty("s3service.s3-endpoint-virtual-path", PathNormalizer.normalize(host.getProtocol().getContext())); configuration.setProperty("s3service.https-only", String.valueOf(host.getProtocol().isSecure())); if(host.getProtocol().isSecure()) { configuration.setProperty("s3service.s3-endpoint-https-port", String.valueOf(host.getPort())); configuration.setProperty("s3service.s3-endpoint-http-port", String.valueOf(host.getPort())); configuration.setProperty("s3service.internal-error-retry-max", String.valueOf(0)); configuration.setProperty("s3service.max-thread-count", String.valueOf(1)); configuration.setProperty("httpclient.proxy-autodetect", String.valueOf(false)); configuration.setProperty("httpclient.retry-max", String.valueOf(0)); configuration.setProperty("storage-service.internal-error-retry-max", String.valueOf(0)); configuration.setProperty("storage-service.request-signature-version", authenticationHeaderSignatureVersion.toString()); configuration.setProperty("storage-service.disable-live-md5", String.valueOf(true)); configuration.setProperty("storage-service.default-region", host.getRegion()); return configuration;
protected StorageService getStorageService() throws S3ServiceException { if (targetS3.isSelected()) { return new RestS3Service(credentials); } else { // Override endpoint property in JetS3t properties Jets3tProperties gsProperties = Jets3tProperties.getInstance( Constants.JETS3T_PROPERTIES_FILENAME); gsProperties.setProperty( "s3service.s3-endpoint", Constants.GS_DEFAULT_HOSTNAME); return new RestS3Service(credentials, null, null, gsProperties); } }
protected StorageService getStorageService() throws S3ServiceException { if (targetS3.isSelected()) { return new RestS3Service(credentials); } else { // Override endpoint property in JetS3t properties Jets3tProperties gsProperties = Jets3tProperties.getInstance( Constants.JETS3T_PROPERTIES_FILENAME); gsProperties.setProperty( "s3service.s3-endpoint", Constants.GS_DEFAULT_HOSTNAME); return new RestS3Service(credentials, null, null, gsProperties); } }
uploaderProperties.setProperty(paramName, paramValue); uploaderProperties.setProperty(propName, propValue);
private void connect() { String accessKey = getParamString("s3-access-key"); String secretKey = getParamString("s3-secret-key"); String bucket = getParamString("s3-bucket"); AWSCredentials awsCredentials = new AWSCredentials(accessKey, secretKey); S3Service s3service = new RestS3Service(awsCredentials); Jets3tProperties props = s3service.getJetS3tProperties(); String port = getParamString("s3-endpoint-http-port"); String httpsOnly = getParamString("s3-https-only"); String endpoint = getParamString("s3-endpoint"); if(port != null) props.setProperty("s3service.s3-endpoint-http-port", port); if(httpsOnly != null) props.setProperty("s3service.https-only", httpsOnly); if(endpoint != null) props.setProperty("s3service.s3-endpoint", endpoint); //props.setProperty("s3service.s3-endpoint-http-port", "10453"); //props.setProperty("s3service.https-only", "false"); //props.setProperty("s3service.s3-endpoint", "localhost"); props.setProperty("s3service.disable-dns-buckets", "true"); CredentialsProvider credentials = s3service.getCredentialsProvider(); s3service = new RestS3Service(awsCredentials, "Doradus", credentials, props); Object str_threads = getParamString("s3-threads"); int threads = str_threads == null ? 1 : Integer.parseInt(str_threads.toString()); s3_executor = Executors.newFixedThreadPool(threads); m_connection = new AmazonConnection(s3service, bucket); }
cockpitLiteProperties.setProperty(paramName, paramValue); cockpitLiteProperties.setProperty(propName, propValue);
cockpitLiteProperties.setProperty(paramName, paramValue); cockpitLiteProperties.setProperty(propName, propValue);
String propertyName = (String) iter.next(); String propertyValue = loginProperties.getProperty(propertyName); cockpitLiteProperties.setProperty(propertyName, propertyValue);
String propertyName = (String) iter.next(); String propertyValue = loginProperties.getProperty(propertyName); cockpitLiteProperties.setProperty(propertyName, propertyValue);
service = new RestS3Service(new AWSCredentials(credentials.getLogin(), credentials.getPassword())); Jets3tProperties props = new Jets3tProperties(); props.setProperty("s3service.s3-endpoint", url.getHost());
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(); }