public MockSMPClient () { super (URLHelper.getAsURI (MockWebServer.BASE_URI_HTTP)); } }
/** * Get the passed string without an eventually contained session ID like in * "test.html;JSESSIONID=1234?param=value". * * @param aURL * The value to strip the session ID from the path * @return The value without a session ID or the original string. */ @Nonnull public static SimpleURL getWithoutSessionID (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "URL"); // Strip the parameter from the path, but keep parameters and anchor intact! // Note: using URLData avoid parsing, since the data was already parsed! return new SimpleURL (new URLData (getWithoutSessionID (aURL.getPath ()), aURL.params (), aURL.getAnchor ())); }
@Nonnull public ISimpleURL encodeRedirectURL (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "URL"); // Encode only the path and copy params and anchor return new SimpleURL (encodeRedirectURL (aURL.getPath ()), aURL.getAllParams (), aURL.getAnchor ()); }
@Nullable public static IHCNode createLinkedWebsite (@Nullable final String sWebsite, @Nullable final HC_Target aTarget) { if (StringHelper.hasNoText (sWebsite)) return null; if (!URLValidator.isValid (sWebsite)) return new HCTextNode (sWebsite); return new HCA (new SimpleURL (sWebsite)).setTarget (aTarget).addChild (sWebsite); } }
/** * Constructor * * @param aURL * A URL to make requests to when when the data provided by local and * prefetch is insufficient. */ public TypeaheadRemote (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "URL"); m_aURL = new SimpleURL (aURL); }
public HCA_MailTo (@Nonnull final String sEmailAddress) { super (new SimpleURL (EURLProtocol.MAILTO.getProtocol () + sEmailAddress)); m_sEmailAddress = ValueEnforcer.notNull (sEmailAddress, "Email"); }
/** * @return The target URL which should be invoked as a string. May not be * <code>null</code>. */ @Nonnull public String getTargetURLAsString () { return m_aTargetURL.getAsStringWithEncodedParameters (); }
@Nonnull public HCYouTubeIFrame setLanguage (@Nonnull final Locale aLocale) { ValueEnforcer.notNull (aLocale, "Locale"); ValueEnforcer.notEmpty (aLocale.getLanguage (), "Locale.getLanguage"); m_aVideoURL.params ().remove ("hl"); m_aVideoURL.add ("hl", aLocale.getLanguage ()); setSrc (m_aVideoURL); return this; } }
private String validateUrl(String url) { if (URLValidator.isValid(url)) { return url; } else if (url != null) { LOGGER.warn( "Provided npmRegistryURL '{}' is not valid. Ignoring customized NPM registry URL. Default NPM registry URL will be used instead.", url); } return null; } }
public TypeaheadPrefetch (@Nonnull final TypeaheadPrefetch aOther) { ValueEnforcer.notNull (aOther, "Other"); m_aURL = aOther.m_aURL.getClone (); m_nTTL = aOther.m_nTTL; m_aFilter = aOther.m_aFilter; }
/** * Removes all existing parameters. * * @return this */ @Nonnull public MockHttpServletRequest removeAllParameters () { m_aParameters.clear (); return this; }
@Nonnull public ISimpleURL encodeURL (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "URL"); // Encode only the path and copy params and anchor return new SimpleURL (encodeURL (aURL.getPath ()), aURL.getAllParams (), aURL.getAnchor ()); }
/** * Constructor * * @param aURL * A URL to make requests to when when the data provided by local and * prefetch is insufficient. */ public TypeaheadRemote (@Nonnull final ISimpleURL aURL) { ValueEnforcer.notNull (aURL, "URL"); m_aURL = new SimpleURL (aURL); }
public MockSMPClient () { super (URLHelper.getAsURI (MockWebServer.BASE_URI_HTTP)); } }
@Nonnull public final SimpleURL getSelfHref () { SimpleURL ret = m_aSelfHref; if (ret == null) { // Cache for speed m_aSelfHref = ret = getLinkToMenuItem (getSelectedMenuItemID ()); } return ret.getClone (); }
/** * Constructor with a direct PEPPOL Directory URL. * * @param sPDHost * The address of the PEPPOL Directory Server including the application * server context path but without the REST interface. May be http or * https. Example: https://directory.peppol.eu/ */ public PDClient (@Nonnull final String sPDHost) { this (URLHelper.getAsURI (sPDHost)); }