Returns the non secure absolute url for the given resource

@param resource
The resource path, which may or may not start with
"/"+WonderPush.API_VERSION
774822
protected static String getNonSecureAbsoluteUrl(String resource) {
        if (resource.startsWith("/" + WonderPush.API_VERSION)) {
            resource = resource.substring(1 + WonderPush.API_VERSION.length());
        }
        return WonderPush.getNonSecureBaseURL() + resource;
    }
542107
def get_base_url(use_ssl, instance=None, host=None):
        

        if instance is not None:
            host = ("%s.service-now.com" % instance).rstrip('/')

        if use_ssl is True:
            return "https://%s" % host

        return "http://%s" % host
1165637
@Override
  public MeResponse requestMe(WebResource resource) {
    return resource.path(API_V1_PATH).get(MeResponse.class);
  }
50859
public static URL getResource(String resource, Class<?> baseClass) {
		return (null != baseClass) ? baseClass.getResource(resource) : ClassLoaderUtil.getClassLoader().getResource(resource);
	}
170988
public function makeUrl($resource)
    {
        $uri = self::$IUGU_URL_API;
        if (! preg_match("/^https/", $resource)) {
            if (! preg_match("/^\//", $resource)) {
                $resource = '/' . $resource;
            }
        }
        $uri .= $resource;

        return $uri;
    }
619194
public static void getAbsoluteURL(HttpServletRequest request, String relPath, Appendable out) throws IOException {
		out.append(request.isSecure() ? "https://" : "http://");
		out.append(request.getServerName());
		int port = request.getServerPort();
		if(port!=(request.isSecure() ? 443 : 80)) out.append(':').append(Integer.toString(port));
		out.append(request.getContextPath());
		out.append(relPath);
	}
1187820
public function getResourceUri($resource)
	{
		if ( ! str_contains($resource, '.')) return $resource;

		// Once we have built the base URI, we'll remove the wildcard holder for this
		// base resource name so that the individual route adders can suffix these
		// paths however they need to, as some do not have any wildcards at all.
		$segments = explode('.', $resource);

		$uri = $this->getNestedResourceUri($segments);

		return str_replace('/{'.$this->getResourceWildcard(last($segments)).'}', '', $uri);
	}
229689
public String getSecureUrl() {

        if (m_secureServer != null) {
            return m_secureServer.getUrl();
        } else {
            LOG.warn(Messages.get().getBundle().key(Messages.ERR_SECURESERVER_MISSING_1, toString()));
            return getUrl();
        }
    }
751865
public URL getResource(String p) throws MalformedURLException
  {
    String rPath = null;

   /*
     * The spec states the resource must start with a / so if one isn't there we
     * prepend one.
     */
    // Begin 263020
    if (p.charAt(0) != '/' && p.charAt(0) != '\\')
    {
      if (prependSlashToResource)
      {
        logger.logp(Level.WARNING, CLASS_NAME, "getResource", "resource.path.has.to.start.with.slash");
        rPath = "/" + p;
      }
      else
      {
        throw new MalformedURLException(nls.getString("resource.path.has.to.start.with.slash"));
      }
    }
    else
    {
      rPath = p;
    }
    // End 263020
    
    if (container != null) {
        //Can not call getEntry with / on the root container
        if (p.equals("/")) {
            Collection<URL> urls = container.getURLs();
            Iterator<URL> it = urls.iterator();
            if (it.hasNext()) {
                URL url = it.next();  //get the first url
                
                if (url.getProtocol().equals("file")) { 
                    File file = new File(url.getFile());
                    if (file.exists() && !file.isDirectory()){  //might be a file:/xxx.war
                        return new URL("jar", "", -1, url + "!/");  //return jar:file:/xxx.war!/
                    }
                } 

                return url;
            }
        } else {
            Entry entry = container.getEntry(rPath);
            if (entry != null) {
                return entry.getResource();
            } else {
                return getDocumentRootUtils(rPath).getURL(rPath,metaInfCache);
            }
        }
    }

    String uri = getRealPath(rPath);
    if (uri == null)
    {
      return null;
    }

    java.io.File checkFile = new java.io.File(uri);
    if (!checkFile.exists())
    {
      if (!WCCustomProperties.SKIP_META_INF_RESOURCES_PROCESSING)
      {
        if (useMetaInfCache)
        {
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
          {
            logger.logp(Level.FINE, CLASS_NAME, "getResource", "trying META-INF/resources cache");
          }
          synchronized (metaInfCache)
          {
            if (metaInfCache.containsKey(rPath))
            {
              URL cachedURL = metaInfCache.get(rPath);
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
              {
                logger.logp(Level.FINE, CLASS_NAME, "getResource", "got cached META-INF name->[{0}], URL->[{1}]", new Object[] { rPath, cachedURL });
              }
              return cachedURL;
            }
          }
        }
        // URL otherURL = getWebInfLibClassloader().getResource(metaInfPath);
        MetaInfResourcesFileUtils metaInfFileUtil = new MetaInfResourcesFileUtils(this);
        metaInfFileUtil.findInMetaInfResource(rPath);
        URL metaInfURL = metaInfFileUtil.getURL();
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
        {
          logger.logp(Level.FINE, CLASS_NAME, "getResource", "file did not exist, trying META-INF/resources");
          logger.logp(Level.FINE, CLASS_NAME, "getResource", "metaInfPath->/META-INF/resources" + rPath);
        }
        if (useMetaInfCache)
        {
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
          {
            logger.logp(Level.FINE, CLASS_NAME, "getResource", "adding to META-INF cache name->[{0}], URL->[{1}]", new Object[] { rPath, metaInfURL });
          }
          synchronized (metaInfCache)
          {
            metaInfCache.put(rPath, metaInfURL);
          }
        }
        return metaInfURL;

      }
      else
      {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
        {
          logger.logp(Level.FINE, CLASS_NAME, "getResource", "skipping META-INF/resources processing");
        }
        return null;
      }
    }
    return checkFile.toURL();

  }
