public class FileUtil {
private static class SingleFileUtill{
private static FileSystem fs = null;
static{
fs = SingleFileUtill.getInstance();
}
private static FileSystem getInstance(){
Configuration conf = new Configuration();
FileSystem fs = null;
try {
fs = FileSystem.get(conf);
return fs;
} catch (IOException e) {
e.printStackTrace();
}
return fs;
}
}
public static FileSystem getFileSystem(){
return SingleFileUtill.fs;
}
}