/** * Creates a new instance that loads its content from the given <code>URL</code>. * * @param url * source of the xml content * @throws XMLProcessingException */ public XMLAdapter( URL url ) throws XMLProcessingException { load( url ); }
/** * Creates a new instance that loads its content from the given <code>StringReader</code> using the default url. * * @param reader * source of the xml content * * @throws XMLProcessingException */ public XMLAdapter( StringReader reader ) throws XMLProcessingException { load( reader, DEFAULT_URL ); }
/** * Initializes this <code>XMLAdapter</code> with the content from the given <code>InputStream</code> and sets the * system id to the {@link #DEFAULT_URL} * * @param resourceStream * to load the xml from. * @throws XMLProcessingException */ public void load( InputStream resourceStream ) throws XMLProcessingException { load( resourceStream, DEFAULT_URL ); }
/** * Creates a new instance that loads its content from the given <code>InputStream</code> using the default url. * * @param in * source of the xml content * * @throws XMLProcessingException */ public XMLAdapter( InputStream in ) throws XMLProcessingException { load( in, DEFAULT_URL ); }
/** * Initializes this <code>XMLAdapter</code> with the content from the given <code>StringReader</code> and sets the * system id to the {@link #DEFAULT_URL} * * @param reader * to load the xml from. * @throws XMLProcessingException */ public void load( StringReader reader ) throws XMLProcessingException { load( reader, DEFAULT_URL ); }
/** * Creates a new instance that loads its content from the given <code>InputStream</code>. * * @param in * source of the xml content * @param systemId * this string should represent a URL that is related to the passed reader. If this URL is not available * or unknown, the string should contain the value of XMLAdapter.DEFAULT_URL * * @throws XMLProcessingException */ public XMLAdapter( InputStream in, String systemId ) throws XMLProcessingException { load( in, systemId ); }
/** * Creates a new instance that loads its content from the given <code>StringReader</code>. * * @param reader * source of the xml content * @param systemId * this string should represent a URL that is related to the passed reader. If this URL is not available * or unknown, the string should contain the value of XMLAdapter.DEFAULT_URL * * @throws XMLProcessingException */ public XMLAdapter( StringReader reader, String systemId ) throws XMLProcessingException { load( reader, systemId ); }
public XMLAdapter( XMLStreamReader xmlStream ) { load( xmlStream ); }
/** * Creates a new instance that loads its content from the given <code>File</code>. * * @param file * source of the xml content * @throws XMLProcessingException */ public XMLAdapter( File file ) throws XMLProcessingException { if ( file != null ) { try { load( file.toURI().toURL() ); } catch ( MalformedURLException e ) { throw new XMLProcessingException( e ); } } }
/** * Same as #load(URL), but with http basic authentication * * @param url * @param httpBasicUser * @param httpBasicPass * @throws XMLProcessingException */ public void load( URL url, String httpBasicUser, String httpBasicPass ) throws XMLProcessingException { if ( url == null ) { throw new IllegalArgumentException( "The given url may not be null" ); } try { load( get( STREAM, url.toExternalForm(), null, httpBasicUser, httpBasicPass ), url.toExternalForm() ); } catch ( IOException e ) { throw new XMLProcessingException( e.getMessage(), e ); } }
/** * Initializes this <code>XMLAdapter</code> with the content from the given <code>URL</code>. Sets the SystemId, * too. * * @param url * source of the xml content * @throws XMLProcessingException */ public void load( URL url ) throws XMLProcessingException { if ( url == null ) { throw new IllegalArgumentException( "The given url may not be null" ); } try { load( get( STREAM, url.toExternalForm(), null ), url.toExternalForm() ); } catch ( IOException e ) { throw new XMLProcessingException( e.getMessage(), e ); } }
/** * TODO implement updateSequence handling to improve network performance */ public void refreshCapabilities() { String url = getAddress( GetCapabilities, true ); url = repairGetUrl( url ); url += "request=GetCapabilities&version=1.1.1&service=WMS"; try { XMLAdapter adapter; if ( httpBasicUser != null ) { adapter = new XMLAdapter(); adapter.load( new URL( url ), httpBasicUser, httpBasicPass ); } else { adapter = new XMLAdapter( new URL( url ) ); } initCapabilities( adapter ); checkCapabilities(); } catch ( MalformedURLException e ) { LOG.debug( "Malformed capabilities URL?", e ); } catch ( IOException e ) { LOG.debug( "Malformed capabilities URL?", e ); } }