import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class HDFSRename
{
public static void main(String[] args) throws Exception
{
Configuration conf = new Configuration();
//FileSystem hdfs = FileSystem.get(conf);
FileSystem hdfs = FileSystem.get(URI.create("hdfs://192.168.80.10:9000/"),conf);
Path src = new Path("/test.txt");
Path dst = new Path("/test2.txt");
Boolean isRenamed = hdfs.rename(src,dst);
System.out.println(isRenamed);
}
} import java.net.URI;
import org.apache.had