return (false);
}
<<<<<<< HEAD
public boolean putToS3(BufferedInputStream reader, String output){
return (putToS3(reader, output, false, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT, ClientConfiguration.DEFAULT_MAX_CONNECTIONS, ClientConfiguration.DEFAULT_MAX_RETRIES, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT));
=======
public boolean putToHDFS(BufferedInputStream reader, String output){
return(putToHDFS(reader, output, null, null));
}
/**
* The output path is an HDFS URL that look like
* hdfs:////
*
* TODO:
*
* 1) encryption/decryption
* 2) support for dir or file writes
*
* @param reader
* @param output
* @param decryptCipher
* @param encryptCipher
* @return
*/
public boolean putToHDFS(InputStream reader, String output, Cipher decryptCipher, Cipher encryptCipher) {
try {
// Hadoop stuff
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(URI.create(output), conf);
// delete if it already exists
if (fs.exists(new Path(output))) {
Log.stdout(" PATH EXISTS ");
// delete it
}
OutputStream out = fs.create(new Path(output + "/foo.txt" ));
IOUtils.copyBytes(reader, out, 4096, true);
// Close all the file descripters
reader.close();
out.close();
fs.close();
return(true);
} catch (IOException ex) {
Logger.getLogger(ProvisionFilesUtil.class.getName()).log(Level.SEVERE, null, ex);
return(false);
}
>>>>>>> 8318abce8755f6bdd110e3cfeb842f363917318f
}
/** |