EEGInt / awstasks

Automatically exported from code.google.com/p/awstasks
Apache License 2.0
0 stars 0 forks source link

S3FileSet type and S3Copy task #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a contribution not an issue, but I couldn't find a mailing list or
other way of contributing?

I needed the ability to delete files by time and to copy between buckets.
So I've added it. 

Attached are the following enhancements:
- added ant.jar to the classpath and activation.jar to libs to make it
compile on my machine.
- an S3Copy task that enables copying between buckets and can use S3FileSet
- an updated S3Delete task that can use an S3FileSet
- A Resource collection implementation called S3FileSet that acts a bit
like a FileSet - in theory you should be able to use a lot of Ant's
selectors as part of these tasks.  I've only tested DateSelector and
FilenameSelector

I've endeavoured to make it backwards compatible with the existing
parameters, but to be honest I haven't tested it.  This is also my first
attempt at writing ant tasks, so I've no idea if the design choices are
right, but it does the job for me.

It requires Ant 1.7 (for the ResourceCollection API) and JetS3t 0.6.1 (for
the copy method)

Examples:

  <S3Copy tobucket="mybucket">
    <S3FileSet accessId="${aws.accessId}" secretKey="${aws.secretKey}"
               bucket="otherbucket">
      <date when="after" datetime="${todaysDate}" pattern="${dateFormat}"/>
    </S3FileSet>
  </S3Copy>

and

  <S3Delete>
    <S3FileSet accessId="${aws.accessId}" secretKey="${aws.secretKey}"
               bucket="oldstuff">
      <date when="before" datetime="${aWeekAgo}" pattern="${dateFormat}"/>
    </S3FileSet>
  </S3Delete>

Original issue reported on code.google.com by chris.se...@gmail.com on 19 Oct 2008 at 8:32

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, Chris! I'll have to add the feed from this to my reader, because I'm 
just finally seeing this! LOL!

David

Original comment by dkavan...@gmail.com on 5 Aug 2009 at 7:34

GoogleCodeExporter commented 8 years ago
Hello,

did you know when it will be released the new version 0.4 that contains a lot 
of new features that I would like to use with Ant and S3 ?

Thanks in advance
Marco

Original comment by risali...@gmail.com on 8 Apr 2011 at 11:06

GoogleCodeExporter commented 8 years ago
Anyone has thinking to provide also the ant tasks for the integratation with 
Amazon EC2 api ?

Thanks
Marco

Original comment by risali...@gmail.com on 8 Apr 2011 at 11:08