Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE-KML / src-test / org / gvsig / gpe / kml / readers / v21 / kmz / KMZBaseTest.java @ 19161

History | View | Annotate | Download (2.23 KB)

1
package org.gvsig.gpe.kml.readers.v21.kmz;
2

    
3
import java.io.BufferedInputStream;
4
import java.io.FileInputStream;
5
import java.io.FileNotFoundException;
6
import java.io.InputStream;
7
import java.util.zip.ZipEntry;
8
import java.util.zip.ZipFile;
9
import java.util.zip.ZipInputStream;
10

    
11
import org.gvsig.gpe.kml.readers.v21.kml.KMLBaseTest;
12

    
13
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
14
 *
15
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
16
 *
17
 * This program is free software; you can redistribute it and/or
18
 * modify it under the terms of the GNU General Public License
19
 * as published by the Free Software Foundation; either version 2
20
 * of the License, or (at your option) any later version.
21
 *
22
 * This program is distributed in the hope that it will be useful,
23
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
 * GNU General Public License for more details.
26
 *
27
 * You should have received a copy of the GNU General Public License
28
 * along with this program; if not, write to the Free Software
29
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
30
 *
31
 * For more information, contact:
32
 *
33
 *  Generalitat Valenciana
34
 *   Conselleria d'Infraestructures i Transport
35
 *   Av. Blasco Ib??ez, 50
36
 *   46010 VALENCIA
37
 *   SPAIN
38
 *
39
 *      +34 963862235
40
 *   gvsig@gva.es
41
 *      www.gvsig.gva.es
42
 *
43
 *    or
44
 *
45
 *   IVER T.I. S.A
46
 *   Salamanca 50
47
 *   46005 Valencia
48
 *   Spain
49
 *
50
 *   +34 963163400
51
 *   dac@iver.es
52
 */
53
/* CVS MESSAGES:
54
 *
55
 * $Id$
56
 * $Log$
57
 *
58
 */
59
/**
60
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
61
 */
62
public abstract class KMZBaseTest extends KMLBaseTest{
63

    
64
        /* (non-Javadoc)
65
         * @see org.gvsig.gpe.readers.GPEReaderBaseTest#getInputStream()
66
         */
67
        public InputStream getInputStream() throws Exception {
68
                FileInputStream fis = new FileInputStream(getFile());
69
                ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
70
                ZipEntry entry = null;
71
                while((entry = zis.getNextEntry()) != null){
72
                        if (!entry.isDirectory()){
73
                                ZipFile fz = new ZipFile(getFile());
74
                                return fz.getInputStream(entry);
75
                        }
76
                }
77
                throw new Exception();
78
        }
79

    
80

    
81
}