Tabnine Logo
URLHelper
Code IndexAdd Tabnine to your IDE (free)

How to use
URLHelper
in
com.helger.commons.url

Best Java code snippets using com.helger.commons.url.URLHelper (Showing top 20 results out of 315)

origin: com.helger/ph-as4-lib

@Nullable
public String getAddressProtocol ()
{
 final URL aURL = URLHelper.getAsURL (m_sAddress);
 return aURL == null ? null : aURL.getProtocol ();
}
origin: phax/peppol-smp-server

 public MockSMPClient ()
 {
  super (URLHelper.getAsURI (MockWebServer.BASE_URI_HTTP));
 }
}
origin: com.helger/ph-oton-core

 @Override
 @Nonnull
 protected IReadableResource getResource (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
                      @Nonnull final String sFilename)
 {
  // URL decode is required because requests contain e.g. "%20"
  final String sFilename1 = URLHelper.urlDecode (sFilename);

  return new ClassPathResource (sFilename1);
 }
}
origin: com.helger/ph-servlet

final URI aURI = URLHelper.getAsURI (RequestHelper.getWithoutSessionID (sRequestURL));
if (aURI != null)
 setParameters (URLHelper.getParsedQueryParameters (aURI.getQuery ()));
 return this;
origin: com.helger/ph-servlet

aSB.append (m_eContentDispositionType.getID ())
  .append ("; filename=")
  .append (URLHelper.urlEncode (m_sContentDispositionFilename, aCharsetToUse));
origin: com.helger/ph-xml

@Nonnull
public static ResourceStreamSource create (@Nonnull final URI aURI)
{
 return create (URLHelper.getAsURL (aURI));
}
origin: com.helger/peppol-smp-server-webapp

 public MockSMPClient ()
 {
  super (URLHelper.getAsURI (MockWebServer.BASE_URI_HTTP));
 }
}
origin: com.helger/ph-oton-core

/**
 * Get the user data object matching the passed request and filename
 *
 * @param aRequestScope
 *        HTTP request
 * @param sFilename
 *        Filename as extracted from the URL
 * @return Never <code>null</code>.
 */
@Nonnull
@OverrideOnDemand
protected UserDataObject getUserDataObject (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
                      @Nonnull final String sFilename)
{
 // URL decode is required because requests contain e.g. "%20"
 final String sFilename1 = URLHelper.urlDecode (sFilename);
 return new UserDataObject (sFilename1);
}
origin: com.helger/ph-xml

@Nonnull
public static InputSource create (@Nonnull final URI aURI)
{
 return create (URLHelper.getAsURL (aURI));
}
origin: com.helger/peppol-directory-client

/**
 * 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));
}
origin: com.helger/ph-oton-core

@Override
@OverridingMethodsMustInvokeSuper
public EContinue initRequestState (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
                  @Nonnull final UnifiedResponse aUnifiedResponse)
{
 // cut the leading "/"
 final String sFilename = URLHelper.urlDecode (aRequestScope.getPathWithinServlet ());
 if (StringHelper.hasNoText (sFilename) ||
   !isValidFilenameAccordingToTheRules (sFilename) ||
   isPossibleDirectoryTraversalRequest (sFilename))
 {
  // Send the same error code as if it is simply not found to confuse
  // attackers :)
  LOGGER.warn ("Illegal delivery request '" + sFilename + "'");
  aUnifiedResponse.setStatus (HttpServletResponse.SC_NOT_FOUND);
  return EContinue.BREAK;
 }
 // Filename seems to be safe
 aRequestScope.attrs ().putIn (REQUEST_ATTR_OBJECT_DELIVERY_FILENAME, sFilename);
 return EContinue.CONTINUE;
}
origin: com.helger/peppol-sml-client

public BDMSLClient (@Nonnull final ISMLInfo aSMLInfo)
{
 super (URLHelper.getAsURL (aSMLInfo.getManagementServiceURL () + "/bdmslservice"));
}
origin: com.helger/peppol-commons

/**
 * Check if the given identifier is valid. It is valid if it is empty or a
 * valid URI.<br>
 * The scheme of the participant identifier MUST be in the form of a URI.<br>
 * The scheme of the document identifier MUST be in the form of a URI.
 *
 * @param sScheme
 *        The scheme to check.
 * @return <code>true</code> if the passed scheme is a valid identifier
 *         scheme, <code>false</code> otherwise.
 */
