本文整理汇总了Java中org.jets3t.service.model.S3Object.closeDataInputStream方法的典型用法代码示例。如果您正苦于以下问题:Java S3Object.closeDataInputStream方法的具体用法?Java S3Object.closeDataInputStream怎么用?Java S3Object.closeDataInputStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jets3t.service.model.S3Object
的用法示例。
在下文中一共展示了S3Object.closeDataInputStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contentStreamClosed
import org.jets3t.service.model.S3Object; //导入方法依赖的package包/类
public void contentStreamClosed() throws ContentIOException {
if(LOG.isDebugEnabled()){
LOG.debug("S3StreamListener.contentStreamClosed(): Retrieving Temp File Stream");
}
try {
final File file = writer.getTempFile();
final long size = file.length();
writer.setSize(size);
final String url = writer.getNodeUrl();
final S3Object object = new S3Object(url);
object.setDataInputFile(file);
object.setContentLength(size);
object.setContentType("application/octetstream");
try {
s3Service.putObject(bucket, object);
} catch (S3ServiceException s3ServExcp) {
if(LOG.isErrorEnabled()){
LOG.error("S3StreamListener Failed to Upload File: "+ s3ServExcp);
}
} finally {
//clean data input stream
object.closeDataInputStream();
}
} catch (Exception excp) {
if(LOG.isErrorEnabled()){
LOG.error("S3StreamListener Failed: "+ excp);
}
}
}
开发者ID:abhinavmishra14,项目名称:alfresco-amazon-s3-content-store-integration,代码行数:31,代码来源:S3StreamListener.java
示例2: fullText
import org.jets3t.service.model.S3Object; //导入方法依赖的package包/类
public String fullText(String s3Link, long startOffset, long endOffset)
throws IOException, ServiceException {
S3Object inputObject = s3.getObject("aws-publicdatasets", s3Link, null,
null, null, null, startOffset, endOffset);
WarcReader warcReader = WarcReaderFactory
.getReaderCompressed(inputObject.getDataInputStream());
WarcRecord wr = warcReader.getNextRecord();
String s = IOUtils.toString(wr.getPayloadContent());
inputObject.closeDataInputStream();
warcReader.close();
return s;
}