Code example for ZipFile

Methods: close

0
 
                ZipFile zipFile = null;
                InputStream iStream = null;
                VdbHeader header = null;
                try { 
                    zipFile = new ZipFile(file);
                    iStream = getManifestStreamFromVdbArchive(zipFile);
                    // If the zip is empty or does not contain a manifest model return null; 
                    if (iStream == null) {
                        return null; 
                    } 
                    VdbHeaderReader reader = new VdbHeaderReader();
                    header = reader.read(iStream);
                } catch (IOException e) {
                    throw new TeiidDesignerRuntimeException(e);
                } finally { 
                    if (iStream != null) {
                        try { 
                            iStream.close();
                        } catch (IOException err) {
                            // do nothing 
                        } 
                    } 
                    if (zipFile != null) {
                        try { 
                            zipFile.close();
                        } catch (IOException e) {
                            // do nothing 
                        } 
                    } 
                }