net.dontdrinkandroot.lastfm.api.ws.fetcher

## Class AbstractFetcher

- java.lang.Object
- - net.dontdrinkandroot.lastfm.api.ws.fetcher.AbstractFetcher

All Implemented Interfaces:
  Fetcher

Direct Known Subclasses:
  DefaultFetcher

    public abstract class AbstractFetcher
    extends Object
    implements Fetcher

### Field Summary

Fields
`protected URL` `baseUrl` The base URL, needed if you want to proxy requests somewhere.
`protected DocumentBuilderFactory` `factory`
`protected org.slf4j.Logger` `logger`

### Constructor Summary

Constructors
Constructor and Description
`AbstractFetcher()`

### Method Summary

Methods
`protected String` `buildParameterString(Map<String,String> parameters)`
`protected URL` `buildUrl(Map<String,String> parameters)`
`protected HttpURLConnection` `openConnection(URL url)`
`protected Document` `parseDoc(InputStream is)` Parse a `Document` from an XML `InputStream`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.dontdrinkandroot.lastfm.api.ws.fetcher.Fetcher

`get, getWebRequestsPerSecond, post`

### Field Detail

#### baseUrl

    protected URL baseUrl

The base URL, needed if you want to proxy requests somewhere.

#### logger

    protected final org.slf4j.Logger logger

#### factory

    protected final DocumentBuilderFactory factory

### Constructor Detail

#### AbstractFetcher

    public AbstractFetcher()

### Method Detail

#### buildParameterString

    protected String buildParameterString(Map<String,String> parameters)

#### parseDoc

    protected Document parseDoc(InputStream is)
                         throws LastfmWebServicesException

Parse a `Document` from an XML `InputStream`.

Parameters:
  `is` - The InputStream to unmarshall.
Returns:
  The Document that was parsed.
Throws:
  `LastfmWebServicesException` - Thrown if reading the document fails.

#### buildUrl

    protected URL buildUrl(Map<String,String> parameters)

#### openConnection

    protected HttpURLConnection openConnection(URL url)
                                        throws LastfmWebServicesException

Throws:
  `LastfmWebServicesException`