@Override public String authority() { return uri.authority(); }
@Override public String authority() { return internalUri.authority(); }
@Override public String authority() { return base.authority(); }
protected String getURIAuthority(IConnector connector) { String url = connector.getURL().toString(); return URI.createURI(url).authority(); }
public static String extractRepositoryUUID(URI uri) { try { if (!uri.hasAuthority()) { throw new InvalidURIException(uri); } return uri.authority(); } catch (InvalidURIException ex) { return null; } }
public static String extractRepositoryUUID(URI uri) { try { if (!uri.hasAuthority()) { throw new InvalidURIException(uri); } return uri.authority(); } catch (InvalidURIException ex) { return null; } }
/** * 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()); }
uri = URI.createURI(uri.authority()).trimSegments(1);
/** * 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())); } }
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; }
String authority = uri.authority(); authority = authority.substring(0, authority.length() - 1); URI archiveURI = URI.createURI(authority);
@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); }
@Override public String toFileString() { URI uri = URI.createHierarchicalURI( FILE_SCHEME, internalUri.authority(), internalUri.device(), internalUri.segments(), internalUri.query(), internalUri.fragment()); return uri.toFileString(); }
@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); } }
@Override public String toFileString() { return URI.createHierarchicalURI( SCHEME, base.authority(), base.device(), base.segments(), base.query(), base.fragment() ).toFileString(); }
/** * 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; } }
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);
newAuthority = base.authority();
String newQuery = query; if (authority == base.authority() && (hasDeviceOrPath() || !base.hasDeviceOrPath()))