Class CoverartArchive
- java.lang.Object
-
- com.tagtraum.core.WebService
-
- com.tagtraum.ubermusic.coverartarchive.CoverartArchive
-
- All Implemented Interfaces:
UberMusic
public class CoverartArchive extends WebService implements UberMusic
Webservice to talk with the Cover Art Archive. Lookups can only be successful, if the queryAudioSongcontains a MusicBrainz album id (AudioId.MUSIC_BRAINZ_ALBUM). Even if the song contains such an id, the artwork may or may not be available.- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from class com.tagtraum.core.WebService
HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT
-
-
Constructor Summary
Constructors Constructor Description CoverartArchive()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AudioSong>lookup(AudioSong song)Looks up metadata for a song.List<Coverart>lookup(String mbid)protected URLConnectionopenConnection(URL url)Opens URLConnection and logs errors.-
Methods inherited from class com.tagtraum.core.WebService
cacheResource, clearCache, getCache, getConnectTimeOut, getDomFactory, getJSONArray, getJSONArray, getJSONObject, getJSONObject, getJSONObjectWithPayload, getMaxAge, getReadTimeOut, getRequestDelay, getSSLSocketFactory, getUserAgent, getXmlDocument, getXmlObject, handleStatusCode, isAcceptGzipContentEncoding, openConnection, openInputStream, readURL, setAcceptGzipContentEncoding, setCache, setConnectTimeOut, setDomFactory, setMaxAge, setNextAllowedConnection, setReadTimeOut, setRequestDelay, setSSLSocketFactory, setUserAgent, toParameterString, useCacheOnly, waitForTurn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.ubermusic.UberMusic
getArtists, getSimilarArtists, lookup, lookup
-
-
-
-
Method Detail
-
lookup
public List<AudioSong> lookup(AudioSong song) throws IOException
Description copied from interface:UberMusicLooks up metadata for a song.- Specified by:
lookupin interfaceUberMusic- Parameters:
song- song (query by example)- Returns:
- reference songs, empty list, if the metadata is unavailable
- Throws:
IOException- IOException
-
lookup
public List<Coverart> lookup(String mbid) throws IOException
- Throws:
IOException
-
openConnection
protected URLConnection openConnection(URL url) throws IOException
Description copied from class:WebServiceOpens URLConnection and logs errors.- Overrides:
openConnectionin classWebService- Parameters:
url- URL to connect to- Returns:
- opened URL connection
- Throws:
IOException- See Also:
WebService.openConnection(URL, String, Map, InputStream)
-
-