View Javadoc

1    /****************************************************************************
2    * Copyright (c) 2005, 2006, 2007, 2008, 2009 Imola Informatica.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the LGPL License v2.1
5    * which accompanies this distribution, and is available at
6    * http://www.gnu.org/licenses/lgpl.html
7    ****************************************************************************/
8   package it.imolinfo.jbi4corba.jbi.cxf;
9           
10  	import java.io.IOException;
11  	import java.io.InputStreamReader;
12  	import java.io.LineNumberReader;
13  	import java.net.URL;
14  
15  	/**
16  	 * Provides information about a file that
17  	 */
18  	public class Jbi4CorbaIncludeStackEntry {
19  	    private final URL url;
20  
21  	    private LineNumberReader reader;
22  
23  	    private final String location;
24  
25  	    Jbi4CorbaIncludeStackEntry(URL link, String loc) throws IOException {
26  	        this.url = link;
27  	        this.location = loc;
28  	        this.reader = new LineNumberReader(new InputStreamReader(url.openStream(), "ISO-8859-1"));
29  	        this.reader.setLineNumber(1);
30  	    }
31  
32  	    public String getLocation() {
33  	        return location;
34  	    }
35  
36  	    public URL getURL() {
37  	        return url;
38  	    }
39  
40  	    public LineNumberReader getReader() {
41  	        return reader;
42  	    }
43  
44  	    public String toString() {
45  	        return "IncludeStackEntry[url=" + url + ", location=" + location
46  	            + ", line=" + reader.getLineNumber() + "]";
47  	    }
48  	}
49  
50