Get Resource Url for AddItemsToCart
@param throwErrorOnInvalidItems
@return   String Resource Url
765278
public static MozuUrl addItemsToCartUrl(Boolean throwErrorOnInvalidItems)
	{
		UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/bulkitems?throwErrorOnInvalidItems={throwErrorOnInvalidItems}");
		formatter.formatUrl("throwErrorOnInvalidItems", throwErrorOnInvalidItems);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
1142247
@Override
    protected URL findResource(String name) {
        URL result = null;
        // Only check the parent bundle loader if the request is outside of "" or "/"
        if (!!!"".equals(name) && !!!"/".equals(name)) {
            // First try the bundleLoader
            result = bundleLoader.getResource(name);
        }
        // This doesn't have access to ALL split packages (it just gets one) so it's augmented with a resource provider  
        return result == null ? resourceProviders.findResource(name) : result;
    }
457558
private URL buildUrl(final String styleSheetPath, final boolean skipStylesFolder) {

        URL cssResource = null;

        final List<String> stylePaths = skipStylesFolder ? Collections.singletonList("") : ResourceParameters.STYLE_FOLDER.get();

        for (int i = 0; i < stylePaths.size() && cssResource == null; i++) {

            String stylePath = stylePaths.get(i);
            if (!stylePath.isEmpty()) {
                stylePath += Resources.PATH_SEP;
            }
            cssResource = Thread.currentThread().getContextClassLoader().getResource(stylePath + styleSheetPath);
        }

        if (cssResource == null) {
            LOGGER.error("Style Sheet : {} not found into base folder: {}", styleSheetPath, ResourceParameters.STYLE_FOLDER.get());
        }
        return cssResource;
    }
76191
protected URL[] getCompileClasspathElementURLs() throws DependencyResolutionRequiredException {
    // build class loader to get classes to generate resources for
    return project.getCompileClasspathElements().stream()
        .map(path -> {
          try {
            return new File(path).toURI().toURL();
          }
          catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
          }
        })
        .toArray(size -> new URL[size]);
  }
1313239
private String pageUri(final UriTemplate uriTemplate, final int skip, final int limit) {
        if (limit == MAX_VALUE) {
            return uriTemplate.expand();
        }
        return uriTemplate.set(skipVar(), skip).set(limitVar(), limit).expand();
    }
656681
@Override
    public ApiResponse handleValidationError(ApiFailureResource resource) {
        final FaihyUnifiedFailureType failureType = FaihyUnifiedFailureType.VALIDATION_ERROR;
        final FaihyUnifiedFailureResult result = createFailureResult(failureType, resource, null);
        return asJson(result).httpStatus(prepareBusinessFailureStatus());
    }
