}
public void loadTDFFile(ResourceLocator locator, List<Track> newTracks, Genome genome) {
log.debug("Loading TDF file " + locator.getPath());
TDFReader reader = TDFReader.getReader(locator);
TrackType type = reader.getTrackType();
TrackProperties props = null;
String trackLine = reader.getTrackLine();
if (trackLine != null && trackLine.length() > 0) {
props = new TrackProperties();
ParsingUtils.parseTrackLine(trackLine, props);
}
// In case of conflict between the resource locator display name and the track properties name,
// use the resource locator
String name = locator.getName();
if (name != null && props != null) {
props.setName(name);
}
if (name == null) {
name = props == null ? locator.getTrackName() : props.getName();
}
int trackNumber = 0;
String path = locator.getPath();
boolean multiTrack = reader.getTrackNames().length > 1;
for (String heading : reader.getTrackNames()) {
String trackId = multiTrack ? path + "_" + heading : path;
String trackName = multiTrack ? heading : name;
final DataSource dataSource = locator.getPath().endsWith(".counts") ?
new GobyCountArchiveDataSource(locator) :