org.uberfire.backend.vfs.Path.toURI()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(108)

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

Path.toURI介绍

暂无

代码示例

代码示例来源:origin: org.uberfire/uberfire-commons-editor-backend

@Override
  public String getMessage(final Path path) {
    return path.toURI() + " cannot be deleted, moved or renamed. It contains the following locked files: " + lockInfos;
  }
};

代码示例来源:origin: org.uberfire/uberfire-widgets-core-client

@Override
protected Map<String, String> getParameters() {
  HashMap<String, String> parameters = new HashMap<String, String>();
  parameters.put("path",
          path.toURI());
  return parameters;
}

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

@Override
  protected CommentedOption makeCommentedOption( Path source, Path destination, String comment ) {
    return serviceHelper.makeCommentedOption( "File [" + source.toURI() + "] renamed to [" + destination.toURI() + "]." );
  }
}

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

@Override
public void callback( final Map response ) {
  if ( isRegularFile( response ) ) {
    activePath = stripFileName( path );
    setText( activePath.toURI() );
  } else {
    activePath = path;
    setText( activePath.toURI() );
  }
}

代码示例来源:origin: org.guvnor/guvnor-structure-client

private void refreshView(final Path path) {
    final String pathUri = path.toURI();
    for (Repository repository : repositories.values()) {
      final String repositoryUri = repository.getRoot().toURI();
      if (pathUri.startsWith(repositoryUri)) {
        reset();
        break;
      }
    }
  }
}

代码示例来源:origin: org.dashbuilder/dashbuilder-common-client

/**
 * <p>Returns the download URL for a given file provided by a servlet method.</p>
 * @param path The path of the file.
 */
public String getDownloadFileUrl(final Path path) {
  final StringBuilder sb = new StringBuilder(GWT.getModuleBaseURL() + EXPORT_SERVLET_URL);
  sb.append("?").append("path").append("=").append(URL.encode(path.toURI()));
  return sb.toString();
}

代码示例来源:origin: org.guvnor/guvnor-project-backend

protected ConfigGroup findProjectConfig(final Path projectRoot) {
  final Collection<ConfigGroup> groups = configurationService.getConfiguration(ConfigType.PROJECT);
  if (groups != null) {
    for (ConfigGroup groupConfig : groups) {
      if (groupConfig.getName().equals(projectRoot.toURI())) {
        return groupConfig;
      }
    }
  }
  return null;
}

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

private Path stripFileName( final Path path ) {
  String uri = path.toURI();
  uri = uri.replace( path.getFileName(), "" );
  return PathFactory.newPathBasedOn( path.getFileName(), uri, path );
}

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

protected Predicate<ValidationMessage> fromValidatedPath(final Path path) {
  return message -> {
    final String destinationPathURI = removeFileExtension(Paths.normalizePath(path).toURI());
    final String messageURI = message.getPath() != null ? removeFileExtension(Paths.normalizePath(message.getPath()).toURI()) : "";
    return messageURI.isEmpty() || destinationPathURI.endsWith(messageURI);
  };
}

代码示例来源:origin: org.uberfire/uberfire-commons-editor-backend

private void thenPathWasNotCopiedIfExists(final Path path,
                     final RuntimeException e) {
  assertEquals(path.toURI() + " cannot be copied.",
         e.getMessage());
}

代码示例来源:origin: org.kie.guvnor/guvnor-commons-ui

private Path stripFileName( final Path path ) {
  String uri = path.toURI();
  uri = uri.replace( path.getFileName(), "" );
  return PathFactory.newPath( path.getFileSystem(), path.getFileName(), uri );
}

代码示例来源:origin: org.uberfire/uberfire-commons-editor-backend

private void thenPathWasNotDeleted(final Path path,
                  final RuntimeException e) {
  assertEquals(path.toURI() + " cannot be deleted, moved or renamed. It is locked by: lockedBy",
         e.getMessage());
}

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

