Class LuckyLyricsProvider
- java.lang.Object
-
- com.tagtraum.ubermusic.luckylyrics.LuckyLyricsProvider
-
- All Implemented Interfaces:
LyricsProvider
public class LuckyLyricsProvider extends Object implements LyricsProvider
LuckyLyrics Provider.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description LuckyLyricsProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
extractCharset(String contentType)
Attempts to extract a character set from a content type.Lyrics
getLyrics(String title, String artist)
Returns aLyrics
object ornull
, if no lyrics can be found.String
getName()
Display name for this provider.static String
sniffHTMLCharset(byte[] buf)
Attempts to extract a character set from a byte buffer representing an HTML page.-
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.LyricsProvider
getLyrics
-
-
-
-
Method Detail
-
getLyrics
public Lyrics getLyrics(String title, String artist) throws IOException
Description copied from interface:LyricsProvider
Returns aLyrics
object ornull
, if no lyrics can be found.- Specified by:
getLyrics
in interfaceLyricsProvider
- Parameters:
title
- song title, must not benull
artist
- artist name, must not benull
- Returns:
- lyrics object
- Throws:
IOException
- if something goes wrong
-
sniffHTMLCharset
public static String sniffHTMLCharset(byte[] buf)
Attempts to extract a character set from a byte buffer representing an HTML page.- Parameters:
buf
- byte buffer with HTML data- Returns:
- character set or
null
, if we were unable to extract
-
extractCharset
public static String extractCharset(String contentType)
Attempts to extract a character set from a content type.- Parameters:
contentType
- content type- Returns:
- character set or
null
, if we were unable to extract
-
getName
public String getName()
Description copied from interface:LyricsProvider
Display name for this provider.- Specified by:
getName
in interfaceLyricsProvider
- Returns:
- display name
-
-