Path dirPath = new Path(inputPath, "dir");
Path filee = new Path(dirPath, "e");
fs.mkdirs(dirPath);
CopyFilesBase.createFileWithContent(fs, filee, "e".getBytes());
{
HadoopArchives har = new HadoopArchives(conf);
// create full archive
String[] args = {
"-archiveName",
archive2.getName(),
"-p", inputPath.toString(),
filea.getName(),
fileb.getName(),
filec.getName(),
filed.getName(),
"dir/e",
archivePath.toString()
};
int ret = ToolRunner.run(har, args);
assertTrue("failed test", ret == 0);
}
{
HadoopArchives har = new HadoopArchives(conf);
// create archive without a, b, e
String[] args = {
"-archiveName",
archive.getName(),
"-p", inputPath.toString(),
filec.getName(),
filed.getName(),
archivePath.toString()
};
int ret = ToolRunner.run(har, args);
assertTrue("failed test", ret == 0);
}
{
HadoopArchives har = new HadoopArchives(conf);
// append to archive
String[] args = {
"-appendFromArchive",
archive2.toString(),
"/a",