Code example for ZipFile

Methods: close, getEntry

0
        } 
    } 
     
    public boolean isOOXML(File file) throws ZipException, IOException {
        try { 
            ZipFile zf = new ZipFile(file);
     
            try { 
                ZipEntry content = zf.getEntry("[Content_Types].xml");
                return content != null;
            } finally { 
                zf.close();
            } 
        } catch (Exception ex) {
            return false; 
        } 
    } 
 
    /** Break out the information in the given OOXML file, writing the text content to the provided Writer,  
     * and the properties into the given map. If out is null, the text won't be extracted. 
     * @param file