package copyFormLocal;
import org.apache.hadoop.fs.FileStatus;import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
public class CopyFile {
public static void main(String[] args)throws Exception
{
Configuration conf=new Configuration();
conf.set("fs.default.name", "hdfs://jinyaoyuan:8020"); //very important!添加上这个语句问题就消失了
FileSystem hdfs=FileSystem.get(conf);
System.out.println(System.getProperty("user.dir"));
Path src=new Path("/Users/jinyaoyuan/Documents/workspace/copyFormLocal/test.txt");
Path dst=new Path("//copyFile/test.txt");
hdfs.copyFromLocalFile(src, dst);
System.out.prin