1 23 24 package org.objectweb.clif.util.bytearray; 25 26 27 import org.objectweb.clif.util.ClifClassLoader; 28 import java.net.URLStreamHandler ; 29 import java.net.URL ; 30 import java.net.URLConnection ; 31 32 33 37 public class ByteArrayURLStreamHandler extends URLStreamHandler 38 { 39 ClifClassLoader my_cl; 40 41 42 public ByteArrayURLStreamHandler(ClifClassLoader classloader) 43 { 44 super(); 45 my_cl = classloader; 46 } 47 48 49 public URLConnection openConnection(URL u) 50 { 51 return new ByteArrayURLConnection(u, my_cl); 52 } 53 54 55 public void parseURL(URL u, String spec, int start, int limit) 56 { 57 setURL(u, "bytearray", "", -1, null, null, spec.substring(start, limit), null, null); 58 } 59 60 61 public String toExternalForm(URL u) 62 { 63 return "bytearray:" + u.getPath(); 64 } 65 } 66 | Popular Tags |