How does the config file jets3t.properties get picked up programmatically

809 views
Skip to first unread message

Pierre

unread,
Oct 28, 2010, 2:25:44 AM10/28/10
to JetS3t Users
Hi all,

I am new to JetS3t. I am currently doing some poc with the Toolkit
and already having some success, but I was wondering how the config
file "jets3t.properties" gets picked up if I am only including the
necessary jar files in my classpath? In other words, how do I change
any of the options in the properties file and make sure these changes
get picked up when I execute my code? Or how is the config file
included in my code when I am only using the jar files?

Thank you very much in advance for your insight and for the great
tool!

Regards,

Pierre

James Murty

unread,
Oct 28, 2010, 2:43:02 AM10/28/10
to jets3t...@googlegroups.com
Hi Pierre,

JetS3t looks for the jets3t.properties file in your Java classpath. As
long as your config file with that name is present in the classpath
your settings will be detected automatically.

To have more programmatic control over you settings, or to tweak
settings on the fly, you can create a JetS3tProperties object and
provide this to a StorageService using one of the more advanced
constructors. For example, you might do something like the following:

// Load your default settings from jets3t.properties file on the classpath
JetS3tProperties myProperties =
JetS3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME);

// Override default properties (increase number of connections and
threads for threaded service)
myProperties.setProperty("httpclient.max-connections", "100");
myProperties.setProperty("threaded-service.max-thread-count", "50");
myProperties.setProperty("threaded-service.admin-max-thread-count", "100");

James

> --
> You received this message because you are subscribed to the Google Groups "JetS3t Users" group.
> To post to this group, send email to jets3t...@googlegroups.com.
> To unsubscribe from this group, send email to jets3t-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jets3t-users?hl=en.
>

Reply all
Reply to author
Forward
0 new messages