root / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / writer / GPEKmlWriterHandler.java @ 11205
History | View | Annotate | Download (2.41 KB)
1 |
package org.gvsig.gpe.kml.writer; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.io.FileInputStream; |
5 |
import java.io.FileNotFoundException; |
6 |
import java.io.FileOutputStream; |
7 |
import java.io.FileWriter; |
8 |
import java.io.IOException; |
9 |
import java.io.OutputStream; |
10 |
import java.io.Writer; |
11 |
|
12 |
import org.gvsig.gpe.GPEErrorHandler; |
13 |
import org.gvsig.gpe.writers.GPEWriterHandler; |
14 |
import org.gvsig.gpe.xml.writer.GPEXmlWriterHandler; |
15 |
|
16 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
17 |
*
|
18 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
19 |
*
|
20 |
* This program is free software; you can redistribute it and/or
|
21 |
* modify it under the terms of the GNU General Public License
|
22 |
* as published by the Free Software Foundation; either version 2
|
23 |
* of the License, or (at your option) any later version.
|
24 |
*
|
25 |
* This program is distributed in the hope that it will be useful,
|
26 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28 |
* GNU General Public License for more details.
|
29 |
*
|
30 |
* You should have received a copy of the GNU General Public License
|
31 |
* along with this program; if not, write to the Free Software
|
32 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
33 |
*
|
34 |
* For more information, contact:
|
35 |
*
|
36 |
* Generalitat Valenciana
|
37 |
* Conselleria d'Infraestructures i Transport
|
38 |
* Av. Blasco Ib??ez, 50
|
39 |
* 46010 VALENCIA
|
40 |
* SPAIN
|
41 |
*
|
42 |
* +34 963862235
|
43 |
* gvsig@gva.es
|
44 |
* www.gvsig.gva.es
|
45 |
*
|
46 |
* or
|
47 |
*
|
48 |
* IVER T.I. S.A
|
49 |
* Salamanca 50
|
50 |
* 46005 Valencia
|
51 |
* Spain
|
52 |
*
|
53 |
* +34 963163400
|
54 |
* dac@iver.es
|
55 |
*/
|
56 |
/* CVS MESSAGES:
|
57 |
*
|
58 |
* $Id: GPEKmlWriterHandler.java 11205 2007-04-13 13:16:21Z jorpiell $
|
59 |
* $Log$
|
60 |
* Revision 1.3 2007-04-13 13:16:21 jorpiell
|
61 |
* Add KML reading support
|
62 |
*
|
63 |
* Revision 1.2 2007/04/12 17:06:43 jorpiell
|
64 |
* First GML writing tests
|
65 |
*
|
66 |
* Revision 1.1 2007/04/12 10:21:52 jorpiell
|
67 |
* Add the writers
|
68 |
*
|
69 |
*
|
70 |
*/
|
71 |
/**
|
72 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
73 |
*/
|
74 |
public class GPEKmlWriterHandler extends GPEXmlWriterHandler{ |
75 |
|
76 |
public GPEKmlWriterHandler(String format, File file, GPEErrorHandler errorHandler) throws IOException { |
77 |
super(format, file, errorHandler);
|
78 |
} |
79 |
|
80 |
/*
|
81 |
* (non-Javadoc)
|
82 |
* @see org.gvsig.gpe.xml.writer.GPEXmlWriterHandler#createOutputStream()
|
83 |
*/
|
84 |
protected Writer createWriter() throws IOException { |
85 |
if(getFile().getName().toUpperCase().endsWith("KMZ")){ |
86 |
//TODO: Create the KMZ outputStream
|
87 |
} |
88 |
return new FileWriter(getFile()); |
89 |
} |
90 |
|
91 |
} |