本文整理了Java中org.uberfire.java.nio.file.DirectoryStream.spliterator()
方法的一些代码示例,展示了DirectoryStream.spliterator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DirectoryStream.spliterator()
方法的具体详情如下:
包路径:org.uberfire.java.nio.file.DirectoryStream
类名称:DirectoryStream
方法名:spliterator
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Override
public ProjectType getProjectType(Path projectRootPath) {
try (DirectoryStream<org.uberfire.java.nio.file.Path> paths =
ioService.newDirectoryStream(Paths.convert(projectRootPath), f -> f.getFileName().toString().startsWith("."))) {
return ProjectType.fromFileName(StreamSupport.stream(paths.spliterator(), false)
.map(Paths::convert)
.map(Path::getFileName)
.findFirst()
).orElse(null);
}
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Before
public void setUp() throws Exception {
ArgumentCaptor<DirectoryStream.Filter> filter = ArgumentCaptor.forClass(DirectoryStream.Filter.class);
when(ioService.newDirectoryStream(any(), filter.capture())).thenReturn(directoryStream);
when(directoryStream.spliterator()).thenReturn(Arrays.asList(fsPath).spliterator());
when(projectPath.toURI()).thenReturn(DIR_URI);
when(fsPath.getFileName()).thenReturn(fileName);
when(fsPath.toUri()).thenReturn(new URI(FILE_URI));
when(fsPath.getFileSystem()).thenReturn(fs);
when(fileName.toString()).thenReturn(FILE_NAME);
tested = new BPMNDiagramServiceImpl(ioService);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
@Test
public void getProjectTypeNull() {
when(directoryStream.spliterator()).thenReturn(Collections.<Path>emptyList().spliterator());
final ProjectType projectType = tested.getProjectType(projectPath);
assertEquals(projectType, null);
}
}
内容来源于网络,如有侵权,请联系作者删除!