Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tuneology.avm
Class FreeDb  view FreeDb download FreeDb.java

java.lang.Object
  extended bycom.tuneology.avm.FreeDb

public class FreeDb
extends java.lang.Object

An API for the FreeDb song database.

This API is single threaded; if you want to use it in a multithreaded program, create an instance of the FreeDb object for each thread.

Version:
$Id: FreeDb.java,v 1.4 2002/11/02 19:27:45 xnarf Exp $

Nested Class Summary
static class FreeDb.Site
          A class to represent a FreeDb server site.
 
Field Summary
private  java.io.File cacheDir
           
private  java.lang.String idStr
           
private  java.lang.String logOutput
           
private  java.lang.String proxyHost
           
private  int proxyPort
           
private  java.lang.String savedProxyHost
           
private  java.lang.String savedProxyPort
           
private  java.lang.String savedProxySet
           
private  java.lang.String stuff
           
private  java.util.Properties systemProperties
           
private  java.lang.String urlString
           
private  boolean usingProxy
           
 
Constructor Summary
FreeDb(java.lang.String host, java.lang.String appName, java.lang.String version, java.lang.String url, java.lang.String proxyHost, int proxyPort, java.io.File cacheDir)
          Create a FreeDb object, ready to make queries.
 
Method Summary
private  java.lang.String capitalize(java.lang.String str)
           
private  void clearTrackNames(DiscInfo ent)
           
private  void fixTracks(DiscInfo ent, java.lang.String sepChar)
           
 boolean get(java.lang.String categStr, DiscInfo ent)
          Returns information about the album, given its discid key,
private  java.io.InputStream getCacheFile(java.lang.String discId, java.lang.String categ)
           
 java.lang.String[] getCateg(java.lang.String trackStr)
          Returns a list of the possible entries for the disc.
static java.lang.String getHexId(int discId)
          Translated a discid value from an integer to an 8-digit hex number .
 java.lang.String getLogOutput()
          Returns the latest query and the result returned.
private  java.io.InputStream getRemoteData(java.lang.String discId, java.lang.String categ)
           
static java.lang.String getSepChar(TocEntry[] tracks)
          Returns a good guess for the character that separates the artist from the title in the information received from freedb regarding multi-artist CDs.
 FreeDb.Site[] getServers()
          Returns a list of available servers.
private static boolean isSepChar(TocEntry[] tracks, java.lang.String sep)
           
private  java.lang.String parseComment(java.lang.String str)
           
private  void parseResult(DiscInfo ent, java.lang.String str)
           
private  void resetProxy()
           
private  void setProxy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idStr

private java.lang.String idStr

urlString

private java.lang.String urlString

stuff

private java.lang.String stuff

cacheDir

private java.io.File cacheDir

logOutput

private java.lang.String logOutput

usingProxy

private boolean usingProxy

proxyHost

private java.lang.String proxyHost

proxyPort

private int proxyPort

savedProxySet

private java.lang.String savedProxySet

savedProxyHost

private java.lang.String savedProxyHost

savedProxyPort

private java.lang.String savedProxyPort

systemProperties

private java.util.Properties systemProperties
Constructor Detail

FreeDb

public FreeDb(java.lang.String host,
              java.lang.String appName,
              java.lang.String version,
              java.lang.String url,
              java.lang.String proxyHost,
              int proxyPort,
              java.io.File cacheDir)
Create a FreeDb object, ready to make queries.

Method Detail

getHexId

public static java.lang.String getHexId(int discId)
Translated a discid value from an integer to an 8-digit hex number .


getCateg

public java.lang.String[] getCateg(java.lang.String trackStr)
                            throws java.io.IOException
Returns a list of the possible entries for the disc. The user chooses one and then get() is called to fetch the cddb data.


getServers

public FreeDb.Site[] getServers()
                         throws java.io.IOException
Returns a list of available servers.


get

public boolean get(java.lang.String categStr,
                   DiscInfo ent)
            throws java.io.IOException
Returns information about the album, given its discid key,


getSepChar

public static java.lang.String getSepChar(TocEntry[] tracks)
Returns a good guess for the character that separates the artist from the title in the information received from freedb regarding multi-artist CDs.


getLogOutput

public java.lang.String getLogOutput()
Returns the latest query and the result returned.


setProxy

private void setProxy()

resetProxy

private void resetProxy()

parseComment

private java.lang.String parseComment(java.lang.String str)

capitalize

private java.lang.String capitalize(java.lang.String str)

parseResult

private void parseResult(DiscInfo ent,
                         java.lang.String str)

clearTrackNames

private void clearTrackNames(DiscInfo ent)

getCacheFile

private java.io.InputStream getCacheFile(java.lang.String discId,
                                         java.lang.String categ)

getRemoteData

private java.io.InputStream getRemoteData(java.lang.String discId,
                                          java.lang.String categ)

fixTracks

private void fixTracks(DiscInfo ent,
                       java.lang.String sepChar)

isSepChar

private static boolean isSepChar(TocEntry[] tracks,
                                 java.lang.String sep)