code: public URL getURL(final String protocol, final String host, final int port, final String file, final URLStreamHandler handler) throws MalformedURLException {
          if (System.getSecurityManager() == null)
              return new URL(protocol, host, port, file, handler);
          try {
              return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
                  @Override
                  public URL run() throws MalformedURLException {
                      return new URL(protocol, host, port, file, handler);
                  }
              }, controlContext);
          } catch (PrivilegedActionException e) {
              if (e.getException() instanceof MalformedURLException)
                  throw (MalformedURLException) e.getException();
              throw (RuntimeException) e.getException();
          }
      }
docs: Gets a URL. Same a calling
  {@link URL#URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler)}
  
  @param protocol the protocol
  @param host the host
  @param port the port
  @param file the file
  @param handler the URLStreamHandler
  @return a URL
  @throws MalformedURLException