001 package railo.commons.io.res.type.s3; 002 003 004 005 import railo.aprint; 006 import railo.commons.date.TimeZoneConstants; 007 import railo.commons.net.http.HTTPResponse; 008 009 public class TestS3 { 010 public static void main(String[] args) throws Throwable { 011 012 String accessKeyId = "1DHC5C5FVD7YEPR4DBG2"; 013 String secretAccessKey = "R/sOy3hgimrI8D9c0lFHchoivecnOZ8LyVmJpRFQ"; 014 HTTPResponse m; 015 016 S3 s3=new S3(secretAccessKey, accessKeyId, TimeZoneConstants.CET); 017 //raw = s3.listBucketsRaw(); 018 //print.o(StringUtil.replace(IOUtil.toString(raw, null),"<","\n<",false)); 019 020 //meta = s3.getMetadata("j878", "sub/text.txt"); 021 //print.o(meta); 022 //meta = s3.getMetadata("j878", "sub/xxxx"); 023 //print.o(meta); 024 //raw = s3.aclRaw("j878", null); 025 //print.o(StringUtil.replace(IOUtil.toString(raw, null),"<","\n<",false)); 026 027 028 m = s3.head("j878", "sub/text.txt"); 029 aprint.o(m.getContentAsString()); 030 aprint.e(m.getStatusCode()); 031 //aprint.o(StringUtil.replace(m.getResponseBodyAsString(),"<","\n<",false)); 032 033 //m = s3.head("j878", null); 034 //print.o(m.getResponseHeaders()); 035 //print.o(StringUtil.replace(m.getResponseBodyAsString(),"<","\n<",false)); 036 037 } 038 }