FileDocCategorySizeDatePackage
DataSource.javaAPI DocFobs4JMF API 0.4.13248Wed Jan 10 11:13:06 GMT 2007com.omnividea.media.protocol.file

DataSource

public class DataSource extends DataSource implements Positionable
Changelong: 2004-12-17: Jose San Pedro Wandelmer (fobs@mac.com) Simpler solution for the *indows filename bug. Just replace file://drive/path with file:drive/path JMF accepts windows paths built using slashes :) 2004-09-15: Christian Berger (c.berger@tu-braunschweig.de): Handle multiple leading "/" in a URL. 2004-09-13: Christian Berger (c.berger@tu-braunschweig.de): Fixing a bug in the *indows distribution preventing fobs4jmf playing a video file in a simple player environment. 2004-06-6: Jose San Pedro Wandelmer Initial version

Fields Summary
private String
urlString
Constructors Summary
public DataSource()


      
      super();
    
public DataSource(MediaLocator ml)

      super (ml);
    
Methods Summary
public java.lang.StringgetUrlName()

      MediaLocator ml = this.getLocator();
      if(ml == null) throw new NullPointerException("No Medialocator found"); 
      String urlString = ""; 
      try { 
        if (ml != null) { 
          if (System.getProperty("file.separator").equals("\\") && ml.getProtocol().equals("file")) 
          { 
            String modifiedSource = ml.getURL().toExternalForm(); 
            urlString = modifiedSource.replaceFirst("file:/","file:"); 
            while(modifiedSource.equals(urlString) == false) 
            { 
              modifiedSource = urlString; 
              urlString = modifiedSource.replaceFirst("file:/","file:"); 
            } 
          } 
          else 
          { 
            try{ 
              urlString = ml.getURL().toString(); 
            }catch(Exception e){ 
              e.printStackTrace(); 
            } 
          } 
        } 
      } 
      catch (Exception e) { 
        System.out.println ("Bad URL: " + urlString); 
      } 
      return urlString;
    
public voidsetLocator(javax.media.MediaLocator ml)

      super.setLocator (ml);