use of org.pentaho.di.plugins.fileopensave.providers.model.TestDirectory in project pentaho-kettle by pentaho.
the class FileControllerTest method testGetNewName.
@Test
public void testGetNewName() {
TestDirectory testDirectory = new TestDirectory();
testDirectory.setPath("/directory1");
String newName = (String) fileController.getNewName(testDirectory, "/directory1/file1").getData();
Assert.assertEquals("/directory1/file1 1", newName);
}
use of org.pentaho.di.plugins.fileopensave.providers.model.TestDirectory in project pentaho-kettle by pentaho.
the class TestFileProvider method copy.
@Override
public TestFile copy(TestFile file, String toPath, boolean overwrite) throws FileException {
TestFile findFile = findFile(file);
if (findFile != null) {
String parent = toPath.substring(0, toPath.lastIndexOf("/"));
if (findFile instanceof TestDirectory) {
TestDirectory newDirectory = TestDirectory.create(findFile.getName(), toPath, parent);
testFileSystem.get(newDirectory.getParent()).add(newDirectory);
return newDirectory;
} else {
TestFile newFile = TestFile.create(findFile.getName(), toPath, parent);
testFileSystem.get(newFile.getParent()).add(newFile);
return newFile;
}
}
return null;
}
use of org.pentaho.di.plugins.fileopensave.providers.model.TestDirectory in project pentaho-kettle by pentaho.
the class TestFileProvider method getTree.
@Override
public Tree getTree() {
TestTree testTree = new TestTree(NAME);
TestDirectory testDirectory = new TestDirectory();
testDirectory.setPath("/");
testTree.setFiles(getFiles(testDirectory, null));
return testTree;
}
Aggregations