org.uberfire.java.nio.file.FileSystems.getFileSystem()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.uberfire.java.nio.file.FileSystems.getFileSystem()方法的一些代码示例,展示了FileSystems.getFileSystem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileSystems.getFileSystem()方法的具体详情如下:
包路径:org.uberfire.java.nio.file.FileSystems
类名称:FileSystems
方法名:getFileSystem

FileSystems.getFileSystem介绍

暂无

代码示例

代码示例来源:origin: kiegroup/appformer

@Override
public FileSystem getFileSystem(final URI uri) {
  try {
    return registerFS(FileSystems.getFileSystem(uri));
  } catch (final Exception ex) {
    logger.error("Failed to register filesystem " + uri + " with DEFAULT_FS_TYPE. Returning null.",
           ex);
    return null;
  }
}

代码示例来源:origin: kiegroup/appformer

@Test
public void getFileSystemNull() {
  assertThatThrownBy(() -> FileSystems.getFileSystem(null))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Parameter named 'uri' should be not null!");
}

代码示例来源:origin: kiegroup/appformer

@Override
public FileSystem newFileSystem(final URI uri,
                final Map<String, ?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, IOException, SecurityException {
  try {
    final FileSystem fs = FileSystems.newFileSystem(uri,
                            env);
    return registerFS(fs);
  } catch (final FileSystemAlreadyExistsException ex) {
    registerFS(FileSystems.getFileSystem(uri));
    throw ex;
  }
}

代码示例来源:origin: kiegroup/appformer

@Test
public void testGetFileSystemByURI() {
  assertThat(FileSystems.getFileSystem(URI.create("default:///"))).isInstanceOf(BaseSimpleFileSystem.class);
  assertThat(FileSystems.getFileSystem(URI.create("file:///"))).isInstanceOf(BaseSimpleFileSystem.class);
}

代码示例来源:origin: org.guvnor/guvnor-ala-build-maven

@Override
public Optional<BinaryConfig> apply(final MavenBuild mavenBuild,
                  final MavenBuildExecConfig mavenBuildExecConfig) {
  final Project project = mavenBuild.getProject();
  final MavenProject mavenProject = build(project,
                      mavenBuild.getGoals(),
                      mavenBuild.getProperties());
  final Path path = FileSystems.getFileSystem(URI.create("file://default")).getPath(project.getTempDir() + "/target/" + project.getExpectedBinary());
  final MavenBinary binary = new MavenProjectBinaryImpl(
      path,
      project,
      mavenProject.getGroupId(),
      mavenProject.getArtifactId(),
      mavenProject.getVersion());
  buildRegistry.registerBinary(binary);
  return Optional.of(binary);
}

代码示例来源:origin: org.guvnor/guvnor-ala-build-maven

@Override
public Optional<MavenBinary> apply(final MavenDependencyConfig config) {
  final String artifactId = config.getArtifact();
  checkNotEmpty("artifact parameter is mandatory",
         artifactId);
  LOGGER.debug("Resolving Artifact: {}",
         artifactId);
  final Artifact artifact = resolveArtifact(artifactId);
  if (artifact == null) {
    throw new RuntimeException("Cannot resolve Maven artifact. Look at the previous logs for more information.");
  }
  final String absolutePath = artifact.getFile().getAbsolutePath();
  LOGGER.debug("Resolved Artifact path: {}",
         absolutePath);
  final Path path = FileSystems.getFileSystem(URI.create("file://default")).getPath(absolutePath);
  final MavenBinary binary = new MavenBinaryImpl(path,
                          artifact.getArtifactId(),
                          artifact.getGroupId(),
                          artifact.getArtifactId(),
                          artifact.getVersion());
  buildRegistry.registerBinary(binary);
  return Optional.of(binary);
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

final URI fs = new URI("git://test");
try {
  FileSystems.getFileSystem(fs);
} catch (FileSystemNotFoundException e) {
  FileSystems.newFileSystem(fs,
when(nioPath.resolve(any(String.class))).thenReturn(nioPath);
when(nioPath.toUri()).thenReturn(URI.create("git://test/p0/pom.xml"));
when(nioPath.getFileSystem()).thenReturn(FileSystems.getFileSystem(fs));
when(ioService.get(any(URI.class))).thenReturn(nioPath);

代码示例来源:origin: org.guvnor/guvnor-ala-source-git

} catch (FileSystemAlreadyExistsException fsae) {
  try {
    fileSystem = FileSystems.getFileSystem(fsURI);
  } catch (final Exception ex) {
    throw new SourcingException("Error Getting Source",

代码示例来源:origin: org.guvnor/guvnor-ala-source-git

final URI uri = URI.create("git://" + gitConfig.getRepoName() + "?sync");
try {
  FileSystems.getFileSystem(uri);
} catch (Exception ex) {

代码示例来源:origin: org.kie.workbench/kie-wb-common-ala-build-maven

final FileSystem fs = FileSystems.getFileSystem(originRepo);

相关文章