本文整理了Java中org.eclipse.emf.common.util.URI.authority()
方法的一些代码示例,展示了URI.authority()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URI.authority()
方法的具体详情如下:
包路径:org.eclipse.emf.common.util.URI
类名称:URI
方法名:authority
[英]If this is a hierarchical URI with an authority component, returns it; null
otherwise.
[中]如果这是一个带有权限组件的分层URI,则返回它;null
否则。
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common
@Override
public String authority()
{
return uri.authority();
}
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core
@Override
public String authority() {
return internalUri.authority();
}
代码示例来源:origin: atlanmod/NeoEMF
@Override
public String authority() {
return base.authority();
}
代码示例来源:origin: org.eclipse.emf.cdo/net4j
protected String getURIAuthority(IConnector connector)
{
String url = connector.getURL().toString();
return URI.createURI(url).authority();
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench
protected Bundle getBundle(URI platformURI) {
if (platformURI.authority() == null) {
Activator.log(LogService.LOG_ERROR, "Failed to get bundle for: " + platformURI); //$NON-NLS-1$
return null;
}
return Activator.getDefault().getBundleForName(platformURI.authority());
}
代码示例来源:origin: org.eclipse.emf/cdo
public static String extractRepositoryUUID(URI uri)
{
try
{
if (!uri.hasAuthority())
{
throw new InvalidURIException(uri);
}
return uri.authority();
}
catch (InvalidURIException ex)
{
return null;
}
}
代码示例来源:origin: com.b2international.snowowl/org.eclipse.emf.cdo
public static String extractRepositoryUUID(URI uri)
{
try
{
if (!uri.hasAuthority())
{
throw new InvalidURIException(uri);
}
return uri.authority();
}
catch (InvalidURIException ex)
{
return null;
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.edit
/**
* Returns whether to expect that the resource corresponding to the given URI form will be read only.
* @deprecated this method is no longer called by {@link #isReadOnly(Resource)}
*/
@Deprecated
protected boolean isReadOnlyURI(URI uri)
{
if (uri.isArchive())
{
return isReadOnlyURI(URI.createURI(uri.authority()));
}
return !uri.isPlatformResource() && (uri.isRelative() || !uri.isFile());
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common
uri = URI.createURI(uri.authority()).trimSegments(1);
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core
/**
* Creates a new {@code PersistenceURI} from the given {@code uri} by checking the referenced file exists on the
* file system.
*
* @param uri the base {@link URI}
* @param scheme the scheme to identify the {@link PersistenceBackendFactory} to use
*
* @return the created {@link URI}
*
* @throws NullPointerException if the {@code uri} is {@code null}
*/
@Nonnull
public static URI createFileURI(@Nonnull URI uri, @Nullable String scheme) {
checkNotNull(uri);
if (isNull(scheme)) {
return createURI(uri);
}
else {
return createURI(createHierarchicalURI(scheme, uri.authority(), uri.device(), uri.segments(), uri.query(), uri.fragment()));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jem.util
protected URI normalizePluginURI(URI uri, String fragment) {
if (uri.segmentCount() < 2)
return uri; // Invalid, just let it go on.
// See if already normalized.
int u_scoreNdx = uri.segment(1).lastIndexOf('_');
if (u_scoreNdx != -1) {
// Not normalized. Remove the version to make it normalized.
String[] segments = uri.segments();
segments[1] = segments[1].substring(0, u_scoreNdx);
return URI.createHierarchicalURI(uri.scheme(), uri.authority(), uri.device(), segments, uri.query(), fragment);
} else
return uri;
}
代码示例来源:origin: org.eclipse.xtext/ui
String authority = uri.authority();
authority = authority.substring(0, authority.length() - 1);
URI archiveURI = URI.createURI(authority);
代码示例来源:origin: atlanmod/NeoEMF
@Nonnull
@Override
public URI createLocalUri(File file) {
checkNotNull(file, "file");
final URI fileUri = URI.createFileURI(file.getAbsolutePath());
final URI uri = URI.createHierarchicalURI(scheme(),
fileUri.authority(),
fileUri.device(),
fileUri.segments(),
fileUri.query(),
fileUri.fragment());
return createLocalUri(uri);
}
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core
@Override
public String toFileString() {
URI uri = URI.createHierarchicalURI(
FILE_SCHEME,
internalUri.authority(),
internalUri.device(),
internalUri.segments(),
internalUri.query(),
internalUri.fragment());
return uri.toFileString();
}
代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core
@Override
public void load(Map<?, ?> options) throws IOException {
try {
isLoading = true;
if (!isLoaded) {
if (getFile().exists() || nonNull(uri.authority())) {
// Check authority to enable remote resource loading
this.backend = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createPersistentBackend(getFile(), options);
this.store = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createPersistentStore(this, backend, options);
this.isPersistent = true;
dummyRootEObject.setMapped(true);
}
else {
throw new FileNotFoundException(uri.toFileString());
}
this.options = options;
isLoaded = true;
}
}
finally {
isLoading = false;
NeoLogger.info("{0} loaded: {1}", PersistentResource.class.getSimpleName(), uri);
}
}
代码示例来源:origin: atlanmod/NeoEMF
@Override
public String toFileString() {
return URI.createHierarchicalURI(
SCHEME,
base.authority(),
base.device(),
base.segments(),
base.query(),
base.fragment()
).toFileString();
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.util
/**
* converts the file URIs with an absent authority to one with an empty
*/
public URI withEmptyAuthority(final URI uri) {
URI _xifexpression = null;
if ((uri.isFile() && (uri.authority() == null))) {
_xifexpression = URI.createHierarchicalURI(uri.scheme(), "", uri.device(), uri.segments(), uri.query(), uri.fragment());
} else {
_xifexpression = uri;
}
return _xifexpression;
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common
if (scheme != oldPrefix.scheme() || authority != oldPrefix.authority() || device != oldPrefix.device() || hasAbsolutePath() != oldPrefix.hasAbsolutePath())
return POOL.intern(false, URIPool.URIComponentsAccessUnit.VALIDATE_NONE, true, newPrefix.scheme(), newPrefix.authority(), newPrefix.device(), newPrefix.hasAbsolutePath(), mergedSegments, query);
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common
newAuthority = base.authority();
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common
String newQuery = query;
if (authority == base.authority() && (hasDeviceOrPath() || !base.hasDeviceOrPath()))
内容来源于网络,如有侵权,请联系作者删除!