Help getting last modified from an object in S3

34 views
Skip to first unread message

Doron Levi

unread,
Aug 9, 2010, 4:27:15 PM8/9/10
to JetS3t Users
Hi,

I have been trying to get the last modified date (long) for an object
in S3.
This is the code I am using:

RestS3Service service = new RestS3Service(new
AWSCredentials(accessKey, secretAccessKey));
return service.getObjectDetails(driveName,
fileName).getLastModifiedDate().getTime();

I get this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/
commons/httpclient/URIException
at
il.ac.technion.psl.cloudstorage.AmazonS3Connector.getLastModified(AmazonS3Connector.java:
409)
at il.ac.technion.psl.cloudstorage.tests.tester.main(tester.java:70)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.httpclient.URIException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 2 more

Any thoughts?

Moreover I am using this bit of code to verify that an object I store
has been modified and can be accessed by other users, I compare this
date with the date on the response from the PUT request, any thoughts?

Thanks a lot!

Doron Levi

unread,
Aug 9, 2010, 4:57:37 PM8/9/10
to JetS3t Users
I forgot to mention that I added the JAR to the project that uses
these classes, as a referenced library.

Thanks

James Murty

unread,
Aug 9, 2010, 10:57:32 PM8/9/10
to jets3t...@googlegroups.com
Hi,

You need to include JetS3t's library dependencies in your classpath, not just JetS3t's jar. See the libraries in the libs directory. The error message you mention is specifically because you haven't included the httpclient library in your classpath.

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