/** * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm * is chosen depending on the platform. */ public static Checksum newCrc32() { return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32(); }
/** * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm * is chosen depending on the platform. */ public static Checksum newCrc32() { return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32(); }
@Override protected boolean emulatingSymlinksOnWindows() { // Java 6 on Windows has very poor symlink support. Specifically // Specifically File#length and File#renameTo do not work as expected. // (see HADOOP-9061 for additional details) // Hence some symlink tests will be skipped. // return (Shell.WINDOWS && !Shell.isJava7OrAbove()); }
@Override protected boolean emulatingSymlinksOnWindows() { // Java 6 on Windows has very poor symlink support. Specifically // Specifically File#length and File#renameTo do not work as expected. // (see HADOOP-9061 for additional details) // Hence some symlink tests will be skipped. // return (Shell.WINDOWS && !Shell.isJava7OrAbove()); }
/** * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm * is chosen depending on the platform. */ public static Checksum newCrc32() { return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32(); }
@Override protected void link(Path src, Path dst) throws IOException { File srcFile = new File(src.toUri().getPath()); String srcFileStr = srcFile.getPath(); String dstFileStr = new File(dst.toString()).getPath(); // If not on Java7+ on Windows, then copy file instead of symlinking. // See also FileUtil#symLink for full explanation. if (!Shell.isJava7OrAbove() && srcFile.isFile()) { lineWithLenCheck(String.format("@copy \"%s\" \"%s\"", srcFileStr, dstFileStr)); errorCheck(); } else { lineWithLenCheck(String.format("@%s symlink \"%s\" \"%s\"", Shell.WINUTILS, dstFileStr, srcFileStr)); errorCheck(); } }
@Override protected void link(Path src, Path dst) throws IOException { File srcFile = new File(src.toUri().getPath()); String srcFileStr = srcFile.getPath(); String dstFileStr = new File(dst.toString()).getPath(); // If not on Java7+ on Windows, then copy file instead of symlinking. // See also FileUtil#symLink for full explanation. if (!Shell.isJava7OrAbove() && srcFile.isFile()) { lineWithLenCheck(String.format("@copy \"%s\" \"%s\"", srcFileStr, dstFileStr)); errorCheck(); } else { lineWithLenCheck(String.format("@%s symlink \"%s\" \"%s\"", Shell.WINUTILS, dstFileStr, srcFileStr)); errorCheck(); } }
if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) { try { LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +
if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) { try { LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +
if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) { try { LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +
Assert.assertFalse(file.exists()); if (Shell.WINDOWS && !Shell.isJava7OrAbove()) {
Assert.assertFalse(file.exists()); if (Shell.WINDOWS && !Shell.isJava7OrAbove()) {