Revision 18334 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/kml/exceptions/KmlException.java

View differences:

KmlException.java
7 7
import java.util.Map;
8 8

  
9 9
import org.gvsig.exceptions.BaseException;
10
import org.gvsig.remoteClient.gml.exceptions.GMLException;
10 11

  
11 12
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
12 13
 *
......
60 61
/**
61 62
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
62 63
 */
63
public class KmlException extends BaseException{
64
public class KmlException extends GMLException{
64 65
	private static final long serialVersionUID = -5288461844362832914L;
65
	private String m_File = null;	
66
	private String filename="";
67
	protected String formatString;
68
	protected String messageKey;
69
	protected long code;
66 70

  
67 71
	public KmlException(InputStream file) {
68 72
		if (file instanceof FileInputStream){
69 73
			//Object o = ((FileInputStream)file).getFD().
70 74
		}
71
		this.m_File = "fileName";
75
		this.filename = "fileName";
72 76
		init();		
73 77
	}
78

  
79
	public KmlException() {
80
		
81
	}
74 82
	
75
	public KmlException(InputStream file,Throwable exception) {
76
		this.m_File = "fileName";
83
	public KmlException(String file) {
77 84
		init();
85
		this.filename=file;
86
	}
87
	public KmlException(Throwable exception) {
88
		init();
78 89
		initCause(exception);
79 90
	}
80
	
81
	public KmlException(File file) {
82
		this.m_File = file.getAbsolutePath();
83
		init();		
84
	}
85
	
86
	public KmlException(File file,Throwable exception) {
87
		this.m_File = file.getAbsolutePath();
91
	public KmlException(String file, Throwable exception) {
88 92
		init();
93
		this.filename=file;
89 94
		initCause(exception);
90 95
	}
91 96
	
92
	private void init() {
93
		messageKey = "error_kml_generic";
94
		formatString = "Error opening Kml file %(file)";
95
		code = serialVersionUID;		
97
	public String getFilename() {
98
		return filename;
96 99
	}
97 100

  
101
	public void setFilename(String filename) {
102
		this.filename = filename;
103
	}
104
	
98 105
	protected Map values() {
99
		Hashtable params = new Hashtable();
100
		params.put("file",m_File);
101
		return params;		
106
		//Key -> value... filename -> name of the file
107
		Hashtable params;
108
		params = new Hashtable();
109
		params.put("file",filename);
110
		
111
		return params;
102 112
	}
103 113

  
114
	public void init() {
115
		messageKey="Kml_Error";
116
		formatString="Error opening KML shape %(file)";
117
		code = serialVersionUID;
118
	}
119
	
120

  
104 121
}
122

  

Also available in: Unified diff