Java 类org.eclipse.xtext.util.UriUtil 实例源码

项目:xtext-core    文件:FileProjectConfig.java   
public FileProjectConfig(final URI path, final String name, final IWorkspaceConfig workspaceConfig) {
  this.path = UriUtil.toFolderURI(path);
  this.name = name;
  IWorkspaceConfig _elvis = null;
  if (workspaceConfig != null) {
    _elvis = workspaceConfig;
  } else {
    WorkspaceConfig _workspaceConfig = new WorkspaceConfig(this);
    _elvis = _workspaceConfig;
  }
  this.workspaceConfig = _elvis;
}
项目:xtext-core    文件:FileProjectConfig.java   
@Override
public FileSourceFolder findSourceFolderContaining(final URI member) {
  final Function1<FileSourceFolder, Boolean> _function = (FileSourceFolder source) -> {
    return Boolean.valueOf(UriUtil.isPrefixOf(source.getPath(), member));
  };
  return IterableExtensions.<FileSourceFolder>findFirst(this.sourceFolders, _function);
}
项目:xtext-core    文件:BuildRequest.java   
public URI getBaseDir() {
  if ((this.baseDir == null)) {
    final String userDir = System.getProperty("user.dir");
    File _file = new File(userDir);
    this.baseDir = UriUtil.createFolderURI(_file);
  }
  return this.baseDir;
}
项目:xtext-core    文件:ProjectConfig.java   
@Override
public ISourceFolder findSourceFolderContaining(final URI member) {
  final Function1<SourceFolder, Boolean> _function = (SourceFolder it) -> {
    return Boolean.valueOf(UriUtil.isPrefixOf(this.path, member));
  };
  return IterableExtensions.<SourceFolder>findFirst(this.sourceFolders, _function);
}
项目:xtext-core    文件:UriUtilTest.java   
@Test
public void testFolderUriHasTrailingSeparator() {
  final File folder = new File(".");
  final URI uri = UriUtil.createFolderURI(folder);
  Assert.assertTrue(uri.hasTrailingPathSeparator());
  int _segmentCount = uri.segmentCount();
  int _minus = (_segmentCount - 2);
  Assert.assertEquals(".", uri.segment(_minus));
}
项目:xtext-core    文件:FileProjectConfig.java   
public FileProjectConfig(final File root, final String name, final IWorkspaceConfig workspaceConfig) {
  this(UriUtil.createFolderURI(root), name, workspaceConfig);
}
项目:xtext-core    文件:FileProjectConfig.java   
public FileProjectConfig(final File root, final IWorkspaceConfig workspaceConfig) {
  this(UriUtil.createFolderURI(root), root.getName(), workspaceConfig);
}
项目:xtext-core    文件:UriUtilTest.java   
@Test
public void testPrefix() {
  final URI prefix = URI.createURI("file:/foo/");
  final URI uri = URI.createURI("file:/foo/bar");
  Assert.assertTrue(UriUtil.isPrefixOf(prefix, uri));
}
项目:xtext-core    文件:UriUtilTest.java   
@Test
public void testPrefixRequiresSameScheme() {
  final URI prefix = URI.createURI("platform:/foo/");
  final URI uri = URI.createURI("file:/foo/bar");
  Assert.assertFalse(UriUtil.isPrefixOf(prefix, uri));
}
项目:xtext-core    文件:UriUtilTest.java   
@Test
public void testPrefixRequiresTrailingSeparator() {
  final URI prefix = URI.createURI("file:/foo");
  final URI uri = URI.createURI("file:/foo/bar");
  Assert.assertFalse(UriUtil.isPrefixOf(prefix, uri));
}
项目:xtext-core    文件:UriUtilTest.java   
@Test
public void testPrefixRequiresSegmentsToMatch() {
  final URI prefix = URI.createURI("file:/foo");
  final URI uri = URI.createURI("file:/buzz/bar");
  Assert.assertFalse(UriUtil.isPrefixOf(prefix, uri));
}