/**
* 我们利用通配符和PathFilter 对象,将本地多种格式的文件上传至 HDFS文件系统,并过滤掉 txt文本格式以外的文件。
*/
import java.io.IOException;
importjava.net.URI;
importjava.net.URISyntaxException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
public class CopyManyFilesToHdfs {
protected static FileSystem fsDst;
protected static FileSystem fsLocal;
public static void main(String[] args) throws IOException, URISyntaxException {
//全路径和相对路径都可
//String dstPath = "/middle/filter/";
String dstPath = "hdfs://dajiangtai:9000/middle/filter/&