protected List<String> getContainers() {
   // List S3 containers
   final Session session =
       SessionFactory.createSession(
           new Host(Protocol.S3_SSL, Protocol.S3_SSL.getDefaultHostname(), host.getCredentials()));
   if (session.getHost().getCredentials().validate(session.getHost().getProtocol())) {
     List<String> buckets = new ArrayList<String>();
     for (Path bucket : session.mount().children()) {
       buckets.add(bucket.getName());
     }
     Collections.sort(buckets);
     return buckets;
   }
   return Collections.emptyList();
 }
Пример #2
0
 /** @return */
 public List<Path> copy() {
   return this.copy(SessionFactory.createSession(session.getHost()));
 }