本文整理了Java中org.mule.runtime.core.api.util.FileUtils.openDirectory()
方法的一些代码示例,展示了FileUtils.openDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.openDirectory()
方法的具体详情如下:
包路径:org.mule.runtime.core.api.util.FileUtils
类名称:FileUtils
方法名:openDirectory
暂无
代码示例来源:origin: mulesoft/mule
@Test
public void testDirectoryTools() throws Exception {
File dir = FileUtils.openDirectory("src");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.canRead());
assertTrue(dir.isDirectory());
dir = FileUtils.openDirectory("doesNotExist");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.canRead());
assertTrue(dir.isDirectory());
FileUtils.deleteTree(dir);
}
代码示例来源:origin: mulesoft/mule
@Test
public void skipAndMoveCorruptedOrUnreadableFiles() {
final String KEY = "key";
final String VALUE = "value";
try {
File.createTempFile("temp", ".obj", objectStoreFolder.getRoot());
File corruptedFolder = openDirectory(workingDirectory.getAbsolutePath()
+ File.separator + PersistentObjectStorePartition.CORRUPTED_FOLDER);
int corruptedBefore = corruptedFolder.list().length;
partition.store(KEY, VALUE);
// Expect the new stored object, and the partition-descriptor file
assertEquals(2, objectStoreFolder.getRoot().listFiles().length);
// Expect to have one more corrupted file in the corrupted folder
assertEquals(corruptedBefore + 1, corruptedFolder.list().length);
} catch (Exception e) {
fail("Supposed to have skipped corrupted or unreadable files");
}
}
代码示例来源:origin: mulesoft/mule
file.delete();
File dir = FileUtils.openDirectory("src");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.isDirectory());
dir = FileUtils.openDirectory("doesNotExist");
assertNotNull(dir);
assertTrue(dir.exists());
代码示例来源:origin: org.mule.runtime/mule-core
public void setWorkingDirectory(String workingDirectory) {
if (verifyContextNotInitialized()) {
try {
File canonicalFile = FileUtils.openDirectory(workingDirectory);
this.workingDirectory = canonicalFile.getCanonicalPath();
} catch (IOException e) {
throw new IllegalArgumentException(CoreMessages.initialisationFailure("Invalid working directory").getMessage(), e);
}
}
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void testDirectoryTools() throws Exception {
File dir = FileUtils.openDirectory("src");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.canRead());
assertTrue(dir.isDirectory());
dir = FileUtils.openDirectory("doesNotExist");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.canRead());
assertTrue(dir.isDirectory());
FileUtils.deleteTree(dir);
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
@Test
public void skipAndMoveCorruptedOrUnreadableFiles() {
final String KEY = "key";
final String VALUE = "value";
try {
File.createTempFile("temp", ".obj", objectStoreFolder.getRoot());
File corruptedFolder = openDirectory(workingDirectory.getAbsolutePath()
+ File.separator + PersistentObjectStorePartition.CORRUPTED_FOLDER);
int corruptedBefore = corruptedFolder.list().length;
partition.store(KEY, VALUE);
// Expect the new stored object, and the partition-descriptor file
assertEquals(2, objectStoreFolder.getRoot().listFiles().length);
// Expect to have one more corrupted file in the corrupted folder
assertEquals(corruptedBefore + 1, corruptedFolder.list().length);
} catch (Exception e) {
fail("Supposed to have skipped corrupted or unreadable files");
}
}
代码示例来源:origin: org.mule.runtime/mule-core-tests
file.delete();
File dir = FileUtils.openDirectory("src");
assertNotNull(dir);
assertTrue(dir.exists());
assertTrue(dir.isDirectory());
dir = FileUtils.openDirectory("doesNotExist");
assertNotNull(dir);
assertTrue(dir.exists());
内容来源于网络,如有侵权,请联系作者删除!