CompressionCodecFactory cf = new CompressionCodecFactory(getConf()); CompressionCodec codec = cf.getCodec(item.path); if (codec != null) {
CompressionCodecFactory cf = new CompressionCodecFactory(getConf()); CompressionCodec codec = cf.getCodec(item.path); if (codec != null) {
CompressionCodecFactory cf = new CompressionCodecFactory(getConf()); CompressionCodec codec = cf.getCodec(item.path); if (codec != null) {
CompressionCodecFactory cf = new CompressionCodecFactory(getConf()); CompressionCodec codec = cf.getCodec(item.path); if (codec != null) {
CompressionCodecFactory cf = new CompressionCodecFactory(getConf()); CompressionCodec codec = cf.getCodec(item.path); if (codec != null) {
Display.Text text = new Display.Text(); text.setConf(conf); Method method = text.getClass().getDeclaredMethod( "getInputStream", PathData.class);
private String readUsingTextCommand(String fileName, byte[] fileContents) throws Exception { createFile(fileName, fileContents); // Prepare and call the Text command's protected getInputStream method // using reflection. Configuration conf = new Configuration(); URI localPath = new URI(fileName); PathData pathData = new PathData(localPath, conf); Display.Text text = new Display.Text() { @Override public InputStream getInputStream(PathData item) throws IOException { return super.getInputStream(item); } }; text.setConf(conf); InputStream stream = (InputStream) text.getInputStream(pathData); return inputStreamToString(stream); }
private String readUsingTextCommand(String fileName, byte[] fileContents) throws Exception { createFile(fileName, fileContents); // Prepare and call the Text command's protected getInputStream method // using reflection. Configuration conf = new Configuration(); URI localPath = new URI(fileName); PathData pathData = new PathData(localPath, conf); Display.Text text = new Display.Text() { @Override public InputStream getInputStream(PathData item) throws IOException { return super.getInputStream(item); } }; text.setConf(conf); InputStream stream = (InputStream) text.getInputStream(pathData); return inputStreamToString(stream); }
@Override public InputStream getInputStream(PathData item) throws IOException { return super.getInputStream(item); } };
@Override public InputStream getInputStream(PathData item) throws IOException { return super.getInputStream(item); } };