0
我需要检查,如果一个桶上存在S3,并有下面的代码:如何初始化Jets3tNativeFileSystemStore
public static final String S3_URI = "s3n://accessKey:secretKey";
FileSystem fs = new NativeS3FileSystem(new Jets3tNativeFileSystemStore(S3_URI, null));
if (!fs.exists(bucket)) {
getLogger().error("The input directory '{}' does not exists.", bucket);
return false;
}
但是Eclipse抱怨解决不了Jets3tNativeFileSystemStore的类型,和进口报表抱怨org.apache.hadoop .fs.s3native.Jets3tNativeFileSystemStore不可见。检查了Jets3tNativeFileSystemStore的源代码,这是
class Jets3tNativeFileSystemStore implements NativeFileSystemStore {
private S3Service s3Service;
private S3Bucket bucket;
...
这是否意味着它是一个私人类?什么是正确的方法来检查存在S3上的存储桶?谢谢。
是的,改为使用NativeS3FileSystem并直接调用exists(),它的工作原理。谢谢 – user468587 2012-07-23 20:47:45