本文整理了Java中org.uberfire.java.nio.file.DirectoryStream.close()
方法的一些代码示例,展示了DirectoryStream.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DirectoryStream.close()
方法的具体详情如下:
包路径:org.uberfire.java.nio.file.DirectoryStream
类名称:DirectoryStream
方法名:close
暂无
代码示例来源:origin: org.uberfire/uberfire-project-backend
private void lookForModulesFromFolders(final Path folderPath) {
final DirectoryStream<Path> nioRepositoryPaths = ioService.newDirectoryStream(folderPath);
try {
for (final Path nioRepositoryPath : nioRepositoryPaths) {
if (Files.isDirectory(nioRepositoryPath)) {
findModule(nioRepositoryPath,
false);
}
}
} finally {
nioRepositoryPaths.close();
}
}
代码示例来源:origin: kiegroup/appformer
private void lookForModulesFromFolders(final Path folderPath) {
final DirectoryStream<Path> nioRepositoryPaths = ioService.newDirectoryStream(folderPath);
try {
for (final Path nioRepositoryPath : nioRepositoryPaths) {
if (Files.isDirectory(nioRepositoryPath)) {
findModule(nioRepositoryPath,
false);
}
}
} finally {
nioRepositoryPaths.close();
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-backend
private Collection<DriverDefInfo> resolveDrivers(final Path path) {
final org.uberfire.java.nio.file.Path nioPath = Paths.convert(path);
final List<DriverDefInfo> result = new ArrayList<>();
try {
final DirectoryStream<org.uberfire.java.nio.file.Path> stream = ioService.newDirectoryStream(nioPath,
entry -> Files.isRegularFile(entry) &&
!entry.getFileName().toString().startsWith(".") &&
entry.getFileName().toString().endsWith(DRIVER_FILE_TYPE));
stream.forEach(file -> {
result.add(createDriverInfo(file));
});
stream.close();
return result;
} catch (Exception e) {
logger.error("It was not possible read drivers info from: " + path,
e);
throw ExceptionUtilities.handleException(e);
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-backend
private Collection<DataSourceDefInfo> resolveDataSources(final Path path) {
final org.uberfire.java.nio.file.Path nioPath = Paths.convert(path);
final List<DataSourceDefInfo> result = new ArrayList<>();
try {
final DirectoryStream<org.uberfire.java.nio.file.Path> stream = ioService.newDirectoryStream(nioPath,
entry -> Files.isRegularFile(entry) &&
!entry.getFileName().toString().startsWith(".") &&
entry.getFileName().toString().endsWith(DS_FILE_TYPE));
stream.forEach(file -> {
result.add(createDataSourceDefInfo(file));
});
stream.close();
return result;
} catch (Exception e) {
logger.error("It was not possible read data sources info from: " + path,
e);
throw ExceptionUtilities.handleException(e);
}
}
代码示例来源:origin: org.guvnor/guvnor-project-backend
public Set<Project> getProjects(final Repository repository,
String branch,
boolean secure) {
final Set<Project> authorizedProjects = new HashSet<Project>();
if (repository == null) {
return authorizedProjects;
}
final Path repositoryRoot = repository.getBranchRoot(branch);
final DirectoryStream<org.uberfire.java.nio.file.Path> nioRepositoryPaths = ioService.newDirectoryStream(Paths.convert(repositoryRoot));
try {
for (org.uberfire.java.nio.file.Path nioRepositoryPath : nioRepositoryPaths) {
if (Files.isDirectory(nioRepositoryPath)) {
final org.uberfire.backend.vfs.Path projectPath = Paths.convert(nioRepositoryPath);
final Project project = resourceResolver.resolveProject(projectPath);
if (project != null) {
if (!secure || authorizationManager.authorize(project,
sessionInfo.getIdentity())) {
POM projectPom = pomService.load(project.getPomXMLPath());
project.setPom(projectPom);
authorizedProjects.add(project);
}
}
}
}
} finally {
nioRepositoryPaths.close();
}
return authorizedProjects;
}
代码示例来源:origin: org.uberfire/uberfire-nio2-fs
.isInstanceOf(UnsupportedOperationException.class);
stream2.close();
assertThatThrownBy(() -> stream2.close())
.isInstanceOf(org.uberfire.java.nio.IOException.class)
.hasMessage("This stream is closed.");
path2);
stream3.close();
代码示例来源:origin: kiegroup/appformer
.isInstanceOf(UnsupportedOperationException.class);
stream2.close();
assertThatThrownBy(() -> stream2.close())
.isInstanceOf(org.uberfire.java.nio.IOException.class)
.hasMessage("This stream is closed.");
path2);
stream3.close();
代码示例来源:origin: org.uberfire/vfs-api
stream.close();
} catch (IOException ex) {
if (postException == null) {
代码示例来源:origin: org.uberfire/uberfire-nio2-api
stream.close();
} catch (IOException ex) {
if (postException == null) {
代码示例来源:origin: kiegroup/appformer
stream.close();
} catch (IOException ex) {
if (postException == null) {
内容来源于网络,如有侵权,请联系作者删除!