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

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

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

FileUtil.moveFile介绍

暂无

代码示例

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

public static File moveFile(File src, File dest) throws IOException {
  return moveFile(src, dest, fileUtilParams);
}

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

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

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

/**
 * Smart move. If source is a directory, move it to destination.
 * Otherwise, if destination is directory, move source {@link File} to it.
 * Otherwise, try to move source {@link File} to destination {@link File}.
 *
 * @param src  source {@link File}
 * @param dest destination {@link File}
 * @throws IOException if there is an error moving.
 * @see #moveDir(File, File)
 * @see #moveFileToDir(File, File)
 * @see #moveFile(File, File)
 */
public static void move(final File src, final File dest) throws IOException {
  if (src.isDirectory()) {
    moveDir(src, dest);
    return;
  }
  if (dest.isDirectory()) {
    moveFileToDir(src, dest);
    return;
  }
  moveFile(src, dest);
}

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

public static File moveFileToDir(File src, File destDir, FileUtilParams params) throws IOException {
  if (destDir.exists() && !destDir.isDirectory()) {
    throw new IOException(MSG_NOT_A_DIRECTORY + destDir);
  }
  return moveFile(src, file(destDir, src.getName()), params);
}

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

FileUtil.moveFile(root + "w.txt", tmp + "w.txt");
  FileUtil.moveFileToDir(root + "w.png", tmp);
} catch (IOException ioex) {

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

/**
 * Moves a file to a directory.
 *
 * @param srcFile Source {@link File}.
 * @param destDir Destination directory.
 * @throws IOException if there is an error during move.
 */
public static File moveFileToDir(final File srcFile, final File destDir) throws IOException {
  checkExistsAndDirectory(destDir);
  return moveFile(srcFile, file(destDir, srcFile.getName()));
}

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

/**
 * Smart move. If source is a directory, move it to destination.
 * Otherwise, if destination is directory, move source {@link File} to it.
 * Otherwise, try to move source {@link File} to destination {@link File}.
 *
 * @param src  source {@link File}
 * @param dest destination {@link File}
 * @throws IOException if there is an error moving.
 * @see #moveDir(File, File)
 * @see #moveFileToDir(File, File)
 * @see #moveFile(File, File)
 */
public static void move(final File src, final File dest) throws IOException {
  if (src.isDirectory()) {
    moveDir(src, dest);
    return;
  }
  if (dest.isDirectory()) {
    moveFileToDir(src, dest);
    return;
  }
  moveFile(src, dest);
}

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

public static File moveFile(String src, String dest, FileUtilParams params) throws IOException {
  return moveFile(file(src), file(dest), params);
}

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

public static File moveFile(String src, String dest) throws IOException {
  return moveFile(file(src), file(dest), fileUtilParams);
}

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

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

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

/**
 * Moves a file to a directory.
 *
 * @param srcFile Source {@link File}.
 * @param destDir Destination directory.
 * @throws IOException if there is an error during move.
 */
public static File moveFileToDir(final File srcFile, final File destDir) throws IOException {
  checkExistsAndDirectory(destDir);
  return moveFile(srcFile, file(destDir, srcFile.getName()));
}

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

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

相关文章