/**
* {@inheritDoc}
*/
public Track getTrack(String name) throws LibrarySearchException {
try {
IITTrackCollection searchResult = this.itLibrary.search(name, ITPlaylistSearchField.SongNames());
if (searchResult.getCount() > 1) {
throw new LibrarySearchException("There are multiple tracks with the specified name \"" + name + "\"");
} else if (searchResult.getCount() == 0) {
return null; // no track found
}
return new TrackCollectionImpl(this, searchResult).getFirst();
} catch (ObjectDeletedException e) {
throw new ITObjectDeletedError(this);