1 package com.atlassian.plugin.classloader.url;
2
3 import java.net.URLConnection;
4 import java.net.URL;
5 import java.net.URLStreamHandler;
6
7 /**
8 * Created by IntelliJ IDEA.
9 * User: sleberrigaud
10 * Date: May 9, 2008
11 * Time: 11:06:09 AM
12 * To change this template use File | Settings | File Templates.
13 */
14 public class BytesUrlStreamHandler extends URLStreamHandler
15 {
16 private final byte[] content;
17
18 public BytesUrlStreamHandler(byte[] content)
19 {
20 this.content = content;
21 }
22
23 public URLConnection openConnection(URL url)
24 {
25 return new BytesUrlConnection(url, content);
26 }
27 }