Caleb Shei
12/07/2022, 2:34 PM@Override
public void copyFromLocalFile(File srcFile, URI dstUri)
throws Exception {
if (srcFile.isDirectory()) {
throw new IllegalArgumentException(srcFile.getAbsolutePath() + " is a direactory");
}
_hadoopFS.copyFromLocalFile(new Path(srcFile.toURI()), new Path(dstUri));
}
public void copyFromLocalDir(File srcFile, URI dstUri)
throws Exception {
Path srcPath = new Path(srcFile.toURI());
if (!_hadoopFS.isDirectory(srcPath)) {
throw new IllegalArgumentException(srcFile.getAbsolutePath() + " is not a directory");
}
_hadoopFS.copyFromLocalFile(srcPath, new Path(dstUri));
}Caleb Shei
12/07/2022, 2:38 PMcopyFromLocalDir uses _hadoopFS to check if the given local File is a directory - _hadoopFS.isDirectory(srcPath) . I think it should be changed to srcFile.isDirectory() instead like the one in the first method.Jackie
12/07/2022, 6:02 PMXiaobing
12/07/2022, 6:21 PMCaleb Shei
12/07/2022, 6:34 PM