public FileResource<I> assertAddSource(String name, String ext, String content) { try { ReadWriteFileSystem<I> fs = strategy.sourcePath; String[] atoms = Tools.split(name, '.'); I path; if (atoms.length > 1) { path = fs.makePath(Tools.iterable(atoms, 0, atoms.length - 1)); fs.createDir(path); } else { path = fs.getRoot(); } path = fs.makePath(path, atoms[atoms.length - 1] + "." + ext); fs.updateResource(path, new Resource(content)); return new FileResource<I>(fs, path); } catch (IOException e) { throw AbstractTestCase.failure(e); } }
public FileResource<I> assertAddSource(String name, String ext, String content) { try { ReadWriteFileSystem<I> fs = strategy.sourcePath; String[] atoms = Tools.split(name, '.'); I path; if (atoms.length > 1) { path = fs.makePath(Tools.iterable(atoms, 0, atoms.length - 1)); fs.createDir(path); } else { path = fs.getRoot(); } path = fs.makePath(path, atoms[atoms.length - 1] + "." + ext); fs.updateResource(path, new Resource(content)); return new FileResource<I>(fs, path); } catch (IOException e) { throw AbstractTestCase.failure(e); } }