package org.apache.hadoop.io; import java.io.IOException; import java.net.URISyntaxException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class BlobCopyUtil { public static void main(String[] args) throws IllegalArgumentException, IOException, URISyntaxException { copyUtil( new Path( "wasb://test@hadoopazurejihdistorage.blob.core.windows.net/file1"), new Path( "wasb://test@surendrahdistorage.blob.core.windows.net/file5")); } public static void copyUtil(Path src, Path dest) throws IOException, URISyntaxException { Configuration conf = new Configuration(); FileSystem storage1Fs = src.getFileSystem(conf); FileSystem storage2Fs = dest.getFileSystem(conf); FSDataInputStream in = storage1Fs .open(Path.getPathWithoutSchemeAndAuthority(src)); FSDataOutputStream out = storage2Fs .create(Path.getPathWithoutSchemeAndAuthority(dest)); IOUtils.copyBytes(in, out, 512 * 1024 * 1024); } }