FileStatus[] contents = listStatus(qSrc); for (FileStatus content : contents) { copy(makeQualified(content.getPath()), makeQualified(new Path(qDst, content.getPath().getName())), deleteSource, overwrite);
@Test public void testRecursiveFcCopy() throws Exception { final String ts = "some random text"; Path dir1 = getTestRootPath(fc, "dir1"); Path dir2 = getTestRootPath(fc, "dir2"); Path file1 = new Path(dir1, "file1"); fc.mkdir(dir1, null, false); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); Path file2 = new Path(dir2, "file1"); fc.util().copy(dir1, dir2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); } }
@Test public void testFcCopy() throws Exception{ final String ts = "some random text"; Path file1 = getTestRootPath(fc, "file1"); Path file2 = getTestRootPath(fc, "file2"); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); fc.util().copy(file1, file2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); }
FileStatus[] contents = listStatus(qSrc); for (FileStatus content : contents) { copy(makeQualified(content.getPath()), makeQualified(new Path(qDst, content.getPath().getName())), deleteSource, overwrite);
@Test public void testRecursiveFcCopy() throws Exception { final String ts = "some random text"; Path dir1 = fileContextTestHelper.getTestRootPath(fc, "dir1"); Path dir2 = fileContextTestHelper.getTestRootPath(fc, "dir2"); Path file1 = new Path(dir1, "file1"); fc.mkdir(dir1, null, false); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); Path file2 = new Path(dir2, "file1"); fc.util().copy(dir1, dir2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); } }
@Test public void testRecursiveFcCopy() throws Exception { final String ts = "some random text"; Path dir1 = fileContextTestHelper.getTestRootPath(fc, "dir1"); Path dir2 = fileContextTestHelper.getTestRootPath(fc, "dir2"); Path file1 = new Path(dir1, "file1"); fc.mkdir(dir1, null, false); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); Path file2 = new Path(dir2, "file1"); fc.util().copy(dir1, dir2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); } }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst); }
@Test public void testFcCopy() throws Exception{ final String ts = "some random text"; Path file1 = fileContextTestHelper.getTestRootPath(fc, "file1"); Path file2 = fileContextTestHelper.getTestRootPath(fc, "file2"); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); fc.util().copy(file1, file2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); }
@Test public void testFcCopy() throws Exception{ final String ts = "some random text"; Path file1 = fileContextTestHelper.getTestRootPath(fc, "file1"); Path file2 = fileContextTestHelper.getTestRootPath(fc, "file2"); writeFile(fc, file1, ts.getBytes()); assertTrue(fc.util().exists(file1)); fc.util().copy(file1, file2); // verify that newly copied file2 exists assertTrue("Failed to copy file2 ", fc.util().exists(file2)); // verify that file2 contains test string assertTrue("Copied files does not match ",Arrays.equals(ts.getBytes(), readFile(fc,file2,ts.getBytes().length))); }
/** * Copy a file using the {@link #lfs} {@link FileContext}. * * @param src the file to copy * @param dst where to copy the file * @param owner the owner of the new copy. Used only in secure Windows * clusters * @throws IOException when the copy fails * @see WindowsSecureContainerExecutor */ protected void copyFile(Path src, Path dst, String owner) throws IOException { lfs.util().copy(src, dst, false, true); }
/** * Copy file from src to dest. See * {@link #copy(Path, Path, boolean, boolean)} */ public boolean copy(final Path src, final Path dst) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException { return copy(src, dst, false, false); }
/** * Copy file from src to dest. See * {@link #copy(Path, Path, boolean, boolean)} */ public boolean copy(final Path src, final Path dst) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException { return copy(src, dst, false, false); }
/** * Copy file from src to dest. See * {@link #copy(Path, Path, boolean, boolean)} */ public boolean copy(final Path src, final Path dst) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException { return copy(src, dst, false, false); }
/** * Copy file from src to dest. See * {@link #copy(Path, Path, boolean, boolean)} */ public boolean copy(final Path src, final Path dst) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException { return copy(src, dst, false, false); }
/** * Copy file from src to dest. See * {@link #copy(Path, Path, boolean, boolean)} */ public boolean copy(final Path src, final Path dst) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException { return copy(src, dst, false, false); }