503313
private String getItemIndexViewURL(String reposBaseURL,
                                       String fedoraContext,
                                       String PID,
                                       Date versDateTime) {
        String itemIndexURL = null;

        try {
            if (versDateTime == null) {
                itemIndexURL =
                        reposBaseURL + "/" + fedoraContext + "/objects/" + URLEncoder.encode(PID, "UTF-8")
                        + "/methods/" + URLEncoder.encode("fedora-system:3", "UTF-8") + "/viewItemIndex";
            } else {
                itemIndexURL =
                        reposBaseURL + "/" + fedoraContext + "/objects/" + URLEncoder.encode(PID, "UTF-8")
                        + "/methods/" + URLEncoder.encode("fedora-system:3", "UTF-8") + "/viewItemIndex?asOfDateTime="
                        + DateUtility.convertDateToString(versDateTime);
            }
        } catch (UnsupportedEncodingException e) {
            // should never happen...
            throw new RuntimeException(e);
        }
        return itemIndexURL;
    }
960839
public static InputStream loadResource(final String resource) throws FileNotFoundException {
        final boolean hasLeadingSlash = resource.startsWith("/");
        final String stripped = hasLeadingSlash ? resource.substring(1) : resource;

        InputStream stream = null;

        final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader != null) {
            stream = classLoader.getResourceAsStream(resource);
            if (stream == null && hasLeadingSlash) {
                stream = classLoader.getResourceAsStream(stripped);
            }
        }

        if (stream == null) {
            throw new FileNotFoundException("resource " + resource + " not found");
        }

        return stream;
    }
980837
public static function getUrl($resource, $absolute = false) {
		if (strpos ( $resource, '//' ) !== false) {
			return $resource;
		}
		if ($absolute) {
			return self::$siteURL . self::ASSETS_FOLDER . $resource;
		}
		return ltrim ( self::ASSETS_FOLDER, '/' ) . $resource;
	}
26997
public static File getResourceAsFile(final String resource) {
        final ClassLoader classLoader = FileUtils.class.getClassLoader();
        final String path = classLoader != null
                ? classLoader.getResource(resource).getFile()
                : ClassLoader.getSystemResource(resource).getFile();

        if (path == null) {
            return new File(resource);
        }
        return new File(path);
    }
871472
protected String getBaseURL(HttpServletRequest request) {
//        if (forcedBaseAddress != null) {
//            return forcedBaseAddress;
//        }

        String reqPrefix = request.getRequestURL().toString();
        String pathInfo = request.getPathInfo() == null ? "" : request.getPathInfo();
        //fix for CXF-898
        if (!"/".equals(pathInfo) || reqPrefix.endsWith("/")) {
            StringBuilder sb = new StringBuilder();
            // request.getScheme(), request.getLocalName() and request.getLocalPort()
            // should be marginally cheaper - provided request.getLocalName() does
            // return the actual name used in request URI as opposed to localhost
            // consistently across the Servlet stacks

            URI uri = URI.create(reqPrefix);
            sb.append(uri.getScheme()).append("://").append(uri.getRawAuthority());

            //No servletPath will be appended, as in Liberty, each endpoint will be served by one servlet instance
            sb.append(request.getContextPath());

            reqPrefix = sb.toString();
        }
        return reqPrefix;
    }
1351040
public static <C extends Page> String absoluteUrlFor(final Class<C> page)
	{
		return absoluteUrlFor(page, null, false);
	}
561570
private String getURL(String endpoint, int version, String method) {
        StringBuilder sb = new StringBuilder();
        sb.append(endpoint);
        if (!endpoint.endsWith(FORWARD_SLASH)) {
            sb.append(FORWARD_SLASH);
        }
        sb.append(VERSION_PREFIX + version + FORWARD_SLASH + method);
        return sb.toString();
    }
574371
protected void appendBaseURL(StringBuilder buffer,String resource,HTTPClientConfiguration configuration)
    {
        buffer.append("http");
        if(configuration.isSSL())
        {
            buffer.append("s");
        }
        buffer.append("://");
        buffer.append(configuration.getHostName());
        int port=configuration.getPort();
        if(port>0)
        {
            buffer.append(":");
            buffer.append(port);
        }
        if((resource!=null)&&(resource.length()>0))
        {
            if(!resource.startsWith("/"))
            {
                buffer.append("/");
            }
            buffer.append(resource);
        }
    }