public static boolean isValidIdentifierScheme (@Nullable final String sScheme)
{
 if (StringHelper.hasNoText (sScheme))
  return true;
 return URLHelper.getAsURI (sScheme) != null;
}
origin: com.helger/peppol-directory-indexer

final String sDocumentTypeID = URLHelper.urlDecode (sHref.substring (nIndex + URL_PART_SERVICES.length ()),
                          StandardCharsets.UTF_8);
final IDocumentTypeIdentifier aDocTypeID = aIdentifierFactory.parseDocumentTypeIdentifier (sDocumentTypeID);
origin: com.helger/ph-oton-core

@Nonnull
public static IReadableResource getAsResourceStatic (@Nonnull @Nonempty final String sURI)
{
 ValueEnforcer.notEmpty (sURI, "URI");
 IReadableResource ret;
 // If the URL is absolute, use it
 if (LinkHelper.hasKnownProtocol (sURI))
 {
  ret = new URLResource (URLHelper.getAsURL (sURI));
 }
 else
 {
  // Absolute paths are project relative files and therefore are relative to
  // the servlet context directory
  if (isProjectRelativeURI (sURI))
  {
   // Cut "/" to avoid recognition as absolute file on Linux!
   ret = WebFileIO.getServletContextIO ().getResource (sURI.substring (1));
  }
  else
  {
   // Defaults to class path
   ret = new ClassPathResource (sURI);
  }
 }
 return ret;
}
origin: com.helger/peppol-directory-api

/**
 * @return The fixed SMP URI to be used to retrieve business cards. This
 *         document should only be used when setting up a new network and
 *         SML/DNS are not (yet) available in the system. Because it is
 *         special, it is not documented.
 */
@Nullable
public static URI getFixedSMPURI ()
{
 final String sSMPURI = getConfigFile ().getAsString ("smp.uri");
 return URLHelper.getAsURI (sSMPURI);
}
origin: com.helger/peppol-directory-indexer

final String sDocumentTypeID = URLHelper.urlDecode (sHref.substring (nIndex + URL_PART_SERVICES.length ()),
                          StandardCharsets.UTF_8);
final IDocumentTypeIdentifier aDocTypeID = aIdentifierFactory.parseDocumentTypeIdentifier (sDocumentTypeID);
origin: com.helger/ph-useragent

if (URLHelper.getAsURL (sToken) != null)
 aProfileData.add (sToken);
else
origin: com.helger/peppol-smp-server-webapp

@Nonnull
public URI getCurrentURI ()
{
 if (m_bUseStaticServerInfo && StaticServerInfo.isSet ())
 {
  // Do not decode params - '#' lets URI parser fail!
  return URLHelper.getAsURI (StaticServerInfo.getInstance ().getFullContextPath () +
                "/" +
                m_aUriInfo.getPath (false));
 }
 if (false)
 {
  // First version in ROOT, second in context "/test"
  // http://127.0.0.1:90/
  // http://127.0.0.1:90/test/
  m_aUriInfo.getBaseUri ();
  // iso6523-actorid-upis:0088:5798000000112
  m_aUriInfo.getPath ();
  // http://127.0.0.1:90/iso6523-actorid-upis%3A0088%3A5798000000112
  // http://127.0.0.1:90/test/iso6523-actorid-upis%3A0088%3A5798000000112
  m_aUriInfo.getAbsolutePath ();
 }
 return m_aUriInfo.getAbsolutePath ();
}
origin: phax/peppol-smp-server

else
 final URL aURL = URLHelper.getAsURL (sManagementAddressURL);
 if (aURL == null)
  aFormErrors.addFieldError (FIELD_MANAGEMENT_ADDRESS_URL, "The Management Address URL is not a valid URL!");
com.helger.commons.urlURLHelper

Most used methods

  • getAsURL
  • getAsURI
  • urlDecode
  • getParsedQueryParameters
  • urlEncode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JTable (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now