*
* @return ServiceInfo describing getSource().
*/
public synchronized ServiceInfo getInfo() {
if (serviceInfo!=null)
return new DefaultServiceInfo(this.serviceInfo);
DefaultServiceInfo localInfo = new DefaultServiceInfo();
serviceInfo=localInfo;
localInfo.setDescription(source.toString());
if (source instanceof URL) {
URL url = (URL) source;
localInfo.setTitle(url.getFile());
try {
localInfo.setSource(url.toURI());
} catch (URISyntaxException e) {
}
} else if (source instanceof File) {
File file = (File) source;
String filename = file.getName();
if ((filename == null) || (filename.length() == 0)) {
localInfo.setTitle(file.getName());
}
localInfo.setSource(file.toURI());
}
return new DefaultServiceInfo(localInfo);
}