Answer the URL of this entry.

Directory type entries have a trailing "/".  That is required by
{@link ClassLoader#getResource(String)}.

Answer null if a malformed URL is obtained.

@return The URL for this entry.
771219
@Override
    @FFDCIgnore(MalformedURLException.class)
    public URL getResource() {
        String useRelPath = getRelativePath();

        if ( (zipEntryData == null) || zipEntryData.isDirectory() ) {
            useRelPath += "/";
        }

        URI entryUri = rootContainer.createEntryUri(useRelPath);
        if ( entryUri == null ) {
            return null;
        }

        try {
            return entryUri.toURL(); // throws MalformedURLException
        } catch ( MalformedURLException e ) {
            // In some cases an attempt is made to get a resource using the wsjar protocol
            // after the protocol has been deregistered.  It would be too much of a behavior change
            // to properly enforce the dependency on the wsjar protocol for all components.
            // Instead, only log a debug statement if a MalformedURLException is caught during
            // shutdown.
            if ( FrameworkState.isStopping() ) {
                if ( TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
                    Tr.debug(tc, "MalformedURLException during OSGi framework stop.", e.getMessage());
                } else {
                    FFDCFilter.processException(e, getClass().getName(), "269");
                }
            }
            return null;
        }
    }
973124
public String path() {
    if (path == null) {
      if (!hasPath) {
        return path = "";
      }

      int pathEndPos = uri.indexOf('?');
      if (pathEndPos < 0) {
        path = uri;
      } else {
        return path = uri.substring(0, pathEndPos);
      }
    }
    return path;
  }
1355047
public static String getServicesUrl() {
        String servicesUrl = PropertyManager.getProperty(PropertyNames.MDW_SERVICES_URL);
        if (servicesUrl == null) {
            servicesUrl = getMdwHubUrl();
        }
        if (servicesUrl.endsWith("/"))
            servicesUrl = servicesUrl.substring(0, servicesUrl.length()-1);
        return servicesUrl;
    }
438981
@Override
    public String getContentType() {
        if (url.getFile().endsWith("!/")) {
            // the type for jar file itself is always "x-java/jar"
            return "x-java/jar";
        }
        String cType = null;
        String entryName = getEntryName();

        if (entryName != null) {
            // if there is an Jar Entry, get the content type from the name
            cType = guessContentTypeFromName(entryName);
        } else {
            try {
                connect();
                cType = jarFileURLConnection.getContentType();
            } catch (IOException ioe) {
                // Ignore
            }
        }
        if (cType == null) {
            cType = "content/unknown";
        }
        return cType;
    }
1293939
@Override
    public String getPath() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getPath();
        return null;
    }
603731
public String getUrl(){
		final StringBuilder sb = new StringBuilder();
		sb.append("http://");
		sb.append(getHttpConfiguration().getBindHost().get());
		sb.append(":");
		sb.append(getHttpConfiguration().getPort());
		
		return sb.toString();
	}
642604
public static URL getURL(String classpathOrFilePath) {
        try {
            return getURI(classpathOrFilePath).toURL();
        } catch (MalformedURLException e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "getURL", classpathOrFilePath);
        }
    }
46634
public static File getWebRoot() {
		final String classPath = ClassUtil.getClassPath();
		if (StrUtil.isNotBlank(classPath)) {
			return getParent(file(classPath), 2);
		}
		return null;
	}
1125211
public Uri getUri() {
        if (uri == null) {
            try {
                uri = uriBuilder.build();
            } catch (Exception e) {
                throw new IllegalStateException("Could not build the URI.", e);
            }
        }
        return uri;
    }
820804
@Override
    public URL getResource( String path )
    {
        URL url = null;
        if ( baseLoader != null )
            // classloader wants no leading slash
            url = baseLoader.getResource( path.substring(1) );
        if ( url == null )
            url = super.getResource( path );
        return url;
    }
174930
public URI location() {
		String loc = http().getHeaderField("Location");
		if (loc != null) {
			return URI.create(loc);
		}
		return null;
	}
883647
public String path() {
    /* build the fully qualified url with all query parameters */
    StringBuilder path = new StringBuilder();
    if (this.target != null) {
      path.append(this.target);
    }
    if (this.uriTemplate != null) {
      path.append(this.uriTemplate.toString());
    }
    if (path.length() == 0) {
      /* no path indicates the root uri */
      path.append("/");
    }
    return path.toString();

  }
1009198
public static String getDirectParent(URL entry) {
		String path = entry.getPath();
		int last = path.lastIndexOf('/');
		if (last > 0) {
			int first = path.lastIndexOf('/', last - 1);
			if (first >= 0) {
				return path.substring(first + 1, last);
			} else {
				return path.substring(0, last);
			}
		} else {
			return "";
		}
	}
308268
public String getUrl(String mockupType) {
        return mockupType == null ? null : mockupTypes.getProperty(mockupType);
    }
695334
public URL getURL() throws MalformedURLException{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.append(apiId);
		if(apiVersion!=null){
			stringBuilder.append(DOT);
			stringBuilder.append(apiVersion);
		}
		stringBuilder.append(DOT);
		stringBuilder.append(authority);
		URL url = new URL((protocol!=null?protocol+"://":"")+stringBuilder.toString());
		return url;
	}
771291
public URL toURL() {
        if (StringUtils.isBlank(url)) {
            return null;
        }
        try {
            return new URL(url);
        } catch (MalformedURLException e) {
            logger.info("URL does not appear to be valid and cannot be parsed:"
                    + url, e);
            return null;
        }
    }
1042165
protected String getContainerUrl() {
    String containerUrl = System.getProperty(CONTAINER_URL);
    if (containerUrl == null) {
      // fallback to look for a thread local variable. Only useful for testing
      // of JicUNit itself
      containerUrl = ContainerUrlHolder.get();
    }
    return containerUrl;
  }