本文整理了Java中com.twelvemonkeys.io.FileUtil.rename()
方法的一些代码示例,展示了FileUtil.rename()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.rename()
方法的具体详情如下:
包路径:com.twelvemonkeys.io.FileUtil
类名称:FileUtil
方法名:rename
[英]Renames the specified file, if the destination does not exist. If the destination is a directory (and the source is not), the source file is simply moved to the destination directory.
[中]如果目标不存在,则重命名指定的文件。如果目标是目录(而源不是),则只需将源文件移动到目标目录。
代码示例来源:origin: haraldk/TwelveMonkeys
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, File pTo) throws IOException {
return rename(pFrom, pTo, false);
}
代码示例来源:origin: haraldk/TwelveMonkeys
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo) throws IOException {
return rename(pFrom, new File(pTo), false);
}
代码示例来源:origin: haraldk/TwelveMonkeys
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(pFrom, new File(pTo), pOverWrite);
}
代码示例来源:origin: haraldk/TwelveMonkeys
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo) throws IOException {
return rename(new File(pFrom), new File(pTo), false);
}
代码示例来源:origin: haraldk/TwelveMonkeys
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(new File(pFrom), new File(pTo), pOverWrite);
}
代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, File pTo) throws IOException {
return rename(pFrom, pTo, false);
}
代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-io
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, File pTo) throws IOException {
return rename(pFrom, pTo, false);
}
代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-io
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(pFrom, new File(pTo), pOverWrite);
}
代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-io
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo) throws IOException {
return rename(pFrom, new File(pTo), false);
}
代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo) throws IOException {
return rename(pFrom, new File(pTo), false);
}
代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(File pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(pFrom, new File(pTo), pOverWrite);
}
代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo) throws IOException {
return rename(new File(pFrom), new File(pTo), false);
}
代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-io
/**
* Renames the specified file, if the destination does not exist.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo) throws IOException {
return rename(new File(pFrom), new File(pTo), false);
}
代码示例来源:origin: com.github.lafa.twelvemonkeyspurejava.common/common-io
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(new File(pFrom), new File(pTo), pOverWrite);
}
代码示例来源:origin: com.twelvemonkeys/twelvemonkeys-core
/**
* Renames the specified file.
* If the destination is a directory (and the source is not), the source
* file is simply moved to the destination directory.
*
* @param pFrom The name of the file to rename
* @param pTo The new name of the file
* @param pOverWrite Specifies if the tofile should be overwritten, if it
* exists
* @return {@code true}, if the file was renamed.
* @throws java.io.IOException if rename fails
*/
public static boolean rename(String pFrom, String pTo, boolean pOverWrite) throws IOException {
return rename(new File(pFrom), new File(pTo), pOverWrite);
}
内容来源于网络,如有侵权,请联系作者删除!