515767
function _buildErrorCode (cartoError, key) {
  var fragments = [];
  fragments.push(cartoError && cartoError.origin);
  fragments.push(cartoError && cartoError.type);
  fragments.push(key);
  fragments = _.compact(fragments);

  return fragments.join(':');
}
1109860
public static <T extends CharSequence> T validateUrl(T value, String errorMsg) throws ValidateException {
		if (false == isUrl(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
935505
@Override
	public ResourceBundlePathsIterator getGlobalResourceBundlePaths(DebugMode debugMode,
			ConditionalCommentCallbackHandler commentCallbackHandler, Map<String, String> variants) {

		return getBundleIterator(debugMode, globalBundles, commentCallbackHandler, variants);
	}
1258226
function _getListedError (cartoError, errorList) {
  var errorListkeys = _.keys(errorList);
  var key;
  for (var i = 0; i < errorListkeys.length; i++) {
    key = errorListkeys[i];
    if (!(errorList[key].messageRegex instanceof RegExp)) {
      throw new Error('MessageRegex on ' + key + ' is not a RegExp.');
    }
    if (errorList[key].messageRegex.test(cartoError.message)) {
      return {
        friendlyMessage: _replaceRegex(cartoError, errorList[key]),
        errorCode: _buildErrorCode(cartoError, key)
      };
    }
  }

  // When cartoError not found return generic values
  return {
    friendlyMessage: cartoError.message || '',
    errorCode: _buildErrorCode(cartoError, 'unknown-error')
  };
}
176723
@Override
	public ResourceBundlePathsIterator getBundlePaths(DebugMode debugMode, String bundleId,
			ConditionalCommentCallbackHandler commentCallbackHandler, Map<String, String> variants) {

		List<JoinableResourceBundle> currentBundles = new ArrayList<>();

		// if the path did not correspond to a global bundle, find the requested
		// one.
		if (!isGlobalResourceBundle(bundleId)) {
			for (JoinableResourceBundle bundle : contextBundles) {
				if (bundle.getId().equals(bundleId)) {

					currentBundles.add(bundle);
					break;
				}
			}
		}

		return getBundleIterator(debugMode, currentBundles, commentCallbackHandler, variants);
	}
300103
public static MozuUrl deleteCartItemUrl(String cartItemId)
	{
		UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}");
		formatter.formatUrl("cartItemId", cartItemId);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
172068
@FFDCIgnore(IllegalStateException.class)
    public URL getBundleEntry(Bundle bundleToTest, String pathAndName) {
        try {
            URL bundleEntry = bundleToTest.getEntry(pathAndName);

            /*
             * Defect 54588 discovered that if a directory does not have a zip entry then calling getEntry will return null unless the path has a "/" on the end so if we have null
             * still then add a "/" on the end of the path and retest
             */
            if (bundleEntry == null) {
                bundleEntry = bundleToTest.getEntry(pathAndName + "/");
            }
            return bundleEntry;
        } catch (IllegalStateException ise) {
            //bundle context was no longer valid, so we cannot use getEntry any more.
            return null;
        }
    }
135751
public function getTrackingUrl()
    {
        if (!isset($this->parcelnumber)) {
            throw new RuntimeException("Shipment has no parcel number.");
        }

        return sprintf(Api::TRACKING_URL, $this->parcelnumber);
    }
1351371
function buildUrl(urlPattern, customParams) {
    var url = formatUrl.apply(null, urlPattern);

    url = appendParams(url, customParams);
    return url;
  }
1226975
function loadURIRoot( $uri, $displayErrors = true, &$extraParameters )
    {
        $res = "";
        $template = "";
        $resobj = $this->resourceFor( $uri, $res, $template );

        if ( !is_object( $resobj ) )
        {
            if ( $displayErrors )
                $this->warning( "", "No resource handler for \"$res\" and no default resource handler, aborting." );
            return null;
        }

        $canCache = true;
        if ( !$resobj->servesStaticData() )
            $canCache = false;
        if ( !$this->isCachingAllowed() )
            $canCache = false;

        $resourceData = $this->loadURIData( $resobj, $uri, $res, $template, $extraParameters, $displayErrors );

        if ( $resourceData )
        {
            eZTemplate::appendTemplateToStatisticsIfNeeded( $resourceData['template-name'], $resourceData['template-filename'] );
            $this->appendTemplateFetch( $resourceData['template-filename'] );

            if ( !$resourceData['compiled-template'] and
                 $resourceData['root-node'] === null )
            {
                $resourceData['root-node'] = array( eZTemplate::NODE_ROOT, false );
                $templateText = $resourceData["text"];
                $keyData = $resourceData['key-data'];
                $this->setIncludeText( $uri, $templateText );
                $rootNamespace = '';
                $this->parse( $templateText, $resourceData['root-node'], $rootNamespace, $resourceData );

                if ( eZTemplate::isDebugEnabled() )
                {
                    $this->appendDebugNodes( $resourceData['root-node'], $resourceData );
                }

                if ( $canCache )
                    $resobj->setCachedTemplateTree( $keyData, $uri, $res, $template, $extraParameters, $resourceData['root-node'] );
            }
            if ( !$resourceData['compiled-template'] and
                 $canCache and
                 $this->canCompileTemplate( $resourceData, $extraParameters ) )
            {
                $generateStatus = $this->compileTemplate( $resourceData, $extraParameters );
                if ( $generateStatus )
                    $resourceData['compiled-template'] = true;
            }
        }

        return $resourceData;
    }
1241896
function getSourceMapForUrl(url, onFailure, onSuccess) {
  if (!url) {
    onFailure('must provide a URL');
    return;
  }

  if (url === 'assets://default_bundle') {
    onFailure('Don\'t know how to symbolicate in-app bundle, please load from server');
    return;
  }

  const parsedUrl = urlLib.parse(url);
  const mapPath = parsedUrl.pathname.replace(/\.bundle$/, '.map');
  const options = {
    host: 'localhost',
    port: parsedUrl.port,
    path: mapPath + parsedUrl.search + '&babelSourcemap=true',
  };

  http.get(options, (res) => {
    res.setEncoding('utf8');
    let sawEnd = false;
    let resBody = '';
    res.on('data', (chunk) => {
      resBody += chunk;
    }).on('end', () => {
      sawEnd = true;
      onSuccess(new SourceMapConsumer(resBody));
    }).on('close', (err) => {
      if (!sawEnd) {
        onFailure('Connection terminated prematurely because of: '
                      + err.code + ' for url: ' + url);
      }
    });
  }).on('error', (err) => {
    onFailure('Could not get response from: ' + url + ', error: ' + err.message);
  });
}