1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.maven.wagon;
17
18 import java.util.List;
19
20 import org.apache.maven.wagon.authentication.AuthenticationInfo;
21 import org.apache.maven.wagon.repository.Repository;
22
23 public class S3WagonTest {
24 private static final String USERNAME = "AKIAJFD5IM7IPVVUEBNA";
25 private static final String PASSWORD = System.getProperty("secret.key");
26
27
28
29
30 public void testPermissions() {
31 try {
32 AuthenticationInfo auth = new AuthenticationInfo();
33 auth.setUserName(USERNAME);
34 auth.setPassword(PASSWORD);
35 Repository repository = new Repository("kuali.release", "s3://deletemenow.kuali.org/release");
36 S3Wagon wagon = new S3Wagon();
37 wagon.connect(repository, auth);
38 } catch (Exception e) {
39 e.printStackTrace();
40 }
41 }
42
43
44 public void simple() {
45 try {
46 AuthenticationInfo auth = new AuthenticationInfo();
47 auth.setUserName(USERNAME);
48 auth.setPassword(PASSWORD);
49 Repository repository = new Repository("kuali.release", "s3://maven.kuali.org/release");
50 S3Wagon wagon = new S3Wagon();
51 wagon.connect(repository, auth);
52 List<String> files = wagon.getFileList("");
53 System.out.println(files.size());
54 } catch (Exception e) {
55 e.printStackTrace();
56 }
57 }
58
59 }