/** * {@inheritDoc} */ @Override public String toProtocol() { if ( _scheme != null ) { return _scheme.toProtocol(); } return _protocol; }
/** * {@inheritDoc} */ @Override public String toProtocol() { if ( _scheme != null ) { return _scheme.toProtocol(); } return _protocol; }
/** * {@inheritDoc} */ @Override public String toProtocol() { return _scheme != null ? _scheme.toProtocol() : _protocol; }
/** * Tests if the provided location represents an absolute URL or not. * * @param aLocation The location to be tested. * * @return True in case of an absolute URL, false in case of a relative * URL. */ private boolean isAbsoluteUrl( String aLocation ) { String theLocation = aLocation.toLowerCase(); if ( theLocation.startsWith( Scheme.HTTP.toProtocol().toLowerCase() ) ) return true; if ( theLocation.startsWith( Scheme.HTTPS.toProtocol().toLowerCase() ) ) return true; return false; } }
/** * Same as {@link #open(String, KeyStoreDescriptor, int, int)} but: * * <ul> * <li>The number of maximum connections at the same time is decided upon by * the implementations's default value. * </ul> * * @param aScheme The {@link Scheme} to use, e.g. {@link Scheme#HTTPS} * defaults to "TLS". * @param aStoreDescriptor The store descriptor describing your * {@link KeyStore} required for HTTPS. * @param aPort The port on which to listen for requests. * @throws OpenException thrown in case something went wrong such as the * port being already in use. */ default void open( Scheme aScheme, KeyStoreDescriptor aStoreDescriptor, int aPort ) throws OpenException { open( aScheme.toProtocol(), aStoreDescriptor, aPort, getMaxConnections() ); }
if ( baseClass == null ) baseClass = RuntimeUtility.class; String basePath = baseClass.getProtectionDomain().getCodeSource().getLocation().getPath(); if ( basePath.startsWith( Scheme.FILE.toProtocol() ) ) { basePath = basePath.substring( Scheme.FILE.toProtocol().length() );
/** * Same as {@link #open(String, KeyStoreDescriptor, int)} but: * * <ul> * <li>The number of maximum connections at the same time is decided upon by * the implementations's default value. * </ul> * * @param aScheme The {@link Scheme} to use, e.g. {@link Scheme#HTTPS} * defaults to "TLS". * * @param aStoreDescriptor The store descriptor describing your * {@link KeyStore} required for HTTPS. * * @throws OpenException thrown in case something went wrong such as the * port being already in use. */ default void open( Scheme aScheme, KeyStoreDescriptor aStoreDescriptor ) throws OpenException { open( aScheme.toProtocol(), aStoreDescriptor, getPort(), getMaxConnections() ); }
if ( theScheme != null ) { setScheme( theScheme ); theUrl = theUrl.substring( theScheme.toProtocol().length() );