protected List<Path> getQueryList(Path assetPath,
                   RefactorOperationBuilder<QueryOperationRequest>.RequiresModule builder) {
    KieModule project = moduleService.resolveModule(assetPath);

    String branch = "master";

    org.uberfire.java.nio.file.Path nioPath = Paths.convert(assetPath);

    if (nioPath instanceof SegmentedPath) {
      branch = ((SegmentedPath) nioPath).getSegmentId();
    }

    QueryOperationRequest request = builder.inModuleRootPathURI(project.getRootPath().toURI()).onBranch(branch);

    return refactoringQueryService.queryToList(request).stream().map(row -> (Path) row.getValue()).collect(Collectors.toList());
  }
}

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

protected KieModule getKieModuleMock(final String testModuleRoot,
                   final String testModuleName) {
  final org.uberfire.backend.vfs.Path mockRoot = mock(org.uberfire.backend.vfs.Path.class);
  when(mockRoot.toURI()).thenReturn(testModuleRoot);
  final KieModule mockModule = mock(KieModule.class);
  when(mockModule.getRootPath()).thenReturn(mockRoot);
  when(mockModule.getModuleName()).thenReturn(testModuleName);
  return mockModule;
}

代码示例来源:origin: org.uberfire/uberfire-api

@Test
  public void lockTest() {

    Path path = mock(Path.class);
    when(path.toURI()).thenReturn("default://master@myteam/dora/src/main/resources/com/myteam/dora/sample.drl");

    assertEquals("default://locks@system/system/myteam/master/dora/src/main/resources/com/myteam/dora/sample.drl.ulock",
           PathFactory.newLock(path).toURI());

    Path lockPath = PathFactory.newLockPath(path);

    Path extractedPath = PathFactory.fromLock(lockPath);

    assertEquals(path.toURI(),
           extractedPath.toURI());
  }
}

代码示例来源:origin: org.guvnor/guvnor-project-backend

@Test
public void testReImport() throws Exception {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file://project1/pom.xml");
  when(resourceResolver.resolveProject(any(Path.class))).thenReturn(project);
  abstractProjectService.reImport(path);
  verify(invalidateDMOCache).fire(any(InvalidateDMOProjectCacheEvent.class));
}

代码示例来源:origin: org.uberfire/uberfire-commons-editor-client

@Test
  public void testDownload() {

    final String expectedDownloadURL = "defaulteditor/download?path=default://master@MySpace/Mortgages/src/main/resources/rule.drl";

    when(path.toURI()).thenReturn("default://master@MySpace/Mortgages/src/main/resources/rule.drl");
    doNothing().when(downloadMenuItem).open(any());

    downloadMenuItem.download(pathSupplier);

    verify(downloadMenuItem).open(eq(expectedDownloadURL));
  }
}

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

public static ProjectConcurrentChangePopup newConcurrentChange( final Path project,
                                final User identity,
                                final Command onIgnore,
                                final Command onReOpen ) {
  final String message = ProjectConcurrentChangePopupConstants.INSTANCE.ConcurrentChange( identity != null ? SafeHtmlUtils.htmlEscape( identity.getIdentifier() != null ? identity.getIdentifier() : "" ) : null, project.toURI() );
  return new ProjectConcurrentChangePopup( message, onIgnore, onReOpen );
}

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

@Before
public void setup() {
  this.service = new RuleNameServiceImpl(queryService,
                      projectService);
  when(projectService.resolveModule(any(Path.class))).thenReturn(module);
  when(module.getRootPath()).thenReturn(projectRootPath);
  when(projectRootPath.toURI()).thenReturn(PROJECT_ROOT_URI);
  when(queryService.query(eq(FindRulesByModuleQuery.NAME),
              anySetOf(ValueIndexTerm.class))).thenReturn(getResults());
}

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

@Test
public void returnModule() throws Exception {
  doReturn(new POM()).when(pomService).load(pathArgumentCaptor.capture());
  assertNotNull(resolver.makeModule(Paths.convert(PathFactory.newPath("testFile",
                                    "file:///testFile"))));
  final String pathThatWasUsedToLoadTheModulePomXml = pathArgumentCaptor.getValue().toURI();
  assertThat(pathThatWasUsedToLoadTheModulePomXml).endsWith(":///testFile/pom.xml");
}

相关文章

微信公众号

最新文章

更多