Tabnine Logo
ProxySettings.openURLConnection
Code IndexAdd Tabnine to your IDE (free)

How to use
openURLConnection
method
in
org.deegree.commons.proxy.ProxySettings

Best Java code snippets using org.deegree.commons.proxy.ProxySettings.openURLConnection (Showing top 6 results out of 315)

origin: deegree/deegree3

/**
 * This method should be used everywhere instead of <code>URL.openConnection()</code>, as it copes with proxies that
 * require user authentication. This method will retrieve the configured password and user name.
 * 
 * @param url
 * @return connection
 * @throws IOException
 */
public static URLConnection openURLConnection( URL url )
            throws IOException {
  return openURLConnection( url, getProxyUser(), getProxyPassword() );
}
origin: deegree/deegree3

/**
 * Validates the specified XML instance document according to the contained schema references (
 * <code>xsi:schemaLocation</code> attribute) and/or to the explicitly specified schema references.
 * 
 * @param url
 *            provides the XML document to be validated, must not be null
 * @param schemaUris
 *            URIs of schema documents to be considered, can be null (only the <code>xsi:schemaLocation</code>
 *            attribute is considered then)
 * @return list of validation events (errors/warnings) that occured, never null, size of 0 means valid document
 * @throws IOException
 * @throws MalformedURLException
 */
public static List<SchemaValidationEvent> validate( String url, String... schemaUris )
            throws MalformedURLException, IOException {
  InputStream is = ProxySettings.openURLConnection( new URL( url ), null, null ).getInputStream();
  return validate( new XMLInputSource( null, null, null, is, null ), schemaUris );
}
origin: deegree/deegree3

  /**
   * Creates a new {@link GMLStreamReader} instance for reading GML of the specified version.
   * 
   * @param version
   *            GML version, must not be <code>null</code>
   * @param url
   *            URL used to read the input, must not be <code>null</code>
   * @return initialized {@link GMLStreamReader}
   * @throws IOException
   * @throws FactoryConfigurationError
   * @throws XMLStreamException
   */
  public static GMLStreamReader createGMLStreamReader( GMLVersion version, URL url )
              throws XMLStreamException, FactoryConfigurationError, IOException {

    URLConnection conn = ProxySettings.openURLConnection( url );
    InputStream is = conn.getInputStream();
    XMLStreamReader xmlStream = XMLInputFactory.newInstance().createXMLStreamReader( is );
    // skip START_DOCUMENT event
    xmlStream.nextTag();
    return new GMLStreamReader( version, new XMLStreamReaderWrapper( xmlStream, url.toString() ) );
  }
}
origin: deegree/deegree3

private void openReader() {
  try {
    synchronized ( LOCK ) {
      configStream = ProxySettings.openURLConnection( configURL ).getInputStream();
      this.configReader = XMLInputFactory.newInstance().createXMLStreamReader( configURL.toExternalForm(),
                                           this.configStream );
      // move from start document.
      XMLStreamUtils.nextElement( configReader );
      if ( !expectedRootName().equals( configReader.getName() ) ) {
        LOG.error( "The root element of the crs configuration at location: " + configURL
              + " is not the expected: " + expectedRootName() + " is your configuration correct?" );
      }
    }
  } catch ( XMLStreamException e ) {
    LOG.debug( "Could not read config file from url: " + configURL + ", stack trace.", e );
    LOG.error( "Could not read config file from url: " + configURL + " because: " + e.getLocalizedMessage() );
  } catch ( FactoryConfigurationError e ) {
    LOG.debug( "Could not read config file from url: " + configURL + ", stack trace.", e );
    LOG.error( "Could not read config file from url: " + configURL + " because: " + e.getLocalizedMessage() );
  } catch ( IOException e ) {
    LOG.debug( "Could not read config file from url: " + configURL + ", stack trace.", e );
    LOG.error( "Could not read config file from url: " + configURL + " because: " + e.getLocalizedMessage() );
  }
}
origin: deegree/deegree3

URLConnection conn = ProxySettings.openURLConnection( theUrl, ProxySettings.getHttpProxyUser( true ),
                           ProxySettings.getHttpProxyPassword( true ),
                           httpBasicUser, httpBasicPass );
origin: deegree/deegree3

URLConnection conn = ProxySettings.openURLConnection( theUrl, getHttpProxyUser( true ),
                           getHttpProxyPassword( true ), httpBasicUser,
                           httpBasicPass );
org.deegree.commons.proxyProxySettingsopenURLConnection

Javadoc

This method should be used everywhere instead of URL.openConnection(), as it copes with proxies that require user authentication. This method will retrieve the configured password and user name.

Popular methods of ProxySettings

  • getHttpProxyPassword
  • getHttpProxyUser
  • getFtpNonProxyHosts
  • getFtpProxyHost
  • getFtpProxyPassword
  • getFtpProxyPort
  • getFtpProxyUser
  • getHttpNonProxyHosts
  • getHttpProxyHost
  • getHttpProxyPort
  • getNonProxyHosts
  • getProxyHost
  • getNonProxyHosts,
  • getProxyHost,
  • getProxyPassword,
  • getProxyPort,
  • getProxyUser,
  • logProxyConfiguration,
  • setProperty,
  • setupProxyParameters

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JPanel (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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