package com.mindoo.ec09.legacy;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

import com.mindoo.ec09.framework.views.ViewData;

public class URLViewData implements ViewData {
	private String m_id=null;
	private URL m_url;
	
	public URLViewData(URL url) {
		m_url=url;
	}
	
	public URLViewData(String id, URL url) {
		this(url);
		m_id=id;
	}
	
	public String getID() {
		return (m_id!=null) ? m_id : m_url.toExternalForm();
	}

	public InputStream openStream() throws IOException {
		return m_url.openStream();
	}
	
	public URL getURL() {
		return m_url;
	}
}
