}
}
public boolean touchYP(int action)
{
Metadata metadata = buffer.getMetadata();
InputStream inputStream = null;
boolean error = true;
boolean gotID = false;
boolean secondTry = false;
String errorDescription = "Invalid answer"; //$NON-NLS-1$
waitTime = DEFAULT_WAIT_TIME;
if ((ID == null) && ((action == ACTION_UPDATE) || (action == ACTION_REMOVE)))
{
return false;
}
try
{
String url = "http://" + YP_HOST + YP_DIR; //$NON-NLS-1$
if (action == ACTION_ADD)
{
url += "add.php?" + getMetadataString(metadata); //$NON-NLS-1$
}
else if (action == ACTION_UPDATE)
{
// Save bandwidth if possible
boolean update_everything = true;
update_everything = !(metadata.getContentType().equals(lastContentType)
&& metadata.getStationName().equals(lastStationName)
&& metadata.getStationURL().equals(lastStationURL)
&& metadata.getGenre().equals(lastGenre)
&& metadata.getDescription().equals(lastDescription));
if (update_everything)
{
url += "update.php?" + getUpdateMetadataString(metadata); //$NON-NLS-1$
}