1 50 51 package org.openlaszlo.iv.flash.url; 52 53 import java.io.*; 54 import java.net.*; 55 import java.util.*; 56 import org.openlaszlo.iv.flash.api.*; 57 import org.openlaszlo.iv.flash.util.*; 58 59 66 public class BufferedUrl extends IVUrl { 67 68 private FlashBuffer fb; 69 private IVUrl url; 70 71 77 public BufferedUrl( IVUrl url ) throws IOException { 78 this.url = url; 79 this.fb = Util.readUrl( url ); 80 } 81 82 89 public BufferedUrl( String surl, FlashFile file ) throws IOException, IVException { 90 this.url = IVUrl.newUrl(surl, file); 91 this.fb = Util.readUrl( url ); 92 } 93 94 99 public BufferedUrl( FlashBuffer fb ) { 100 this.fb = fb; 101 } 102 103 public FlashBuffer getFlashBuffer() { 104 return fb; 105 } 106 107 public String getName() { 108 return "fgbuffer:///"+hashCode(); 109 } 110 111 public InputStream getInputStream() throws IOException { 112 return fb.getInputStream(); 113 } 114 115 public String getParameter( String name ) { 116 if( url == null ) return super.getParameter( name ); 117 return url.getParameter( name ); 118 } 119 120 public long lastModified() { 121 if( url == null ) return super.lastModified(); 122 return url.lastModified(); 123 } 124 125 public void refresh() { 126 if( url == null ) { 127 super.refresh(); 128 } else { 129 url.refresh(); 130 } 131 } 132 133 public String getRef() { 134 if( url == null ) return super.getRef(); 135 return url.getRef(); 136 } 137 138 } 139 | Popular Tags |