/** * Replaces target file with source file. * * @param from From. * @param to To. */ private static void replaceWithBackup(File from, File to) { if (!from.canRead()) exit("Failed to read source file '" + from.getAbsolutePath() + "'.", null); println("Replacing file '" + to.getAbsolutePath() + "'."); try { U.copy(from, renameToBak(to), true); } catch (IOException e) { exit("Failed to replace file '" + to.getAbsolutePath() + "'.", e); } }
U.copy(file, cpFile, true);
@Override public Object call() throws Exception { int id = cnt.incrementAndGet(); IgfsPath f = new IgfsPath(path.parent(), "asdf" + (id > 1 ? "-" + id : "")); try (IgfsOutputStream out = fs.create(f, 0, true, null, 0, 1024, null)) { assertNotNull(out); cleanUp.add(f); // Add all created into cleanup list. U.copy(new IgfsTestInputStream(size, salt), out); } return null; } }, WRITING_THREADS_CNT, "perform-multi-thread-writing");
U.copy(in, out);
U.copy(in, out);
U.copy(resolveHadoopConfig("core-site.ignite.xml"), new File(testWorkDir, "core-site.xml"), false);
U.copy(in, out);
U.copy(in, out);
U.copy(in, out);