Revision 32585 branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/utils/Decompress.java

View differences:

Decompress.java
161 161
		while((entry = zipInputStream.getNextEntry()) != null) {			        
162 162
			logger.debug("Extracting: " + entry.getName());	
163 163

  
164
			if (entry.getName().endsWith(File.separator + "install.info")){
164
			if (entry.getName().endsWith(File.separator + "package.info")){
165 165
				PackageInfo installerInfo = readInstallInfo(zipInputStream);
166 166
				zipEntriesMap.put(installerInfo, zipEntryName);			
167 167
				readedIinstallerInfos.add(installerInfo);					
......
195 195
			if (entry.isDirectory()){
196 196
				file.mkdir();
197 197
			}else{
198
				FileOutputStream fos = new FileOutputStream(outputDirectory.getAbsolutePath() + File.separator + entry.getName());
198
				createParentFolder(file);
199
				FileOutputStream fos = new FileOutputStream(file);
199 200

  
200 201
				while ((count = zipInputStream.read(data, 0, BUFFER)) != -1) {
201 202
					fos.write(data, 0, count);
202 203
				}
203 204
				fos.flush();		
204 205
				fos.close();	
205
			}
206
			//zipInputStream.closeEntry();
206
			}			
207 207
		}
208 208
	}	
209 209

  
210
	private void createParentFolder(File file) {
211
		File parentFile = file.getParentFile();
212
		if (!parentFile.exists()){
213
			createParentFolder(parentFile);
214
			parentFile.mkdir();
215
		}
216
	}
217

  
210 218
	public boolean delete(File dir) { 
211 219
		if (dir.isDirectory()){
212 220
			String[] children = dir.list(); 

Also available in: Unified diff