Tabnine Logo
HttpURLConnection.getURL
Code IndexAdd Tabnine to your IDE (free)

How to use
getURL
method
in
java.net.HttpURLConnection

Best Java code snippets using java.net.HttpURLConnection.getURL (Showing top 20 results out of 2,304)

origin: square/okhttp

DelegatingHttpsURLConnection(HttpURLConnection delegate) {
 super(delegate.getURL());
 this.delegate = delegate;
}
origin: square/okhttp

@Override public URL getURL() {
 return delegate.getURL();
}
origin: prestodb/presto

DelegatingHttpsURLConnection(HttpURLConnection delegate) {
 super(delegate.getURL());
 this.delegate = delegate;
}
origin: prestodb/presto

@Override public URL getURL() {
 return delegate.getURL();
}
origin: spring-projects/spring-framework

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: spring-projects/spring-framework

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: spring-projects/spring-framework

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: spring-projects/spring-framework

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException(
        "Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: google/ExoPlayer

@Override
public @Nullable Uri getUri() {
 return connection == null ? null : Uri.parse(connection.getURL().toString());
}
origin: jenkinsci/jenkins

private URL tryToResolveRedirects(URL base, String authorization) {
  try {
    HttpURLConnection con = (HttpURLConnection) base.openConnection();
    if (authorization != null) {
      con.addRequestProperty("Authorization", authorization);
    }
    con.getInputStream().close();
    base = con.getURL();
  } catch (Exception ex) {
    // Do not obscure the problem propagating the exception. If the problem is real it will manifest during the
    // actual exchange so will be reported properly there. If it is not real (no permission in UI but sufficient
    // for CLI connection using one of its mechanisms), there is no reason to bother user about it.
    LOGGER.log(Level.FINE, "Failed to resolve potential redirects", ex);
  }
  return base;
}
origin: org.springframework/spring-web

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException(
        "Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: org.springframework/spring-web

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: org.springframework/spring-web

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: org.springframework/spring-web

@Override
public URI getURI() {
  try {
    return this.connection.getURL().toURI();
  }
  catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
  }
}
origin: wildfly/wildfly

  @Override
  public void configureLogoutConnection(HttpURLConnection connection) {
    if (connection.getURL().getProtocol().equalsIgnoreCase("https")) {
      HttpsURLConnection secureConnection = (HttpsURLConnection) connection;
      this.logoutConnectionConfigurator.accept(secureConnection);
    }
  }
}
origin: facebook/stetho

public URLConnectionInspectorResponse(String requestId, HttpURLConnection conn) throws IOException {
 super(Util.convertHeaders(conn.getHeaderFields()));
 mRequestId = requestId;
 mUrl = conn.getURL().toString();
 mStatusCode = conn.getResponseCode();
 mStatusMessage = conn.getResponseMessage();
}
origin: aa112901/remusic

@Override
public void run() {
  try {
    fileUtils = ProxyFileUtils.getInstance(mContext, request.getURL().toURI(), true);
    processRequest(request, client);
  } catch (IllegalStateException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  } catch (URISyntaxException e) {
    e.printStackTrace();
  }
}
origin: facebook/stetho

public URLConnectionInspectorRequest(
  String requestId,
  String friendlyName,
  HttpURLConnection configuredRequest,
  @Nullable SimpleRequestEntity requestEntity,
  RequestBodyHelper requestBodyHelper) {
 super(Util.convertHeaders(configuredRequest.getRequestProperties()));
 mRequestId = requestId;
 mFriendlyName = friendlyName;
 mRequestEntity = requestEntity;
 mRequestBodyHelper = requestBodyHelper;
 mUrl = configuredRequest.getURL().toString();
 mMethod = configuredRequest.getRequestMethod();
}
origin: facebook/facebook-android-sdk

  @Test
  public void testBuildsClientTokenIfNeeded() throws Exception {
    GraphRequest requestMe = new GraphRequest(null, "TourEiffel");
    HttpURLConnection connection = GraphRequest.toHttpConnection(requestMe);

    assertTrue(connection != null);

    Uri uri = Uri.parse(connection.getURL().toString());
    String accessToken = uri.getQueryParameter("access_token");
    assertNotNull(accessToken);
    assertTrue(accessToken.contains(FacebookSdk.getApplicationId()));
    assertTrue(accessToken.contains(FacebookSdk.getClientToken()));
  }
}
origin: facebook/facebook-android-sdk

@Test
public void testSingleGetToHttpRequest() throws Exception {
  GraphRequest requestMe = new GraphRequest(null, "TourEiffel");
  HttpURLConnection connection = GraphRequest.toHttpConnection(requestMe);
  assertTrue(connection != null);
  assertEquals("GET", connection.getRequestMethod());
  assertEquals("/" + FacebookSdk.getGraphApiVersion() + "/TourEiffel",
    connection.getURL().getPath());
  assertTrue(connection.getRequestProperty("User-Agent").startsWith("FBAndroidSDK"));
  Uri uri = Uri.parse(connection.getURL().toString());
  assertEquals("android", uri.getQueryParameter("sdk"));
  assertEquals("json", uri.getQueryParameter("format"));
}
java.netHttpURLConnectiongetURL

Popular methods of HttpURLConnection

  • getInputStream
  • getResponseCode
    Returns the response code returned by the remote HTTP server.
  • setRequestMethod
    Sets the request command which will be sent to the remote HTTP server. This method can only be calle
  • setRequestProperty
  • setDoOutput
  • getOutputStream
  • disconnect
    Releases this connection so that its resources may be either reused or closed. Unlike other Java imp
  • setConnectTimeout
  • connect
  • setReadTimeout
  • getErrorStream
    Returns an input stream from the server in the case of an error such as the requested file has not b
  • setDoInput
  • getErrorStream,
  • setDoInput,
  • getResponseMessage,
  • getHeaderField,
  • setUseCaches,
  • setInstanceFollowRedirects,
  • getHeaderFields,
  • addRequestProperty,
  • getContentLength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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