/**
   * Information about this source. Subclasses should provide additional format specific
   * information.
   *
   * @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);
  }
 /**
  * Information about this source.
  *
  * <p>Subclasses should provide additional format specific information.
  *
  * @return ServiceInfo describing getSource().
  */
 public ServiceInfo getInfo() {
   DefaultServiceInfo info = new DefaultServiceInfo();
   info.setDescription(source == null ? null : String.valueOf(source));
   if (source instanceof URL) {
     URL url = (URL) source;
     info.setTitle(url.getFile());
     try {
       info.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) {
       info.setTitle(file.getName());
     }
     info.setSource(file.toURI());
   }
   return info;
 }