/** * Create utility class for a given OAuth implementation that will use the given * client ID and Secret. Values in the default system {@link Jets3tProperties} object * are used to configure HTTP/S connections that may be performed by this class. * * @param implementation OAuth implementation version * @param clientId Client ID for installed application * @param clientSecret Client secret for installed applications */ public OAuthUtils(OAuthImplementation implementation, String clientId, String clientSecret) { this(implementation, clientId, clientSecret, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Create utility class for a given OAuth implementation that will use the given * client ID and Secret. Values in the default system {@link Jets3tProperties} object * are used to configure HTTP/S connections that may be performed by this class. * * @param implementation OAuth implementation version * @param clientId Client ID for installed application * @param clientSecret Client secret for installed applications */ public OAuthUtils(OAuthImplementation implementation, String clientId, String clientSecret) { this(implementation, clientId, clientSecret, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Construct a <code>StorageService</code> identified by the given user credentials. * * @param credentials * the user credentials, may be null in which case the communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> */ protected StorageService(ProviderCredentials credentials, String invokingApplicationDescription) { this(credentials, invokingApplicationDescription, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Construct a <code>StorageService</code> identified by the given user credentials. * * @param credentials * the user credentials, may be null in which case the communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> */ protected StorageService(ProviderCredentials credentials, String invokingApplicationDescription) { this(credentials, invokingApplicationDescription, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Construct an <code>S3Service</code> identified by the given user credentials. * * @param credentials * the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> */ protected S3Service(ProviderCredentials credentials, String invokingApplicationDescription) { this(credentials, invokingApplicationDescription, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. */ public RestStorageService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. */ public RestStorageService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Construct an <code>S3Service</code> identified by the given user credentials. * * @param credentials * the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> */ protected S3Service(ProviderCredentials credentials, String invokingApplicationDescription) { this(credentials, invokingApplicationDescription, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials * the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider * an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. */ public RestS3Service(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials * the user credentials to use when communicating with Google Storage, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider * an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. * * @throws ServiceException Service error */ public GoogleStorageService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) throws ServiceException { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials * the S3 user credentials to use when communicating with S3, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider * an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. */ public RestS3Service(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * Constructs the service and initialises the properties. * * @param credentials * the user credentials to use when communicating with Google Storage, may be null in which case the * communication is done as an anonymous user. * @param invokingApplicationDescription * a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code> * @param credentialsProvider * an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. * * @throws ServiceException Service error */ public GoogleStorageService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider) throws ServiceException { this(credentials, invokingApplicationDescription, credentialsProvider, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * @return * a FileComparer instance initialized with the default JetS3tProperties * object. */ public static FileComparer getInstance() { return new FileComparer( Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
/** * @return * a FileComparer instance initialized with the default JetS3tProperties * object. */ public static FileComparer getInstance() { return new FileComparer( Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)); }
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; }
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); } }
/** * Constructs the service and initialises its properties. * * @param credentials the Storage Provider user credentials to use when communicating with CloudFront * @param invokingApplicationDescription a short description of the application using the service, suitable for inclusion in a * user agent string for REST/HTTP requests. Ideally this would include the application's * version number, for example: <code>Cockpit/0.7.3</code> or <code>My App Name/1.0</code>. * May be null. * @param credentialsProvider an implementation of the HttpClient CredentialsProvider interface, to provide a means for * prompting for credentials when necessary. May be null. * @param jets3tProperties JetS3t properties that will be applied within this service. May be null. */ public CloudFrontService(ProviderCredentials credentials, String invokingApplicationDescription, CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties) { this.credentials = credentials; this.invokingApplicationDescription = invokingApplicationDescription; this.credentialsProvider = credentialsProvider; if(jets3tProperties == null) { jets3tProperties = Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME); } this.jets3tProperties = jets3tProperties; this.internalErrorRetryMax = jets3tProperties.getIntProperty("cloudfront-service.internal-error-retry-max", 5); this.initializeDefaults(); }
/** * Creates stand-alone dialog box for testing only. * * @param args * @throws Exception */ public static void main(String args[]) throws Exception { JFrame f = new JFrame(); HyperlinkActivatedListener listener = new HyperlinkActivatedListener() { private static final long serialVersionUID = -225585129296632961L; public void followHyperlink(URL url, String target) { BareBonesBrowserLaunch.openURL(url.toString()); } }; StartupDialog startupDialog = new StartupDialog(f, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME), listener); startupDialog.setVisible(true); ProviderCredentials credentials = startupDialog.getProviderCredentials(); startupDialog.dispose(); if (credentials != null) { System.out.println("Credentials: " + credentials.getLogString()); } else { System.out.println("Credentials: null"); } f.dispose(); }