jodd.io.FileUtil.copyFile()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中jodd.io.FileUtil.copyFile()方法的一些代码示例,展示了FileUtil.copyFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.copyFile()方法的具体详情如下:
包路径:jodd.io.FileUtil
类名称:FileUtil
方法名:copyFile

FileUtil.copyFile介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

/**
 * @see #copyFile(java.io.File, java.io.File, FileUtilParams)
 */
public static void copyFile(File src, File dest) throws IOException {
  copyFile(src, dest, fileUtilParams);
}

代码示例来源:origin: redisson/redisson

/**
 * Smart copy. If source is a directory, copy it to destination.
 * Otherwise, if destination is directory, copy source file to it.
 * Otherwise, try to copy source file to destination file.
 */
public static void copy(File src, File dest, FileUtilParams params) throws IOException {
  if (src.isDirectory()) {
    copyDir(src, dest, params);
    return;
  }
  if (dest.isDirectory()) {
    copyFileToDir(src, dest, params);
    return;
  }
  copyFile(src, dest, params);
}

代码示例来源:origin: oblac/jodd

/**
 * Smart copy. If source is a directory, copy it to destination.
 * Otherwise, if destination is directory, copy source file to it.
 * Otherwise, try to copy source file to destination file.
 *
 * @param src  source {@link File}
 * @param dest destination {@link File}
 * @throws IOException if there is an error copying.
 * @see #copyDir(File, File)
 * @see #copyFileToDir(File, File)
 * @see #copyFile(File, File)
 */
public static void copy(final File src, final File dest) throws IOException {
  if (src.isDirectory()) {
    copyDir(src, dest);
    return;
  }
  if (dest.isDirectory()) {
    copyFileToDir(src, dest);
    return;
  }
  copyFile(src, dest);
}

代码示例来源:origin: redisson/redisson

/**
 * Copies a file to folder with specified copy params and returns copied destination.
 */
public static File copyFileToDir(File src, File destDir, FileUtilParams params) throws IOException {
  if (destDir.exists() && !destDir.isDirectory()) {
    throw new IOException(MSG_NOT_A_DIRECTORY + destDir);
  }
  File dest = file(destDir, src.getName());
  copyFile(src, dest, params);
  return dest;
}

代码示例来源:origin: oblac/jodd

FileUtil.copyFile(root + "a.txt", root + "w.txt");
  FileUtil.copyFile(root + "a.png", root + "w.png");
  FileUtil.copyFile(root + "a.txt", root + "w.txt");
} catch (IOException ioex) {
  fail(ioex.toString());

代码示例来源:origin: redisson/redisson

/**
 * @see #copyFile(java.io.File, java.io.File, FileUtilParams)
 */
public static void copyFile(String src, String dest, FileUtilParams params) throws IOException {
  copyFile(file(src), file(dest), params);
}
/**

代码示例来源:origin: org.jodd/jodd-core

/**
 * Smart copy. If source is a directory, copy it to destination.
 * Otherwise, if destination is directory, copy source file to it.
 * Otherwise, try to copy source file to destination file.
 *
 * @param src  source {@link File}
 * @param dest destination {@link File}
 * @throws IOException if there is an error copying.
 * @see #copyDir(File, File)
 * @see #copyFileToDir(File, File)
 * @see #copyFile(File, File)
 */
public static void copy(final File src, final File dest) throws IOException {
  if (src.isDirectory()) {
    copyDir(src, dest);
    return;
  }
  if (dest.isDirectory()) {
    copyFileToDir(src, dest);
    return;
  }
  copyFile(src, dest);
}

代码示例来源:origin: redisson/redisson

/**
 * @see #copyFile(java.io.File, java.io.File, FileUtilParams)
 */
public static void copyFile(String src, String dest) throws IOException {
  copyFile(file(src), file(dest), fileUtilParams);
}
/**

代码示例来源:origin: oblac/jodd

/**
 * Copies a {@link File} to directory with specified copy params and returns copied destination.
 */
public static File copyFileToDir(final File srcFile, final File destDir) throws IOException {
  checkExistsAndDirectory(destDir);
  File destFile = file(destDir, srcFile.getName());
  copyFile(srcFile, destFile);
  return destFile;
}

代码示例来源:origin: oblac/jodd

/**
 * @see #copyFile(File, File)
 */
public static void copyFile(final String srcFile, final String destFile) throws IOException {
  copyFile(file(srcFile), file(destFile));
}

代码示例来源:origin: org.jodd/jodd-core

/**
 * Copies a {@link File} to directory with specified copy params and returns copied destination.
 */
public static File copyFileToDir(final File srcFile, final File destDir) throws IOException {
  checkExistsAndDirectory(destDir);
  File destFile = file(destDir, srcFile.getName());
  copyFile(srcFile, destFile);
  return destFile;
}

代码示例来源:origin: org.jodd/jodd-core

/**
 * @see #copyFile(File, File)
 */
public static void copyFile(final String srcFile, final String destFile) throws IOException {
  copyFile(file(srcFile), file(destFile));
}

相关文章