commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r854484 [11/43] - in /websites/production/commons/content/proper/commons-compress: ./ apidocs/ apidocs/org/apache/commons/compress/archivers/ apidocs/org/apache/commons/compress/archivers/ar/ apidocs/org/apache/commons/compress/archivers/ar...
Date Thu, 14 Mar 2013 17:11:35 GMT
Modified: websites/production/commons/content/proper/commons-compress/apidocs/src-html/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html
==============================================================================
--- websites/production/commons/content/proper/commons-compress/apidocs/src-html/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html (original)
+++ websites/production/commons/content/proper/commons-compress/apidocs/src-html/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.html Thu Mar 14 17:10:39 2013
@@ -280,434 +280,435 @@
 <span class="sourceLineNo">272</span>     * in which case the entry's content contains the target path<a name="line.272"></a>
 <span class="sourceLineNo">273</span>     * for the symlink.<a name="line.273"></a>
 <span class="sourceLineNo">274</span>     *<a name="line.274"></a>
-<span class="sourceLineNo">275</span>     * @return true if the entry represents a unix symlink, false otherwise.<a name="line.275"></a>
-<span class="sourceLineNo">276</span>     */<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    public boolean isUnixSymlink() {<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        return (getUnixMode() &amp; UnixStat.LINK_FLAG) == UnixStat.LINK_FLAG;<a name="line.278"></a>
-<span class="sourceLineNo">279</span>    }<a name="line.279"></a>
-<span class="sourceLineNo">280</span><a name="line.280"></a>
-<span class="sourceLineNo">281</span>    /**<a name="line.281"></a>
-<span class="sourceLineNo">282</span>     * Platform specification to put into the &amp;quot;version made<a name="line.282"></a>
-<span class="sourceLineNo">283</span>     * by&amp;quot; part of the central file header.<a name="line.283"></a>
-<span class="sourceLineNo">284</span>     *<a name="line.284"></a>
-<span class="sourceLineNo">285</span>     * @return PLATFORM_FAT unless {@link #setUnixMode setUnixMode}<a name="line.285"></a>
-<span class="sourceLineNo">286</span>     * has been called, in which case PLATFORM_UNIX will be returned.<a name="line.286"></a>
-<span class="sourceLineNo">287</span>     */<a name="line.287"></a>
-<span class="sourceLineNo">288</span>    public int getPlatform() {<a name="line.288"></a>
-<span class="sourceLineNo">289</span>        return platform;<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    }<a name="line.290"></a>
-<span class="sourceLineNo">291</span><a name="line.291"></a>
-<span class="sourceLineNo">292</span>    /**<a name="line.292"></a>
-<span class="sourceLineNo">293</span>     * Set the platform (UNIX or FAT).<a name="line.293"></a>
-<span class="sourceLineNo">294</span>     * @param platform an &lt;code&gt;int&lt;/code&gt; value - 0 is FAT, 3 is UNIX<a name="line.294"></a>
-<span class="sourceLineNo">295</span>     */<a name="line.295"></a>
-<span class="sourceLineNo">296</span>    protected void setPlatform(int platform) {<a name="line.296"></a>
-<span class="sourceLineNo">297</span>        this.platform = platform;<a name="line.297"></a>
-<span class="sourceLineNo">298</span>    }<a name="line.298"></a>
-<span class="sourceLineNo">299</span><a name="line.299"></a>
-<span class="sourceLineNo">300</span>    /**<a name="line.300"></a>
-<span class="sourceLineNo">301</span>     * Replaces all currently attached extra fields with the new array.<a name="line.301"></a>
-<span class="sourceLineNo">302</span>     * @param fields an array of extra fields<a name="line.302"></a>
-<span class="sourceLineNo">303</span>     */<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    public void setExtraFields(ZipExtraField[] fields) {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>        extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.305"></a>
-<span class="sourceLineNo">306</span>        for (ZipExtraField field : fields) {<a name="line.306"></a>
-<span class="sourceLineNo">307</span>            if (field instanceof UnparseableExtraFieldData) {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>                unparseableExtra = (UnparseableExtraFieldData) field;<a name="line.308"></a>
-<span class="sourceLineNo">309</span>            } else {<a name="line.309"></a>
-<span class="sourceLineNo">310</span>                extraFields.put(field.getHeaderId(), field);<a name="line.310"></a>
-<span class="sourceLineNo">311</span>            }<a name="line.311"></a>
-<span class="sourceLineNo">312</span>        }<a name="line.312"></a>
-<span class="sourceLineNo">313</span>        setExtra();<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    }<a name="line.314"></a>
-<span class="sourceLineNo">315</span><a name="line.315"></a>
-<span class="sourceLineNo">316</span>    /**<a name="line.316"></a>
-<span class="sourceLineNo">317</span>     * Retrieves all extra fields that have been parsed successfully.<a name="line.317"></a>
-<span class="sourceLineNo">318</span>     * @return an array of the extra fields<a name="line.318"></a>
-<span class="sourceLineNo">319</span>     */<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    public ZipExtraField[] getExtraFields() {<a name="line.320"></a>
-<span class="sourceLineNo">321</span>        return getExtraFields(false);<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    }<a name="line.322"></a>
-<span class="sourceLineNo">323</span><a name="line.323"></a>
-<span class="sourceLineNo">324</span>    /**<a name="line.324"></a>
-<span class="sourceLineNo">325</span>     * Retrieves extra fields.<a name="line.325"></a>
-<span class="sourceLineNo">326</span>     * @param includeUnparseable whether to also return unparseable<a name="line.326"></a>
-<span class="sourceLineNo">327</span>     * extra fields as {@link UnparseableExtraFieldData} if such data<a name="line.327"></a>
-<span class="sourceLineNo">328</span>     * exists.<a name="line.328"></a>
-<span class="sourceLineNo">329</span>     * @return an array of the extra fields<a name="line.329"></a>
-<span class="sourceLineNo">330</span>     *<a name="line.330"></a>
-<span class="sourceLineNo">331</span>     * @since 1.1<a name="line.331"></a>
-<span class="sourceLineNo">332</span>     */<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    public ZipExtraField[] getExtraFields(boolean includeUnparseable) {<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        if (extraFields == null) {<a name="line.334"></a>
-<span class="sourceLineNo">335</span>            return !includeUnparseable || unparseableExtra == null<a name="line.335"></a>
-<span class="sourceLineNo">336</span>                ? new ZipExtraField[0]<a name="line.336"></a>
-<span class="sourceLineNo">337</span>                : new ZipExtraField[] { unparseableExtra };<a name="line.337"></a>
-<span class="sourceLineNo">338</span>        }<a name="line.338"></a>
-<span class="sourceLineNo">339</span>        List&lt;ZipExtraField&gt; result =<a name="line.339"></a>
-<span class="sourceLineNo">340</span>            new ArrayList&lt;ZipExtraField&gt;(extraFields.values());<a name="line.340"></a>
-<span class="sourceLineNo">341</span>        if (includeUnparseable &amp;&amp; unparseableExtra != null) {<a name="line.341"></a>
-<span class="sourceLineNo">342</span>            result.add(unparseableExtra);<a name="line.342"></a>
-<span class="sourceLineNo">343</span>        }<a name="line.343"></a>
-<span class="sourceLineNo">344</span>        return result.toArray(new ZipExtraField[0]);<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    }<a name="line.345"></a>
-<span class="sourceLineNo">346</span><a name="line.346"></a>
-<span class="sourceLineNo">347</span>    /**<a name="line.347"></a>
-<span class="sourceLineNo">348</span>     * Adds an extra field - replacing an already present extra field<a name="line.348"></a>
-<span class="sourceLineNo">349</span>     * of the same type.<a name="line.349"></a>
-<span class="sourceLineNo">350</span>     *<a name="line.350"></a>
-<span class="sourceLineNo">351</span>     * &lt;p&gt;If no extra field of the same type exists, the field will be<a name="line.351"></a>
-<span class="sourceLineNo">352</span>     * added as last field.&lt;/p&gt;<a name="line.352"></a>
-<span class="sourceLineNo">353</span>     * @param ze an extra field<a name="line.353"></a>
-<span class="sourceLineNo">354</span>     */<a name="line.354"></a>
-<span class="sourceLineNo">355</span>    public void addExtraField(ZipExtraField ze) {<a name="line.355"></a>
-<span class="sourceLineNo">356</span>        if (ze instanceof UnparseableExtraFieldData) {<a name="line.356"></a>
-<span class="sourceLineNo">357</span>            unparseableExtra = (UnparseableExtraFieldData) ze;<a name="line.357"></a>
-<span class="sourceLineNo">358</span>        } else {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>            if (extraFields == null) {<a name="line.359"></a>
-<span class="sourceLineNo">360</span>                extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.360"></a>
-<span class="sourceLineNo">361</span>            }<a name="line.361"></a>
-<span class="sourceLineNo">362</span>            extraFields.put(ze.getHeaderId(), ze);<a name="line.362"></a>
-<span class="sourceLineNo">363</span>        }<a name="line.363"></a>
-<span class="sourceLineNo">364</span>        setExtra();<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    }<a name="line.365"></a>
-<span class="sourceLineNo">366</span><a name="line.366"></a>
-<span class="sourceLineNo">367</span>    /**<a name="line.367"></a>
-<span class="sourceLineNo">368</span>     * Adds an extra field - replacing an already present extra field<a name="line.368"></a>
-<span class="sourceLineNo">369</span>     * of the same type.<a name="line.369"></a>
-<span class="sourceLineNo">370</span>     *<a name="line.370"></a>
-<span class="sourceLineNo">371</span>     * &lt;p&gt;The new extra field will be the first one.&lt;/p&gt;<a name="line.371"></a>
-<span class="sourceLineNo">372</span>     * @param ze an extra field<a name="line.372"></a>
-<span class="sourceLineNo">373</span>     */<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    public void addAsFirstExtraField(ZipExtraField ze) {<a name="line.374"></a>
-<span class="sourceLineNo">375</span>        if (ze instanceof UnparseableExtraFieldData) {<a name="line.375"></a>
-<span class="sourceLineNo">376</span>            unparseableExtra = (UnparseableExtraFieldData) ze;<a name="line.376"></a>
-<span class="sourceLineNo">377</span>        } else {<a name="line.377"></a>
-<span class="sourceLineNo">378</span>            LinkedHashMap&lt;ZipShort, ZipExtraField&gt; copy = extraFields;<a name="line.378"></a>
-<span class="sourceLineNo">379</span>            extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.379"></a>
-<span class="sourceLineNo">380</span>            extraFields.put(ze.getHeaderId(), ze);<a name="line.380"></a>
-<span class="sourceLineNo">381</span>            if (copy != null) {<a name="line.381"></a>
-<span class="sourceLineNo">382</span>                copy.remove(ze.getHeaderId());<a name="line.382"></a>
-<span class="sourceLineNo">383</span>                extraFields.putAll(copy);<a name="line.383"></a>
-<span class="sourceLineNo">384</span>            }<a name="line.384"></a>
-<span class="sourceLineNo">385</span>        }<a name="line.385"></a>
-<span class="sourceLineNo">386</span>        setExtra();<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
-<span class="sourceLineNo">388</span><a name="line.388"></a>
-<span class="sourceLineNo">389</span>    /**<a name="line.389"></a>
-<span class="sourceLineNo">390</span>     * Remove an extra field.<a name="line.390"></a>
-<span class="sourceLineNo">391</span>     * @param type the type of extra field to remove<a name="line.391"></a>
-<span class="sourceLineNo">392</span>     */<a name="line.392"></a>
-<span class="sourceLineNo">393</span>    public void removeExtraField(ZipShort type) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>        if (extraFields == null) {<a name="line.394"></a>
-<span class="sourceLineNo">395</span>            throw new java.util.NoSuchElementException();<a name="line.395"></a>
-<span class="sourceLineNo">396</span>        }<a name="line.396"></a>
-<span class="sourceLineNo">397</span>        if (extraFields.remove(type) == null) {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>            throw new java.util.NoSuchElementException();<a name="line.398"></a>
-<span class="sourceLineNo">399</span>        }<a name="line.399"></a>
-<span class="sourceLineNo">400</span>        setExtra();<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    }<a name="line.401"></a>
-<span class="sourceLineNo">402</span><a name="line.402"></a>
-<span class="sourceLineNo">403</span>    /**<a name="line.403"></a>
-<span class="sourceLineNo">404</span>     * Removes unparseable extra field data.<a name="line.404"></a>
-<span class="sourceLineNo">405</span>     *<a name="line.405"></a>
-<span class="sourceLineNo">406</span>     * @since 1.1<a name="line.406"></a>
-<span class="sourceLineNo">407</span>     */<a name="line.407"></a>
-<span class="sourceLineNo">408</span>    public void removeUnparseableExtraFieldData() {<a name="line.408"></a>
-<span class="sourceLineNo">409</span>        if (unparseableExtra == null) {<a name="line.409"></a>
-<span class="sourceLineNo">410</span>            throw new java.util.NoSuchElementException();<a name="line.410"></a>
-<span class="sourceLineNo">411</span>        }<a name="line.411"></a>
-<span class="sourceLineNo">412</span>        unparseableExtra = null;<a name="line.412"></a>
-<span class="sourceLineNo">413</span>        setExtra();<a name="line.413"></a>
-<span class="sourceLineNo">414</span>    }<a name="line.414"></a>
-<span class="sourceLineNo">415</span><a name="line.415"></a>
-<span class="sourceLineNo">416</span>    /**<a name="line.416"></a>
-<span class="sourceLineNo">417</span>     * Looks up an extra field by its header id.<a name="line.417"></a>
-<span class="sourceLineNo">418</span>     *<a name="line.418"></a>
-<span class="sourceLineNo">419</span>     * @return null if no such field exists.<a name="line.419"></a>
-<span class="sourceLineNo">420</span>     */<a name="line.420"></a>
-<span class="sourceLineNo">421</span>    public ZipExtraField getExtraField(ZipShort type) {<a name="line.421"></a>
-<span class="sourceLineNo">422</span>        if (extraFields != null) {<a name="line.422"></a>
-<span class="sourceLineNo">423</span>            return extraFields.get(type);<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        }<a name="line.424"></a>
-<span class="sourceLineNo">425</span>        return null;<a name="line.425"></a>
-<span class="sourceLineNo">426</span>    }<a name="line.426"></a>
-<span class="sourceLineNo">427</span><a name="line.427"></a>
-<span class="sourceLineNo">428</span>    /**<a name="line.428"></a>
-<span class="sourceLineNo">429</span>     * Looks up extra field data that couldn't be parsed correctly.<a name="line.429"></a>
-<span class="sourceLineNo">430</span>     *<a name="line.430"></a>
-<span class="sourceLineNo">431</span>     * @return null if no such field exists.<a name="line.431"></a>
-<span class="sourceLineNo">432</span>     *<a name="line.432"></a>
-<span class="sourceLineNo">433</span>     * @since 1.1<a name="line.433"></a>
-<span class="sourceLineNo">434</span>     */<a name="line.434"></a>
-<span class="sourceLineNo">435</span>    public UnparseableExtraFieldData getUnparseableExtraFieldData() {<a name="line.435"></a>
-<span class="sourceLineNo">436</span>        return unparseableExtra;<a name="line.436"></a>
-<span class="sourceLineNo">437</span>    }<a name="line.437"></a>
-<span class="sourceLineNo">438</span><a name="line.438"></a>
-<span class="sourceLineNo">439</span>    /**<a name="line.439"></a>
-<span class="sourceLineNo">440</span>     * Parses the given bytes as extra field data and consumes any<a name="line.440"></a>
-<span class="sourceLineNo">441</span>     * unparseable data as an {@link UnparseableExtraFieldData}<a name="line.441"></a>
-<span class="sourceLineNo">442</span>     * instance.<a name="line.442"></a>
-<span class="sourceLineNo">443</span>     * @param extra an array of bytes to be parsed into extra fields<a name="line.443"></a>
-<span class="sourceLineNo">444</span>     * @throws RuntimeException if the bytes cannot be parsed<a name="line.444"></a>
-<span class="sourceLineNo">445</span>     * @throws RuntimeException on error<a name="line.445"></a>
-<span class="sourceLineNo">446</span>     */<a name="line.446"></a>
-<span class="sourceLineNo">447</span>    @Override<a name="line.447"></a>
-<span class="sourceLineNo">448</span>    public void setExtra(byte[] extra) throws RuntimeException {<a name="line.448"></a>
-<span class="sourceLineNo">449</span>        try {<a name="line.449"></a>
-<span class="sourceLineNo">450</span>            ZipExtraField[] local =<a name="line.450"></a>
-<span class="sourceLineNo">451</span>                ExtraFieldUtils.parse(extra, true,<a name="line.451"></a>
-<span class="sourceLineNo">452</span>                                      ExtraFieldUtils.UnparseableExtraField.READ);<a name="line.452"></a>
-<span class="sourceLineNo">453</span>            mergeExtraFields(local, true);<a name="line.453"></a>
-<span class="sourceLineNo">454</span>        } catch (ZipException e) {<a name="line.454"></a>
-<span class="sourceLineNo">455</span>            // actually this is not possible as of Commons Compress 1.1<a name="line.455"></a>
-<span class="sourceLineNo">456</span>            throw new RuntimeException("Error parsing extra fields for entry: "<a name="line.456"></a>
-<span class="sourceLineNo">457</span>                                       + getName() + " - " + e.getMessage(), e);<a name="line.457"></a>
-<span class="sourceLineNo">458</span>        }<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>    /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>     * Unfortunately {@link java.util.zip.ZipOutputStream<a name="line.462"></a>
-<span class="sourceLineNo">463</span>     * java.util.zip.ZipOutputStream} seems to access the extra data<a name="line.463"></a>
-<span class="sourceLineNo">464</span>     * directly, so overriding getExtra doesn't help - we need to<a name="line.464"></a>
-<span class="sourceLineNo">465</span>     * modify super's data directly.<a name="line.465"></a>
-<span class="sourceLineNo">466</span>     */<a name="line.466"></a>
-<span class="sourceLineNo">467</span>    protected void setExtra() {<a name="line.467"></a>
-<span class="sourceLineNo">468</span>        super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields(true)));<a name="line.468"></a>
-<span class="sourceLineNo">469</span>    }<a name="line.469"></a>
-<span class="sourceLineNo">470</span><a name="line.470"></a>
-<span class="sourceLineNo">471</span>    /**<a name="line.471"></a>
-<span class="sourceLineNo">472</span>     * Sets the central directory part of extra fields.<a name="line.472"></a>
-<span class="sourceLineNo">473</span>     */<a name="line.473"></a>
-<span class="sourceLineNo">474</span>    public void setCentralDirectoryExtra(byte[] b) {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>        try {<a name="line.475"></a>
-<span class="sourceLineNo">476</span>            ZipExtraField[] central =<a name="line.476"></a>
-<span class="sourceLineNo">477</span>                ExtraFieldUtils.parse(b, false,<a name="line.477"></a>
-<span class="sourceLineNo">478</span>                                      ExtraFieldUtils.UnparseableExtraField.READ);<a name="line.478"></a>
-<span class="sourceLineNo">479</span>            mergeExtraFields(central, false);<a name="line.479"></a>
-<span class="sourceLineNo">480</span>        } catch (ZipException e) {<a name="line.480"></a>
-<span class="sourceLineNo">481</span>            throw new RuntimeException(e.getMessage(), e);<a name="line.481"></a>
-<span class="sourceLineNo">482</span>        }<a name="line.482"></a>
-<span class="sourceLineNo">483</span>    }<a name="line.483"></a>
-<span class="sourceLineNo">484</span><a name="line.484"></a>
-<span class="sourceLineNo">485</span>    /**<a name="line.485"></a>
-<span class="sourceLineNo">486</span>     * Retrieves the extra data for the local file data.<a name="line.486"></a>
-<span class="sourceLineNo">487</span>     * @return the extra data for local file<a name="line.487"></a>
-<span class="sourceLineNo">488</span>     */<a name="line.488"></a>
-<span class="sourceLineNo">489</span>    public byte[] getLocalFileDataExtra() {<a name="line.489"></a>
-<span class="sourceLineNo">490</span>        byte[] extra = getExtra();<a name="line.490"></a>
-<span class="sourceLineNo">491</span>        return extra != null ? extra : EMPTY;<a name="line.491"></a>
-<span class="sourceLineNo">492</span>    }<a name="line.492"></a>
-<span class="sourceLineNo">493</span><a name="line.493"></a>
-<span class="sourceLineNo">494</span>    /**<a name="line.494"></a>
-<span class="sourceLineNo">495</span>     * Retrieves the extra data for the central directory.<a name="line.495"></a>
-<span class="sourceLineNo">496</span>     * @return the central directory extra data<a name="line.496"></a>
-<span class="sourceLineNo">497</span>     */<a name="line.497"></a>
-<span class="sourceLineNo">498</span>    public byte[] getCentralDirectoryExtra() {<a name="line.498"></a>
-<span class="sourceLineNo">499</span>        return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields(true));<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    }<a name="line.500"></a>
-<span class="sourceLineNo">501</span><a name="line.501"></a>
-<span class="sourceLineNo">502</span>    /**<a name="line.502"></a>
-<span class="sourceLineNo">503</span>     * Get the name of the entry.<a name="line.503"></a>
-<span class="sourceLineNo">504</span>     * @return the entry name<a name="line.504"></a>
-<span class="sourceLineNo">505</span>     */<a name="line.505"></a>
-<span class="sourceLineNo">506</span>    @Override<a name="line.506"></a>
-<span class="sourceLineNo">507</span>    public String getName() {<a name="line.507"></a>
-<span class="sourceLineNo">508</span>        return name == null ? super.getName() : name;<a name="line.508"></a>
-<span class="sourceLineNo">509</span>    }<a name="line.509"></a>
-<span class="sourceLineNo">510</span><a name="line.510"></a>
-<span class="sourceLineNo">511</span>    /**<a name="line.511"></a>
-<span class="sourceLineNo">512</span>     * Is this entry a directory?<a name="line.512"></a>
-<span class="sourceLineNo">513</span>     * @return true if the entry is a directory<a name="line.513"></a>
-<span class="sourceLineNo">514</span>     */<a name="line.514"></a>
-<span class="sourceLineNo">515</span>    @Override<a name="line.515"></a>
-<span class="sourceLineNo">516</span>    public boolean isDirectory() {<a name="line.516"></a>
-<span class="sourceLineNo">517</span>        return getName().endsWith("/");<a name="line.517"></a>
-<span class="sourceLineNo">518</span>    }<a name="line.518"></a>
-<span class="sourceLineNo">519</span><a name="line.519"></a>
-<span class="sourceLineNo">520</span>    /**<a name="line.520"></a>
-<span class="sourceLineNo">521</span>     * Set the name of the entry.<a name="line.521"></a>
-<span class="sourceLineNo">522</span>     * @param name the name to use<a name="line.522"></a>
-<span class="sourceLineNo">523</span>     */<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    protected void setName(String name) {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>        if (name != null &amp;&amp; getPlatform() == PLATFORM_FAT<a name="line.525"></a>
-<span class="sourceLineNo">526</span>            &amp;&amp; name.indexOf("/") == -1) {<a name="line.526"></a>
-<span class="sourceLineNo">527</span>            name = name.replace('\\', '/');<a name="line.527"></a>
-<span class="sourceLineNo">528</span>        }<a name="line.528"></a>
-<span class="sourceLineNo">529</span>        this.name = name;<a name="line.529"></a>
-<span class="sourceLineNo">530</span>    }<a name="line.530"></a>
-<span class="sourceLineNo">531</span><a name="line.531"></a>
-<span class="sourceLineNo">532</span>    /**<a name="line.532"></a>
-<span class="sourceLineNo">533</span>     * Gets the uncompressed size of the entry data.<a name="line.533"></a>
-<span class="sourceLineNo">534</span>     * @return the entry size<a name="line.534"></a>
-<span class="sourceLineNo">535</span>     */<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    @Override<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    public long getSize() {<a name="line.537"></a>
-<span class="sourceLineNo">538</span>        return size;<a name="line.538"></a>
-<span class="sourceLineNo">539</span>    }<a name="line.539"></a>
-<span class="sourceLineNo">540</span><a name="line.540"></a>
-<span class="sourceLineNo">541</span>    /**<a name="line.541"></a>
-<span class="sourceLineNo">542</span>     * Sets the uncompressed size of the entry data.<a name="line.542"></a>
-<span class="sourceLineNo">543</span>     * @param size the uncompressed size in bytes<a name="line.543"></a>
-<span class="sourceLineNo">544</span>     * @exception IllegalArgumentException if the specified size is less<a name="line.544"></a>
-<span class="sourceLineNo">545</span>     *            than 0<a name="line.545"></a>
-<span class="sourceLineNo">546</span>     */<a name="line.546"></a>
-<span class="sourceLineNo">547</span>    @Override<a name="line.547"></a>
-<span class="sourceLineNo">548</span>    public void setSize(long size) {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>        if (size &lt; 0) {<a name="line.549"></a>
-<span class="sourceLineNo">550</span>            throw new IllegalArgumentException("invalid entry size");<a name="line.550"></a>
-<span class="sourceLineNo">551</span>        }<a name="line.551"></a>
-<span class="sourceLineNo">552</span>        this.size = size;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span><a name="line.554"></a>
-<span class="sourceLineNo">555</span>    /**<a name="line.555"></a>
-<span class="sourceLineNo">556</span>     * Sets the name using the raw bytes and the string created from<a name="line.556"></a>
-<span class="sourceLineNo">557</span>     * it by guessing or using the configured encoding.<a name="line.557"></a>
-<span class="sourceLineNo">558</span>     * @param name the name to use created from the raw bytes using<a name="line.558"></a>
-<span class="sourceLineNo">559</span>     * the guessed or configured encoding<a name="line.559"></a>
-<span class="sourceLineNo">560</span>     * @param rawName the bytes originally read as name from the<a name="line.560"></a>
-<span class="sourceLineNo">561</span>     * archive<a name="line.561"></a>
-<span class="sourceLineNo">562</span>     * @since 1.2<a name="line.562"></a>
-<span class="sourceLineNo">563</span>     */<a name="line.563"></a>
-<span class="sourceLineNo">564</span>    protected void setName(String name, byte[] rawName) {<a name="line.564"></a>
-<span class="sourceLineNo">565</span>        setName(name);<a name="line.565"></a>
-<span class="sourceLineNo">566</span>        this.rawName = rawName;<a name="line.566"></a>
-<span class="sourceLineNo">567</span>    }<a name="line.567"></a>
-<span class="sourceLineNo">568</span><a name="line.568"></a>
-<span class="sourceLineNo">569</span>    /**<a name="line.569"></a>
-<span class="sourceLineNo">570</span>     * Returns the raw bytes that made up the name before it has been<a name="line.570"></a>
-<span class="sourceLineNo">571</span>     * converted using the configured or guessed encoding.<a name="line.571"></a>
-<span class="sourceLineNo">572</span>     *<a name="line.572"></a>
-<span class="sourceLineNo">573</span>     * &lt;p&gt;This method will return null if this instance has not been<a name="line.573"></a>
-<span class="sourceLineNo">574</span>     * read from an archive.&lt;/p&gt;<a name="line.574"></a>
-<span class="sourceLineNo">575</span>     *<a name="line.575"></a>
-<span class="sourceLineNo">576</span>     * @since 1.2<a name="line.576"></a>
-<span class="sourceLineNo">577</span>     */<a name="line.577"></a>
-<span class="sourceLineNo">578</span>    public byte[] getRawName() {<a name="line.578"></a>
-<span class="sourceLineNo">579</span>        if (rawName != null) {<a name="line.579"></a>
-<span class="sourceLineNo">580</span>            byte[] b = new byte[rawName.length];<a name="line.580"></a>
-<span class="sourceLineNo">581</span>            System.arraycopy(rawName, 0, b, 0, rawName.length);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>            return b;<a name="line.582"></a>
-<span class="sourceLineNo">583</span>        }<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        return null;<a name="line.584"></a>
-<span class="sourceLineNo">585</span>    }<a name="line.585"></a>
-<span class="sourceLineNo">586</span><a name="line.586"></a>
-<span class="sourceLineNo">587</span>    /**<a name="line.587"></a>
-<span class="sourceLineNo">588</span>     * Get the hashCode of the entry.<a name="line.588"></a>
-<span class="sourceLineNo">589</span>     * This uses the name as the hashcode.<a name="line.589"></a>
-<span class="sourceLineNo">590</span>     * @return a hashcode.<a name="line.590"></a>
-<span class="sourceLineNo">591</span>     */<a name="line.591"></a>
-<span class="sourceLineNo">592</span>    @Override<a name="line.592"></a>
-<span class="sourceLineNo">593</span>    public int hashCode() {<a name="line.593"></a>
-<span class="sourceLineNo">594</span>        // this method has severe consequences on performance. We cannot rely<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        // on the super.hashCode() method since super.getName() always return<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        // the empty string in the current implemention (there's no setter)<a name="line.596"></a>
-<span class="sourceLineNo">597</span>        // so it is basically draining the performance of a hashmap lookup<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        return getName().hashCode();<a name="line.598"></a>
-<span class="sourceLineNo">599</span>    }<a name="line.599"></a>
-<span class="sourceLineNo">600</span><a name="line.600"></a>
-<span class="sourceLineNo">601</span>    /**<a name="line.601"></a>
-<span class="sourceLineNo">602</span>     * The "general purpose bit" field.<a name="line.602"></a>
-<span class="sourceLineNo">603</span>     * @since 1.1<a name="line.603"></a>
-<span class="sourceLineNo">604</span>     */<a name="line.604"></a>
-<span class="sourceLineNo">605</span>    public GeneralPurposeBit getGeneralPurposeBit() {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>        return gpb;<a name="line.606"></a>
-<span class="sourceLineNo">607</span>    }<a name="line.607"></a>
-<span class="sourceLineNo">608</span><a name="line.608"></a>
-<span class="sourceLineNo">609</span>    /**<a name="line.609"></a>
-<span class="sourceLineNo">610</span>     * The "general purpose bit" field.<a name="line.610"></a>
-<span class="sourceLineNo">611</span>     * @since 1.1<a name="line.611"></a>
-<span class="sourceLineNo">612</span>     */<a name="line.612"></a>
-<span class="sourceLineNo">613</span>    public void setGeneralPurposeBit(GeneralPurposeBit b) {<a name="line.613"></a>
-<span class="sourceLineNo">614</span>        gpb = b;<a name="line.614"></a>
-<span class="sourceLineNo">615</span>    }<a name="line.615"></a>
-<span class="sourceLineNo">616</span><a name="line.616"></a>
-<span class="sourceLineNo">617</span>    /**<a name="line.617"></a>
-<span class="sourceLineNo">618</span>     * If there are no extra fields, use the given fields as new extra<a name="line.618"></a>
-<span class="sourceLineNo">619</span>     * data - otherwise merge the fields assuming the existing fields<a name="line.619"></a>
-<span class="sourceLineNo">620</span>     * and the new fields stem from different locations inside the<a name="line.620"></a>
-<span class="sourceLineNo">621</span>     * archive.<a name="line.621"></a>
-<span class="sourceLineNo">622</span>     * @param f the extra fields to merge<a name="line.622"></a>
-<span class="sourceLineNo">623</span>     * @param local whether the new fields originate from local data<a name="line.623"></a>
-<span class="sourceLineNo">624</span>     */<a name="line.624"></a>
-<span class="sourceLineNo">625</span>    private void mergeExtraFields(ZipExtraField[] f, boolean local)<a name="line.625"></a>
-<span class="sourceLineNo">626</span>        throws ZipException {<a name="line.626"></a>
-<span class="sourceLineNo">627</span>        if (extraFields == null) {<a name="line.627"></a>
-<span class="sourceLineNo">628</span>            setExtraFields(f);<a name="line.628"></a>
-<span class="sourceLineNo">629</span>        } else {<a name="line.629"></a>
-<span class="sourceLineNo">630</span>            for (ZipExtraField element : f) {<a name="line.630"></a>
-<span class="sourceLineNo">631</span>                ZipExtraField existing;<a name="line.631"></a>
-<span class="sourceLineNo">632</span>                if (element instanceof UnparseableExtraFieldData) {<a name="line.632"></a>
-<span class="sourceLineNo">633</span>                    existing = unparseableExtra;<a name="line.633"></a>
-<span class="sourceLineNo">634</span>                } else {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>                    existing = getExtraField(element.getHeaderId());<a name="line.635"></a>
-<span class="sourceLineNo">636</span>                }<a name="line.636"></a>
-<span class="sourceLineNo">637</span>                if (existing == null) {<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                    addExtraField(element);<a name="line.638"></a>
-<span class="sourceLineNo">639</span>                } else {<a name="line.639"></a>
-<span class="sourceLineNo">640</span>                    if (local) {<a name="line.640"></a>
-<span class="sourceLineNo">641</span>                        byte[] b = element.getLocalFileDataData();<a name="line.641"></a>
-<span class="sourceLineNo">642</span>                        existing.parseFromLocalFileData(b, 0, b.length);<a name="line.642"></a>
-<span class="sourceLineNo">643</span>                    } else {<a name="line.643"></a>
-<span class="sourceLineNo">644</span>                        byte[] b = element.getCentralDirectoryData();<a name="line.644"></a>
-<span class="sourceLineNo">645</span>                        existing.parseFromCentralDirectoryData(b, 0, b.length);<a name="line.645"></a>
-<span class="sourceLineNo">646</span>                    }<a name="line.646"></a>
-<span class="sourceLineNo">647</span>                }<a name="line.647"></a>
-<span class="sourceLineNo">648</span>            }<a name="line.648"></a>
-<span class="sourceLineNo">649</span>            setExtra();<a name="line.649"></a>
-<span class="sourceLineNo">650</span>        }<a name="line.650"></a>
-<span class="sourceLineNo">651</span>    }<a name="line.651"></a>
-<span class="sourceLineNo">652</span><a name="line.652"></a>
-<span class="sourceLineNo">653</span>    /** {@inheritDoc} */<a name="line.653"></a>
-<span class="sourceLineNo">654</span>    public Date getLastModifiedDate() {<a name="line.654"></a>
-<span class="sourceLineNo">655</span>        return new Date(getTime());<a name="line.655"></a>
-<span class="sourceLineNo">656</span>    }<a name="line.656"></a>
-<span class="sourceLineNo">657</span><a name="line.657"></a>
-<span class="sourceLineNo">658</span>    /* (non-Javadoc)<a name="line.658"></a>
-<span class="sourceLineNo">659</span>     * @see java.lang.Object#equals(java.lang.Object)<a name="line.659"></a>
-<span class="sourceLineNo">660</span>     */<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    @Override<a name="line.661"></a>
-<span class="sourceLineNo">662</span>    public boolean equals(Object obj) {<a name="line.662"></a>
-<span class="sourceLineNo">663</span>        if (this == obj) {<a name="line.663"></a>
-<span class="sourceLineNo">664</span>            return true;<a name="line.664"></a>
-<span class="sourceLineNo">665</span>        }<a name="line.665"></a>
-<span class="sourceLineNo">666</span>        if (obj == null || getClass() != obj.getClass()) {<a name="line.666"></a>
-<span class="sourceLineNo">667</span>            return false;<a name="line.667"></a>
-<span class="sourceLineNo">668</span>        }<a name="line.668"></a>
-<span class="sourceLineNo">669</span>        ZipArchiveEntry other = (ZipArchiveEntry) obj;<a name="line.669"></a>
-<span class="sourceLineNo">670</span>        String myName = getName();<a name="line.670"></a>
-<span class="sourceLineNo">671</span>        String otherName = other.getName();<a name="line.671"></a>
-<span class="sourceLineNo">672</span>        if (myName == null) {<a name="line.672"></a>
-<span class="sourceLineNo">673</span>            if (otherName != null) {<a name="line.673"></a>
-<span class="sourceLineNo">674</span>                return false;<a name="line.674"></a>
-<span class="sourceLineNo">675</span>            }<a name="line.675"></a>
-<span class="sourceLineNo">676</span>        } else if (!myName.equals(otherName)) {<a name="line.676"></a>
-<span class="sourceLineNo">677</span>            return false;<a name="line.677"></a>
-<span class="sourceLineNo">678</span>        }<a name="line.678"></a>
-<span class="sourceLineNo">679</span>        String myComment = getComment();<a name="line.679"></a>
-<span class="sourceLineNo">680</span>        String otherComment = other.getComment();<a name="line.680"></a>
-<span class="sourceLineNo">681</span>        if (myComment == null) {<a name="line.681"></a>
-<span class="sourceLineNo">682</span>            myComment = "";<a name="line.682"></a>
-<span class="sourceLineNo">683</span>        }<a name="line.683"></a>
-<span class="sourceLineNo">684</span>        if (otherComment == null) {<a name="line.684"></a>
-<span class="sourceLineNo">685</span>            otherComment = "";<a name="line.685"></a>
-<span class="sourceLineNo">686</span>        }<a name="line.686"></a>
-<span class="sourceLineNo">687</span>        return getTime() == other.getTime()<a name="line.687"></a>
-<span class="sourceLineNo">688</span>            &amp;&amp; myComment.equals(otherComment)<a name="line.688"></a>
-<span class="sourceLineNo">689</span>            &amp;&amp; getInternalAttributes() == other.getInternalAttributes()<a name="line.689"></a>
-<span class="sourceLineNo">690</span>            &amp;&amp; getPlatform() == other.getPlatform()<a name="line.690"></a>
-<span class="sourceLineNo">691</span>            &amp;&amp; getExternalAttributes() == other.getExternalAttributes()<a name="line.691"></a>
-<span class="sourceLineNo">692</span>            &amp;&amp; getMethod() == other.getMethod()<a name="line.692"></a>
-<span class="sourceLineNo">693</span>            &amp;&amp; getSize() == other.getSize()<a name="line.693"></a>
-<span class="sourceLineNo">694</span>            &amp;&amp; getCrc() == other.getCrc()<a name="line.694"></a>
-<span class="sourceLineNo">695</span>            &amp;&amp; getCompressedSize() == other.getCompressedSize()<a name="line.695"></a>
-<span class="sourceLineNo">696</span>            &amp;&amp; Arrays.equals(getCentralDirectoryExtra(),<a name="line.696"></a>
-<span class="sourceLineNo">697</span>                             other.getCentralDirectoryExtra())<a name="line.697"></a>
-<span class="sourceLineNo">698</span>            &amp;&amp; Arrays.equals(getLocalFileDataExtra(),<a name="line.698"></a>
-<span class="sourceLineNo">699</span>                             other.getLocalFileDataExtra())<a name="line.699"></a>
-<span class="sourceLineNo">700</span>            &amp;&amp; gpb.equals(other.gpb);<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    }<a name="line.701"></a>
-<span class="sourceLineNo">702</span>}<a name="line.702"></a>
+<span class="sourceLineNo">275</span>     * @since 1.5<a name="line.275"></a>
+<span class="sourceLineNo">276</span>     * @return true if the entry represents a unix symlink, false otherwise.<a name="line.276"></a>
+<span class="sourceLineNo">277</span>     */<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    public boolean isUnixSymlink() {<a name="line.278"></a>
+<span class="sourceLineNo">279</span>        return (getUnixMode() &amp; UnixStat.LINK_FLAG) == UnixStat.LINK_FLAG;<a name="line.279"></a>
+<span class="sourceLineNo">280</span>    }<a name="line.280"></a>
+<span class="sourceLineNo">281</span><a name="line.281"></a>
+<span class="sourceLineNo">282</span>    /**<a name="line.282"></a>
+<span class="sourceLineNo">283</span>     * Platform specification to put into the &amp;quot;version made<a name="line.283"></a>
+<span class="sourceLineNo">284</span>     * by&amp;quot; part of the central file header.<a name="line.284"></a>
+<span class="sourceLineNo">285</span>     *<a name="line.285"></a>
+<span class="sourceLineNo">286</span>     * @return PLATFORM_FAT unless {@link #setUnixMode setUnixMode}<a name="line.286"></a>
+<span class="sourceLineNo">287</span>     * has been called, in which case PLATFORM_UNIX will be returned.<a name="line.287"></a>
+<span class="sourceLineNo">288</span>     */<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    public int getPlatform() {<a name="line.289"></a>
+<span class="sourceLineNo">290</span>        return platform;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>    }<a name="line.291"></a>
+<span class="sourceLineNo">292</span><a name="line.292"></a>
+<span class="sourceLineNo">293</span>    /**<a name="line.293"></a>
+<span class="sourceLineNo">294</span>     * Set the platform (UNIX or FAT).<a name="line.294"></a>
+<span class="sourceLineNo">295</span>     * @param platform an &lt;code&gt;int&lt;/code&gt; value - 0 is FAT, 3 is UNIX<a name="line.295"></a>
+<span class="sourceLineNo">296</span>     */<a name="line.296"></a>
+<span class="sourceLineNo">297</span>    protected void setPlatform(int platform) {<a name="line.297"></a>
+<span class="sourceLineNo">298</span>        this.platform = platform;<a name="line.298"></a>
+<span class="sourceLineNo">299</span>    }<a name="line.299"></a>
+<span class="sourceLineNo">300</span><a name="line.300"></a>
+<span class="sourceLineNo">301</span>    /**<a name="line.301"></a>
+<span class="sourceLineNo">302</span>     * Replaces all currently attached extra fields with the new array.<a name="line.302"></a>
+<span class="sourceLineNo">303</span>     * @param fields an array of extra fields<a name="line.303"></a>
+<span class="sourceLineNo">304</span>     */<a name="line.304"></a>
+<span class="sourceLineNo">305</span>    public void setExtraFields(ZipExtraField[] fields) {<a name="line.305"></a>
+<span class="sourceLineNo">306</span>        extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.306"></a>
+<span class="sourceLineNo">307</span>        for (ZipExtraField field : fields) {<a name="line.307"></a>
+<span class="sourceLineNo">308</span>            if (field instanceof UnparseableExtraFieldData) {<a name="line.308"></a>
+<span class="sourceLineNo">309</span>                unparseableExtra = (UnparseableExtraFieldData) field;<a name="line.309"></a>
+<span class="sourceLineNo">310</span>            } else {<a name="line.310"></a>
+<span class="sourceLineNo">311</span>                extraFields.put(field.getHeaderId(), field);<a name="line.311"></a>
+<span class="sourceLineNo">312</span>            }<a name="line.312"></a>
+<span class="sourceLineNo">313</span>        }<a name="line.313"></a>
+<span class="sourceLineNo">314</span>        setExtra();<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>    /**<a name="line.317"></a>
+<span class="sourceLineNo">318</span>     * Retrieves all extra fields that have been parsed successfully.<a name="line.318"></a>
+<span class="sourceLineNo">319</span>     * @return an array of the extra fields<a name="line.319"></a>
+<span class="sourceLineNo">320</span>     */<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    public ZipExtraField[] getExtraFields() {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>        return getExtraFields(false);<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    }<a name="line.323"></a>
+<span class="sourceLineNo">324</span><a name="line.324"></a>
+<span class="sourceLineNo">325</span>    /**<a name="line.325"></a>
+<span class="sourceLineNo">326</span>     * Retrieves extra fields.<a name="line.326"></a>
+<span class="sourceLineNo">327</span>     * @param includeUnparseable whether to also return unparseable<a name="line.327"></a>
+<span class="sourceLineNo">328</span>     * extra fields as {@link UnparseableExtraFieldData} if such data<a name="line.328"></a>
+<span class="sourceLineNo">329</span>     * exists.<a name="line.329"></a>
+<span class="sourceLineNo">330</span>     * @return an array of the extra fields<a name="line.330"></a>
+<span class="sourceLineNo">331</span>     *<a name="line.331"></a>
+<span class="sourceLineNo">332</span>     * @since 1.1<a name="line.332"></a>
+<span class="sourceLineNo">333</span>     */<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    public ZipExtraField[] getExtraFields(boolean includeUnparseable) {<a name="line.334"></a>
+<span class="sourceLineNo">335</span>        if (extraFields == null) {<a name="line.335"></a>
+<span class="sourceLineNo">336</span>            return !includeUnparseable || unparseableExtra == null<a name="line.336"></a>
+<span class="sourceLineNo">337</span>                ? new ZipExtraField[0]<a name="line.337"></a>
+<span class="sourceLineNo">338</span>                : new ZipExtraField[] { unparseableExtra };<a name="line.338"></a>
+<span class="sourceLineNo">339</span>        }<a name="line.339"></a>
+<span class="sourceLineNo">340</span>        List&lt;ZipExtraField&gt; result =<a name="line.340"></a>
+<span class="sourceLineNo">341</span>            new ArrayList&lt;ZipExtraField&gt;(extraFields.values());<a name="line.341"></a>
+<span class="sourceLineNo">342</span>        if (includeUnparseable &amp;&amp; unparseableExtra != null) {<a name="line.342"></a>
+<span class="sourceLineNo">343</span>            result.add(unparseableExtra);<a name="line.343"></a>
+<span class="sourceLineNo">344</span>        }<a name="line.344"></a>
+<span class="sourceLineNo">345</span>        return result.toArray(new ZipExtraField[0]);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    }<a name="line.346"></a>
+<span class="sourceLineNo">347</span><a name="line.347"></a>
+<span class="sourceLineNo">348</span>    /**<a name="line.348"></a>
+<span class="sourceLineNo">349</span>     * Adds an extra field - replacing an already present extra field<a name="line.349"></a>
+<span class="sourceLineNo">350</span>     * of the same type.<a name="line.350"></a>
+<span class="sourceLineNo">351</span>     *<a name="line.351"></a>
+<span class="sourceLineNo">352</span>     * &lt;p&gt;If no extra field of the same type exists, the field will be<a name="line.352"></a>
+<span class="sourceLineNo">353</span>     * added as last field.&lt;/p&gt;<a name="line.353"></a>
+<span class="sourceLineNo">354</span>     * @param ze an extra field<a name="line.354"></a>
+<span class="sourceLineNo">355</span>     */<a name="line.355"></a>
+<span class="sourceLineNo">356</span>    public void addExtraField(ZipExtraField ze) {<a name="line.356"></a>
+<span class="sourceLineNo">357</span>        if (ze instanceof UnparseableExtraFieldData) {<a name="line.357"></a>
+<span class="sourceLineNo">358</span>            unparseableExtra = (UnparseableExtraFieldData) ze;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>        } else {<a name="line.359"></a>
+<span class="sourceLineNo">360</span>            if (extraFields == null) {<a name="line.360"></a>
+<span class="sourceLineNo">361</span>                extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.361"></a>
+<span class="sourceLineNo">362</span>            }<a name="line.362"></a>
+<span class="sourceLineNo">363</span>            extraFields.put(ze.getHeaderId(), ze);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>        }<a name="line.364"></a>
+<span class="sourceLineNo">365</span>        setExtra();<a name="line.365"></a>
+<span class="sourceLineNo">366</span>    }<a name="line.366"></a>
+<span class="sourceLineNo">367</span><a name="line.367"></a>
+<span class="sourceLineNo">368</span>    /**<a name="line.368"></a>
+<span class="sourceLineNo">369</span>     * Adds an extra field - replacing an already present extra field<a name="line.369"></a>
+<span class="sourceLineNo">370</span>     * of the same type.<a name="line.370"></a>
+<span class="sourceLineNo">371</span>     *<a name="line.371"></a>
+<span class="sourceLineNo">372</span>     * &lt;p&gt;The new extra field will be the first one.&lt;/p&gt;<a name="line.372"></a>
+<span class="sourceLineNo">373</span>     * @param ze an extra field<a name="line.373"></a>
+<span class="sourceLineNo">374</span>     */<a name="line.374"></a>
+<span class="sourceLineNo">375</span>    public void addAsFirstExtraField(ZipExtraField ze) {<a name="line.375"></a>
+<span class="sourceLineNo">376</span>        if (ze instanceof UnparseableExtraFieldData) {<a name="line.376"></a>
+<span class="sourceLineNo">377</span>            unparseableExtra = (UnparseableExtraFieldData) ze;<a name="line.377"></a>
+<span class="sourceLineNo">378</span>        } else {<a name="line.378"></a>
+<span class="sourceLineNo">379</span>            LinkedHashMap&lt;ZipShort, ZipExtraField&gt; copy = extraFields;<a name="line.379"></a>
+<span class="sourceLineNo">380</span>            extraFields = new LinkedHashMap&lt;ZipShort, ZipExtraField&gt;();<a name="line.380"></a>
+<span class="sourceLineNo">381</span>            extraFields.put(ze.getHeaderId(), ze);<a name="line.381"></a>
+<span class="sourceLineNo">382</span>            if (copy != null) {<a name="line.382"></a>
+<span class="sourceLineNo">383</span>                copy.remove(ze.getHeaderId());<a name="line.383"></a>
+<span class="sourceLineNo">384</span>                extraFields.putAll(copy);<a name="line.384"></a>
+<span class="sourceLineNo">385</span>            }<a name="line.385"></a>
+<span class="sourceLineNo">386</span>        }<a name="line.386"></a>
+<span class="sourceLineNo">387</span>        setExtra();<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    }<a name="line.388"></a>
+<span class="sourceLineNo">389</span><a name="line.389"></a>
+<span class="sourceLineNo">390</span>    /**<a name="line.390"></a>
+<span class="sourceLineNo">391</span>     * Remove an extra field.<a name="line.391"></a>
+<span class="sourceLineNo">392</span>     * @param type the type of extra field to remove<a name="line.392"></a>
+<span class="sourceLineNo">393</span>     */<a name="line.393"></a>
+<span class="sourceLineNo">394</span>    public void removeExtraField(ZipShort type) {<a name="line.394"></a>
+<span class="sourceLineNo">395</span>        if (extraFields == null) {<a name="line.395"></a>
+<span class="sourceLineNo">396</span>            throw new java.util.NoSuchElementException();<a name="line.396"></a>
+<span class="sourceLineNo">397</span>        }<a name="line.397"></a>
+<span class="sourceLineNo">398</span>        if (extraFields.remove(type) == null) {<a name="line.398"></a>
+<span class="sourceLineNo">399</span>            throw new java.util.NoSuchElementException();<a name="line.399"></a>
+<span class="sourceLineNo">400</span>        }<a name="line.400"></a>
+<span class="sourceLineNo">401</span>        setExtra();<a name="line.401"></a>
+<span class="sourceLineNo">402</span>    }<a name="line.402"></a>
+<span class="sourceLineNo">403</span><a name="line.403"></a>
+<span class="sourceLineNo">404</span>    /**<a name="line.404"></a>
+<span class="sourceLineNo">405</span>     * Removes unparseable extra field data.<a name="line.405"></a>
+<span class="sourceLineNo">406</span>     *<a name="line.406"></a>
+<span class="sourceLineNo">407</span>     * @since 1.1<a name="line.407"></a>
+<span class="sourceLineNo">408</span>     */<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    public void removeUnparseableExtraFieldData() {<a name="line.409"></a>
+<span class="sourceLineNo">410</span>        if (unparseableExtra == null) {<a name="line.410"></a>
+<span class="sourceLineNo">411</span>            throw new java.util.NoSuchElementException();<a name="line.411"></a>
+<span class="sourceLineNo">412</span>        }<a name="line.412"></a>
+<span class="sourceLineNo">413</span>        unparseableExtra = null;<a name="line.413"></a>
+<span class="sourceLineNo">414</span>        setExtra();<a name="line.414"></a>
+<span class="sourceLineNo">415</span>    }<a name="line.415"></a>
+<span class="sourceLineNo">416</span><a name="line.416"></a>
+<span class="sourceLineNo">417</span>    /**<a name="line.417"></a>
+<span class="sourceLineNo">418</span>     * Looks up an extra field by its header id.<a name="line.418"></a>
+<span class="sourceLineNo">419</span>     *<a name="line.419"></a>
+<span class="sourceLineNo">420</span>     * @return null if no such field exists.<a name="line.420"></a>
+<span class="sourceLineNo">421</span>     */<a name="line.421"></a>
+<span class="sourceLineNo">422</span>    public ZipExtraField getExtraField(ZipShort type) {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>        if (extraFields != null) {<a name="line.423"></a>
+<span class="sourceLineNo">424</span>            return extraFields.get(type);<a name="line.424"></a>
+<span class="sourceLineNo">425</span>        }<a name="line.425"></a>
+<span class="sourceLineNo">426</span>        return null;<a name="line.426"></a>
+<span class="sourceLineNo">427</span>    }<a name="line.427"></a>
+<span class="sourceLineNo">428</span><a name="line.428"></a>
+<span class="sourceLineNo">429</span>    /**<a name="line.429"></a>
+<span class="sourceLineNo">430</span>     * Looks up extra field data that couldn't be parsed correctly.<a name="line.430"></a>
+<span class="sourceLineNo">431</span>     *<a name="line.431"></a>
+<span class="sourceLineNo">432</span>     * @return null if no such field exists.<a name="line.432"></a>
+<span class="sourceLineNo">433</span>     *<a name="line.433"></a>
+<span class="sourceLineNo">434</span>     * @since 1.1<a name="line.434"></a>
+<span class="sourceLineNo">435</span>     */<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    public UnparseableExtraFieldData getUnparseableExtraFieldData() {<a name="line.436"></a>
+<span class="sourceLineNo">437</span>        return unparseableExtra;<a name="line.437"></a>
+<span class="sourceLineNo">438</span>    }<a name="line.438"></a>
+<span class="sourceLineNo">439</span><a name="line.439"></a>
+<span class="sourceLineNo">440</span>    /**<a name="line.440"></a>
+<span class="sourceLineNo">441</span>     * Parses the given bytes as extra field data and consumes any<a name="line.441"></a>
+<span class="sourceLineNo">442</span>     * unparseable data as an {@link UnparseableExtraFieldData}<a name="line.442"></a>
+<span class="sourceLineNo">443</span>     * instance.<a name="line.443"></a>
+<span class="sourceLineNo">444</span>     * @param extra an array of bytes to be parsed into extra fields<a name="line.444"></a>
+<span class="sourceLineNo">445</span>     * @throws RuntimeException if the bytes cannot be parsed<a name="line.445"></a>
+<span class="sourceLineNo">446</span>     * @throws RuntimeException on error<a name="line.446"></a>
+<span class="sourceLineNo">447</span>     */<a name="line.447"></a>
+<span class="sourceLineNo">448</span>    @Override<a name="line.448"></a>
+<span class="sourceLineNo">449</span>    public void setExtra(byte[] extra) throws RuntimeException {<a name="line.449"></a>
+<span class="sourceLineNo">450</span>        try {<a name="line.450"></a>
+<span class="sourceLineNo">451</span>            ZipExtraField[] local =<a name="line.451"></a>
+<span class="sourceLineNo">452</span>                ExtraFieldUtils.parse(extra, true,<a name="line.452"></a>
+<span class="sourceLineNo">453</span>                                      ExtraFieldUtils.UnparseableExtraField.READ);<a name="line.453"></a>
+<span class="sourceLineNo">454</span>            mergeExtraFields(local, true);<a name="line.454"></a>
+<span class="sourceLineNo">455</span>        } catch (ZipException e) {<a name="line.455"></a>
+<span class="sourceLineNo">456</span>            // actually this is not possible as of Commons Compress 1.1<a name="line.456"></a>
+<span class="sourceLineNo">457</span>            throw new RuntimeException("Error parsing extra fields for entry: "<a name="line.457"></a>
+<span class="sourceLineNo">458</span>                                       + getName() + " - " + e.getMessage(), e);<a name="line.458"></a>
+<span class="sourceLineNo">459</span>        }<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    }<a name="line.460"></a>
+<span class="sourceLineNo">461</span><a name="line.461"></a>
+<span class="sourceLineNo">462</span>    /**<a name="line.462"></a>
+<span class="sourceLineNo">463</span>     * Unfortunately {@link java.util.zip.ZipOutputStream<a name="line.463"></a>
+<span class="sourceLineNo">464</span>     * java.util.zip.ZipOutputStream} seems to access the extra data<a name="line.464"></a>
+<span class="sourceLineNo">465</span>     * directly, so overriding getExtra doesn't help - we need to<a name="line.465"></a>
+<span class="sourceLineNo">466</span>     * modify super's data directly.<a name="line.466"></a>
+<span class="sourceLineNo">467</span>     */<a name="line.467"></a>
+<span class="sourceLineNo">468</span>    protected void setExtra() {<a name="line.468"></a>
+<span class="sourceLineNo">469</span>        super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields(true)));<a name="line.469"></a>
+<span class="sourceLineNo">470</span>    }<a name="line.470"></a>
+<span class="sourceLineNo">471</span><a name="line.471"></a>
+<span class="sourceLineNo">472</span>    /**<a name="line.472"></a>
+<span class="sourceLineNo">473</span>     * Sets the central directory part of extra fields.<a name="line.473"></a>
+<span class="sourceLineNo">474</span>     */<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    public void setCentralDirectoryExtra(byte[] b) {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>        try {<a name="line.476"></a>
+<span class="sourceLineNo">477</span>            ZipExtraField[] central =<a name="line.477"></a>
+<span class="sourceLineNo">478</span>                ExtraFieldUtils.parse(b, false,<a name="line.478"></a>
+<span class="sourceLineNo">479</span>                                      ExtraFieldUtils.UnparseableExtraField.READ);<a name="line.479"></a>
+<span class="sourceLineNo">480</span>            mergeExtraFields(central, false);<a name="line.480"></a>
+<span class="sourceLineNo">481</span>        } catch (ZipException e) {<a name="line.481"></a>
+<span class="sourceLineNo">482</span>            throw new RuntimeException(e.getMessage(), e);<a name="line.482"></a>
+<span class="sourceLineNo">483</span>        }<a name="line.483"></a>
+<span class="sourceLineNo">484</span>    }<a name="line.484"></a>
+<span class="sourceLineNo">485</span><a name="line.485"></a>
+<span class="sourceLineNo">486</span>    /**<a name="line.486"></a>
+<span class="sourceLineNo">487</span>     * Retrieves the extra data for the local file data.<a name="line.487"></a>
+<span class="sourceLineNo">488</span>     * @return the extra data for local file<a name="line.488"></a>
+<span class="sourceLineNo">489</span>     */<a name="line.489"></a>
+<span class="sourceLineNo">490</span>    public byte[] getLocalFileDataExtra() {<a name="line.490"></a>
+<span class="sourceLineNo">491</span>        byte[] extra = getExtra();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>        return extra != null ? extra : EMPTY;<a name="line.492"></a>
+<span class="sourceLineNo">493</span>    }<a name="line.493"></a>
+<span class="sourceLineNo">494</span><a name="line.494"></a>
+<span class="sourceLineNo">495</span>    /**<a name="line.495"></a>
+<span class="sourceLineNo">496</span>     * Retrieves the extra data for the central directory.<a name="line.496"></a>
+<span class="sourceLineNo">497</span>     * @return the central directory extra data<a name="line.497"></a>
+<span class="sourceLineNo">498</span>     */<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    public byte[] getCentralDirectoryExtra() {<a name="line.499"></a>
+<span class="sourceLineNo">500</span>        return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields(true));<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    }<a name="line.501"></a>
+<span class="sourceLineNo">502</span><a name="line.502"></a>
+<span class="sourceLineNo">503</span>    /**<a name="line.503"></a>
+<span class="sourceLineNo">504</span>     * Get the name of the entry.<a name="line.504"></a>
+<span class="sourceLineNo">505</span>     * @return the entry name<a name="line.505"></a>
+<span class="sourceLineNo">506</span>     */<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    @Override<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    public String getName() {<a name="line.508"></a>
+<span class="sourceLineNo">509</span>        return name == null ? super.getName() : name;<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    }<a name="line.510"></a>
+<span class="sourceLineNo">511</span><a name="line.511"></a>
+<span class="sourceLineNo">512</span>    /**<a name="line.512"></a>
+<span class="sourceLineNo">513</span>     * Is this entry a directory?<a name="line.513"></a>
+<span class="sourceLineNo">514</span>     * @return true if the entry is a directory<a name="line.514"></a>
+<span class="sourceLineNo">515</span>     */<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    @Override<a name="line.516"></a>
+<span class="sourceLineNo">517</span>    public boolean isDirectory() {<a name="line.517"></a>
+<span class="sourceLineNo">518</span>        return getName().endsWith("/");<a name="line.518"></a>
+<span class="sourceLineNo">519</span>    }<a name="line.519"></a>
+<span class="sourceLineNo">520</span><a name="line.520"></a>
+<span class="sourceLineNo">521</span>    /**<a name="line.521"></a>
+<span class="sourceLineNo">522</span>     * Set the name of the entry.<a name="line.522"></a>
+<span class="sourceLineNo">523</span>     * @param name the name to use<a name="line.523"></a>
+<span class="sourceLineNo">524</span>     */<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    protected void setName(String name) {<a name="line.525"></a>
+<span class="sourceLineNo">526</span>        if (name != null &amp;&amp; getPlatform() == PLATFORM_FAT<a name="line.526"></a>
+<span class="sourceLineNo">527</span>            &amp;&amp; name.indexOf("/") == -1) {<a name="line.527"></a>
+<span class="sourceLineNo">528</span>            name = name.replace('\\', '/');<a name="line.528"></a>
+<span class="sourceLineNo">529</span>        }<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        this.name = name;<a name="line.530"></a>
+<span class="sourceLineNo">531</span>    }<a name="line.531"></a>
+<span class="sourceLineNo">532</span><a name="line.532"></a>
+<span class="sourceLineNo">533</span>    /**<a name="line.533"></a>
+<span class="sourceLineNo">534</span>     * Gets the uncompressed size of the entry data.<a name="line.534"></a>
+<span class="sourceLineNo">535</span>     * @return the entry size<a name="line.535"></a>
+<span class="sourceLineNo">536</span>     */<a name="line.536"></a>
+<span class="sourceLineNo">537</span>    @Override<a name="line.537"></a>
+<span class="sourceLineNo">538</span>    public long getSize() {<a name="line.538"></a>
+<span class="sourceLineNo">539</span>        return size;<a name="line.539"></a>
+<span class="sourceLineNo">540</span>    }<a name="line.540"></a>
+<span class="sourceLineNo">541</span><a name="line.541"></a>
+<span class="sourceLineNo">542</span>    /**<a name="line.542"></a>
+<span class="sourceLineNo">543</span>     * Sets the uncompressed size of the entry data.<a name="line.543"></a>
+<span class="sourceLineNo">544</span>     * @param size the uncompressed size in bytes<a name="line.544"></a>
+<span class="sourceLineNo">545</span>     * @exception IllegalArgumentException if the specified size is less<a name="line.545"></a>
+<span class="sourceLineNo">546</span>     *            than 0<a name="line.546"></a>
+<span class="sourceLineNo">547</span>     */<a name="line.547"></a>
+<span class="sourceLineNo">548</span>    @Override<a name="line.548"></a>
+<span class="sourceLineNo">549</span>    public void setSize(long size) {<a name="line.549"></a>
+<span class="sourceLineNo">550</span>        if (size &lt; 0) {<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            throw new IllegalArgumentException("invalid entry size");<a name="line.551"></a>
+<span class="sourceLineNo">552</span>        }<a name="line.552"></a>
+<span class="sourceLineNo">553</span>        this.size = size;<a name="line.553"></a>
+<span class="sourceLineNo">554</span>    }<a name="line.554"></a>
+<span class="sourceLineNo">555</span><a name="line.555"></a>
+<span class="sourceLineNo">556</span>    /**<a name="line.556"></a>
+<span class="sourceLineNo">557</span>     * Sets the name using the raw bytes and the string created from<a name="line.557"></a>
+<span class="sourceLineNo">558</span>     * it by guessing or using the configured encoding.<a name="line.558"></a>
+<span class="sourceLineNo">559</span>     * @param name the name to use created from the raw bytes using<a name="line.559"></a>
+<span class="sourceLineNo">560</span>     * the guessed or configured encoding<a name="line.560"></a>
+<span class="sourceLineNo">561</span>     * @param rawName the bytes originally read as name from the<a name="line.561"></a>
+<span class="sourceLineNo">562</span>     * archive<a name="line.562"></a>
+<span class="sourceLineNo">563</span>     * @since 1.2<a name="line.563"></a>
+<span class="sourceLineNo">564</span>     */<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    protected void setName(String name, byte[] rawName) {<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        setName(name);<a name="line.566"></a>
+<span class="sourceLineNo">567</span>        this.rawName = rawName;<a name="line.567"></a>
+<span class="sourceLineNo">568</span>    }<a name="line.568"></a>
+<span class="sourceLineNo">569</span><a name="line.569"></a>
+<span class="sourceLineNo">570</span>    /**<a name="line.570"></a>
+<span class="sourceLineNo">571</span>     * Returns the raw bytes that made up the name before it has been<a name="line.571"></a>
+<span class="sourceLineNo">572</span>     * converted using the configured or guessed encoding.<a name="line.572"></a>
+<span class="sourceLineNo">573</span>     *<a name="line.573"></a>
+<span class="sourceLineNo">574</span>     * &lt;p&gt;This method will return null if this instance has not been<a name="line.574"></a>
+<span class="sourceLineNo">575</span>     * read from an archive.&lt;/p&gt;<a name="line.575"></a>
+<span class="sourceLineNo">576</span>     *<a name="line.576"></a>
+<span class="sourceLineNo">577</span>     * @since 1.2<a name="line.577"></a>
+<span class="sourceLineNo">578</span>     */<a name="line.578"></a>
+<span class="sourceLineNo">579</span>    public byte[] getRawName() {<a name="line.579"></a>
+<span class="sourceLineNo">580</span>        if (rawName != null) {<a name="line.580"></a>
+<span class="sourceLineNo">581</span>            byte[] b = new byte[rawName.length];<a name="line.581"></a>
+<span class="sourceLineNo">582</span>            System.arraycopy(rawName, 0, b, 0, rawName.length);<a name="line.582"></a>
+<span class="sourceLineNo">583</span>            return b;<a name="line.583"></a>
+<span class="sourceLineNo">584</span>        }<a name="line.584"></a>
+<span class="sourceLineNo">585</span>        return null;<a name="line.585"></a>
+<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
+<span class="sourceLineNo">587</span><a name="line.587"></a>
+<span class="sourceLineNo">588</span>    /**<a name="line.588"></a>
+<span class="sourceLineNo">589</span>     * Get the hashCode of the entry.<a name="line.589"></a>
+<span class="sourceLineNo">590</span>     * This uses the name as the hashcode.<a name="line.590"></a>
+<span class="sourceLineNo">591</span>     * @return a hashcode.<a name="line.591"></a>
+<span class="sourceLineNo">592</span>     */<a name="line.592"></a>
+<span class="sourceLineNo">593</span>    @Override<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    public int hashCode() {<a name="line.594"></a>
+<span class="sourceLineNo">595</span>        // this method has severe consequences on performance. We cannot rely<a name="line.595"></a>
+<span class="sourceLineNo">596</span>        // on the super.hashCode() method since super.getName() always return<a name="line.596"></a>
+<span class="sourceLineNo">597</span>        // the empty string in the current implemention (there's no setter)<a name="line.597"></a>
+<span class="sourceLineNo">598</span>        // so it is basically draining the performance of a hashmap lookup<a name="line.598"></a>
+<span class="sourceLineNo">599</span>        return getName().hashCode();<a name="line.599"></a>
+<span class="sourceLineNo">600</span>    }<a name="line.600"></a>
+<span class="sourceLineNo">601</span><a name="line.601"></a>
+<span class="sourceLineNo">602</span>    /**<a name="line.602"></a>
+<span class="sourceLineNo">603</span>     * The "general purpose bit" field.<a name="line.603"></a>
+<span class="sourceLineNo">604</span>     * @since 1.1<a name="line.604"></a>
+<span class="sourceLineNo">605</span>     */<a name="line.605"></a>
+<span class="sourceLineNo">606</span>    public GeneralPurposeBit getGeneralPurposeBit() {<a name="line.606"></a>
+<span class="sourceLineNo">607</span>        return gpb;<a name="line.607"></a>
+<span class="sourceLineNo">608</span>    }<a name="line.608"></a>
+<span class="sourceLineNo">609</span><a name="line.609"></a>
+<span class="sourceLineNo">610</span>    /**<a name="line.610"></a>
+<span class="sourceLineNo">611</span>     * The "general purpose bit" field.<a name="line.611"></a>
+<span class="sourceLineNo">612</span>     * @since 1.1<a name="line.612"></a>
+<span class="sourceLineNo">613</span>     */<a name="line.613"></a>
+<span class="sourceLineNo">614</span>    public void setGeneralPurposeBit(GeneralPurposeBit b) {<a name="line.614"></a>
+<span class="sourceLineNo">615</span>        gpb = b;<a name="line.615"></a>
+<span class="sourceLineNo">616</span>    }<a name="line.616"></a>
+<span class="sourceLineNo">617</span><a name="line.617"></a>
+<span class="sourceLineNo">618</span>    /**<a name="line.618"></a>
+<span class="sourceLineNo">619</span>     * If there are no extra fields, use the given fields as new extra<a name="line.619"></a>
+<span class="sourceLineNo">620</span>     * data - otherwise merge the fields assuming the existing fields<a name="line.620"></a>
+<span class="sourceLineNo">621</span>     * and the new fields stem from different locations inside the<a name="line.621"></a>
+<span class="sourceLineNo">622</span>     * archive.<a name="line.622"></a>
+<span class="sourceLineNo">623</span>     * @param f the extra fields to merge<a name="line.623"></a>
+<span class="sourceLineNo">624</span>     * @param local whether the new fields originate from local data<a name="line.624"></a>
+<span class="sourceLineNo">625</span>     */<a name="line.625"></a>
+<span class="sourceLineNo">626</span>    private void mergeExtraFields(ZipExtraField[] f, boolean local)<a name="line.626"></a>
+<span class="sourceLineNo">627</span>        throws ZipException {<a name="line.627"></a>
+<span class="sourceLineNo">628</span>        if (extraFields == null) {<a name="line.628"></a>
+<span class="sourceLineNo">629</span>            setExtraFields(f);<a name="line.629"></a>
+<span class="sourceLineNo">630</span>        } else {<a name="line.630"></a>
+<span class="sourceLineNo">631</span>            for (ZipExtraField element : f) {<a name="line.631"></a>
+<span class="sourceLineNo">632</span>                ZipExtraField existing;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>                if (element instanceof UnparseableExtraFieldData) {<a name="line.633"></a>
+<span class="sourceLineNo">634</span>                    existing = unparseableExtra;<a name="line.634"></a>
+<span class="sourceLineNo">635</span>                } else {<a name="line.635"></a>
+<span class="sourceLineNo">636</span>                    existing = getExtraField(element.getHeaderId());<a name="line.636"></a>
+<span class="sourceLineNo">637</span>                }<a name="line.637"></a>
+<span class="sourceLineNo">638</span>                if (existing == null) {<a name="line.638"></a>
+<span class="sourceLineNo">639</span>                    addExtraField(element);<a name="line.639"></a>
+<span class="sourceLineNo">640</span>                } else {<a name="line.640"></a>
+<span class="sourceLineNo">641</span>                    if (local) {<a name="line.641"></a>
+<span class="sourceLineNo">642</span>                        byte[] b = element.getLocalFileDataData();<a name="line.642"></a>
+<span class="sourceLineNo">643</span>                        existing.parseFromLocalFileData(b, 0, b.length);<a name="line.643"></a>
+<span class="sourceLineNo">644</span>                    } else {<a name="line.644"></a>
+<span class="sourceLineNo">645</span>                        byte[] b = element.getCentralDirectoryData();<a name="line.645"></a>
+<span class="sourceLineNo">646</span>                        existing.parseFromCentralDirectoryData(b, 0, b.length);<a name="line.646"></a>
+<span class="sourceLineNo">647</span>                    }<a name="line.647"></a>
+<span class="sourceLineNo">648</span>                }<a name="line.648"></a>
+<span class="sourceLineNo">649</span>            }<a name="line.649"></a>
+<span class="sourceLineNo">650</span>            setExtra();<a name="line.650"></a>
+<span class="sourceLineNo">651</span>        }<a name="line.651"></a>
+<span class="sourceLineNo">652</span>    }<a name="line.652"></a>
+<span class="sourceLineNo">653</span><a name="line.653"></a>
+<span class="sourceLineNo">654</span>    /** {@inheritDoc} */<a name="line.654"></a>
+<span class="sourceLineNo">655</span>    public Date getLastModifiedDate() {<a name="line.655"></a>
+<span class="sourceLineNo">656</span>        return new Date(getTime());<a name="line.656"></a>
+<span class="sourceLineNo">657</span>    }<a name="line.657"></a>
+<span class="sourceLineNo">658</span><a name="line.658"></a>
+<span class="sourceLineNo">659</span>    /* (non-Javadoc)<a name="line.659"></a>
+<span class="sourceLineNo">660</span>     * @see java.lang.Object#equals(java.lang.Object)<a name="line.660"></a>
+<span class="sourceLineNo">661</span>     */<a name="line.661"></a>
+<span class="sourceLineNo">662</span>    @Override<a name="line.662"></a>
+<span class="sourceLineNo">663</span>    public boolean equals(Object obj) {<a name="line.663"></a>
+<span class="sourceLineNo">664</span>        if (this == obj) {<a name="line.664"></a>
+<span class="sourceLineNo">665</span>            return true;<a name="line.665"></a>
+<span class="sourceLineNo">666</span>        }<a name="line.666"></a>
+<span class="sourceLineNo">667</span>        if (obj == null || getClass() != obj.getClass()) {<a name="line.667"></a>
+<span class="sourceLineNo">668</span>            return false;<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        }<a name="line.669"></a>
+<span class="sourceLineNo">670</span>        ZipArchiveEntry other = (ZipArchiveEntry) obj;<a name="line.670"></a>
+<span class="sourceLineNo">671</span>        String myName = getName();<a name="line.671"></a>
+<span class="sourceLineNo">672</span>        String otherName = other.getName();<a name="line.672"></a>
+<span class="sourceLineNo">673</span>        if (myName == null) {<a name="line.673"></a>
+<span class="sourceLineNo">674</span>            if (otherName != null) {<a name="line.674"></a>
+<span class="sourceLineNo">675</span>                return false;<a name="line.675"></a>
+<span class="sourceLineNo">676</span>            }<a name="line.676"></a>
+<span class="sourceLineNo">677</span>        } else if (!myName.equals(otherName)) {<a name="line.677"></a>
+<span class="sourceLineNo">678</span>            return false;<a name="line.678"></a>
+<span class="sourceLineNo">679</span>        }<a name="line.679"></a>
+<span class="sourceLineNo">680</span>        String myComment = getComment();<a name="line.680"></a>
+<span class="sourceLineNo">681</span>        String otherComment = other.getComment();<a name="line.681"></a>
+<span class="sourceLineNo">682</span>        if (myComment == null) {<a name="line.682"></a>
+<span class="sourceLineNo">683</span>            myComment = "";<a name="line.683"></a>
+<span class="sourceLineNo">684</span>        }<a name="line.684"></a>
+<span class="sourceLineNo">685</span>        if (otherComment == null) {<a name="line.685"></a>
+<span class="sourceLineNo">686</span>            otherComment = "";<a name="line.686"></a>
+<span class="sourceLineNo">687</span>        }<a name="line.687"></a>
+<span class="sourceLineNo">688</span>        return getTime() == other.getTime()<a name="line.688"></a>
+<span class="sourceLineNo">689</span>            &amp;&amp; myComment.equals(otherComment)<a name="line.689"></a>
+<span class="sourceLineNo">690</span>            &amp;&amp; getInternalAttributes() == other.getInternalAttributes()<a name="line.690"></a>
+<span class="sourceLineNo">691</span>            &amp;&amp; getPlatform() == other.getPlatform()<a name="line.691"></a>
+<span class="sourceLineNo">692</span>            &amp;&amp; getExternalAttributes() == other.getExternalAttributes()<a name="line.692"></a>
+<span class="sourceLineNo">693</span>            &amp;&amp; getMethod() == other.getMethod()<a name="line.693"></a>
+<span class="sourceLineNo">694</span>            &amp;&amp; getSize() == other.getSize()<a name="line.694"></a>
+<span class="sourceLineNo">695</span>            &amp;&amp; getCrc() == other.getCrc()<a name="line.695"></a>
+<span class="sourceLineNo">696</span>            &amp;&amp; getCompressedSize() == other.getCompressedSize()<a name="line.696"></a>
+<span class="sourceLineNo">697</span>            &amp;&amp; Arrays.equals(getCentralDirectoryExtra(),<a name="line.697"></a>
+<span class="sourceLineNo">698</span>                             other.getCentralDirectoryExtra())<a name="line.698"></a>
+<span class="sourceLineNo">699</span>            &amp;&amp; Arrays.equals(getLocalFileDataExtra(),<a name="line.699"></a>
+<span class="sourceLineNo">700</span>                             other.getLocalFileDataExtra())<a name="line.700"></a>
+<span class="sourceLineNo">701</span>            &amp;&amp; gpb.equals(other.gpb);<a name="line.701"></a>
+<span class="sourceLineNo">702</span>    }<a name="line.702"></a>
+<span class="sourceLineNo">703</span>}<a name="line.703"></a>
 
 
 



Mime
View raw message