001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.commons.io.res.type.s3; 020 021 022 023import lucee.aprint; 024import lucee.commons.date.TimeZoneConstants; 025import lucee.commons.net.http.HTTPResponse; 026 027public class TestS3 { 028 public static void main(String[] args) throws Throwable { 029 030 String accessKeyId = "1DHC5C5FVD7YEPR4DBG2"; 031 String secretAccessKey = "R/sOy3hgimrI8D9c0lFHchoivecnOZ8LyVmJpRFQ"; 032 HTTPResponse m; 033 034 S3 s3=new S3(secretAccessKey, accessKeyId, TimeZoneConstants.CET); 035 //raw = s3.listBucketsRaw(); 036 //print.o(StringUtil.replace(IOUtil.toString(raw, null),"<","\n<",false)); 037 038 //meta = s3.getMetadata("j878", "sub/text.txt"); 039 //print.o(meta); 040 //meta = s3.getMetadata("j878", "sub/xxxx"); 041 //print.o(meta); 042 //raw = s3.aclRaw("j878", null); 043 //print.o(StringUtil.replace(IOUtil.toString(raw, null),"<","\n<",false)); 044 045 046 m = s3.head("j878", "sub/text.txt"); 047 aprint.o(m.getContentAsString()); 048 aprint.e(m.getStatusCode()); 049 //aprint.o(StringUtil.replace(m.getResponseBodyAsString(),"<","\n<",false)); 050 051 //m = s3.head("j878", null); 052 //print.o(m.getResponseHeaders()); 053 //print.o(StringUtil.replace(m.getResponseBodyAsString(),"<","\n<",false)); 054 055 } 056}