本文整理了Java中org.mule.runtime.core.api.util.FileUtils.renameFile()
方法的一些代码示例,展示了FileUtils.renameFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.renameFile()
方法的具体详情如下:
包路径:org.mule.runtime.core.api.util.FileUtils
类名称:FileUtils
方法名:renameFile
暂无
代码示例来源:origin: mulesoft/mule
@Test
public void testRenameFileAcrossFolders() {
try {
File dir = createTestDir("test");
File sourceFile = createTestFile("source");
File destFile = new File(dir, "dest");
assertTrue(FileUtils.renameFile(sourceFile, destFile));
assertTrue(destFile.exists());
assertTrue(destFile.delete());
assertTrue(dir.delete());
} catch (Exception e) {
fail(e.getMessage());
}
}
代码示例来源:origin: mulesoft/mule
@Test
public void testRenameFile() {
try {
File sourceFile = createTestFile("source");
File destFile = createTestFile("dest");
assertTrue(destFile.delete());
assertTrue(FileUtils.renameFile(sourceFile, destFile));
assertTrue(destFile.exists());
assertTrue(destFile.delete());
} catch (Exception e) {
fail(e.getMessage());
}
}
代码示例来源:origin: org.mule.runtime/mule-core
public static boolean renameFile(String srcFilePath, String destFilePath) {
if (StringUtils.isNotBlank(srcFilePath) && StringUtils.isNotBlank(destFilePath)) {
return renameFile(new File(srcFilePath), new File(destFilePath));
} else {
return false;
}
}
代码示例来源:origin: org.mule.runtime/mule-core
public static void appendJarFileEntries(File jarFile, LinkedHashMap entries) throws Exception {
if (entries != null) {
LinkedHashMap combinedEntries = readJarFileEntries(jarFile);
combinedEntries.putAll(entries);
File tmpJarFile = File.createTempFile(jarFile.getName(), null);
createJarFileEntries(tmpJarFile, combinedEntries);
jarFile.delete();
FileUtils.renameFile(tmpJarFile, jarFile);
}
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void testRenameFileAcrossFolders() {
try {
File dir = createTestDir("test");
File sourceFile = createTestFile("source");
File destFile = new File(dir, "dest");
assertTrue(FileUtils.renameFile(sourceFile, destFile));
assertTrue(destFile.exists());
assertTrue(destFile.delete());
assertTrue(dir.delete());
} catch (Exception e) {
fail(e.getMessage());
}
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void testRenameFile() {
try {
File sourceFile = createTestFile("source");
File destFile = createTestFile("dest");
assertTrue(destFile.delete());
assertTrue(FileUtils.renameFile(sourceFile, destFile));
assertTrue(destFile.exists());
assertTrue(destFile.delete());
} catch (Exception e) {
fail(e.getMessage());
}
}
内容来源于网络,如有侵权,请联系作者删除!