Statistics
| Revision:

root / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / exceptions / KmlException.java @ 10637

History | View | Annotate | Download (2.77 KB)

1
package org.gvsig.gpe.kml.exceptions;
2

    
3
import java.io.File;
4
import java.io.FileInputStream;
5
import java.io.InputStream;
6
import java.util.Hashtable;
7
import java.util.Map;
8

    
9
import org.gvsig.exceptions.BaseException;
10

    
11
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
12
 *
13
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
14
 *
15
 * This program is free software; you can redistribute it and/or
16
 * modify it under the terms of the GNU General Public License
17
 * as published by the Free Software Foundation; either version 2
18
 * of the License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU General Public License
26
 * along with this program; if not, write to the Free Software
27
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
28
 *
29
 * For more information, contact:
30
 *
31
 *  Generalitat Valenciana
32
 *   Conselleria d'Infraestructures i Transport
33
 *   Av. Blasco Ib??ez, 50
34
 *   46010 VALENCIA
35
 *   SPAIN
36
 *
37
 *      +34 963862235
38
 *   gvsig@gva.es
39
 *      www.gvsig.gva.es
40
 *
41
 *    or
42
 *
43
 *   IVER T.I. S.A
44
 *   Salamanca 50
45
 *   46005 Valencia
46
 *   Spain
47
 *
48
 *   +34 963163400
49
 *   dac@iver.es
50
 */
51
/* CVS MESSAGES:
52
 *
53
 * $Id: KmlException.java 10637 2007-03-07 08:19:11Z jorpiell $
54
 * $Log$
55
 * Revision 1.1  2007-03-07 08:19:10  jorpiell
56
 * Pasadas las clases de KML de libGPE-GML a libGPE-KML
57
 *
58
 * Revision 1.1  2007/02/28 11:48:31  csanchez
59
 * *** empty log message ***
60
 *
61
 * Revision 1.1  2007/02/20 10:53:20  jorpiell
62
 * A?adidos los proyectos de kml y gml antiguos
63
 *
64
 * Revision 1.1  2007/02/12 13:49:18  jorpiell
65
 * A?adido el driver de KML
66
 *
67
 *
68
 */
69
/**
70
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
71
 */
72
public class KmlException extends BaseException{
73
        private static final long serialVersionUID = -5288461844362832914L;
74
        private String m_File = null;        
75

    
76
        public KmlException(InputStream file) {
77
                if (file instanceof FileInputStream){
78
                        //Object o = ((FileInputStream)file).getFD().
79
                }
80
                this.m_File = "fileName";
81
                init();                
82
        }
83
        
84
        public KmlException(InputStream file,Throwable exception) {
85
                this.m_File = "fileName";
86
                init();
87
                initCause(exception);
88
        }
89
        
90
        public KmlException(File file) {
91
                this.m_File = file.getAbsolutePath();
92
                init();                
93
        }
94
        
95
        public KmlException(File file,Throwable exception) {
96
                this.m_File = file.getAbsolutePath();
97
                init();
98
                initCause(exception);
99
        }
100
        
101
        private void init() {
102
                messageKey = "error_kml_generic";
103
                formatString = "Error opening Kml file %(file)";
104
                code = serialVersionUID;                
105
        }
106

    
107
        protected Map values() {
108
                Hashtable params = new Hashtable();
109
                params.put("file",m_File);
110
                return params;                
111
        }
112

    
113
}