diff --git a/src/main/org/apache/tools/zip/ZipFile.java b/src/main/org/apache/tools/zip/ZipFile.java
index b764f13d0..dfc6d8a73 100644
--- a/src/main/org/apache/tools/zip/ZipFile.java
+++ b/src/main/org/apache/tools/zip/ZipFile.java
@@ -86,8 +86,6 @@ import java.util.zip.ZipException;
* java.util.zip.ZipFile, with a couple of exceptions:
*
*
null if no entry by
* that name exists.
+ * @param name name of the entry.
+ * @return the ZipEntry corresponding to the given name - or
+ * null if not present.
*/
public ZipEntry getEntry(String name) {
return (ZipEntry) nameMap.get(name);
@@ -201,6 +220,8 @@ public class ZipFile {
/**
* Returns an InputStream for reading the contents of the given entry.
+ * @param the entry to get the stream for.
+ * @return a stream to read the entry from.
*/
public InputStream getInputStream(ZipEntry ze)
throws IOException, ZipException {
@@ -242,14 +263,14 @@ public class ZipFile {
/**
* Reads the central directory of the given archive and populates
- * the interal tables with ZipEntry instances.
+ * the internal tables with ZipEntry instances.
*
* The ZipEntrys will know all data that can be obtained from * the central directory alone, but not the data that requires the - * local file header or additional data to be read.
+ * local file header or additional data to be read. */ private void populateFromCentralDirectory() - throws IOException, ZipException { + throws IOException { positionAtCentralDirectory(); byte[] cfh = new byte[CFH_LEN]; @@ -266,17 +287,17 @@ public class ZipFile { off += 2; ze.setPlatform((versionMadeBy.getValue() >> 8) & 0x0F); - off += 4;// skip version info and general purpose byte + off += 4; // skip version info and general purpose byte ze.setMethod((new ZipShort(cfh, off)).getValue()); off += 2; - + ze.setTime(fromDosTime(new ZipLong(cfh, off)).getTime()); off += 4; - + ze.setCrc((new ZipLong(cfh, off)).getValue()); off += 4; - + ze.setCompressedSize((new ZipLong(cfh, off)).getValue()); off += 4; @@ -352,7 +373,7 @@ public class ZipFile { * record. */ private void positionAtCentralDirectory() - throws IOException, ZipException { + throws IOException { long off = archive.length() - MIN_EOCD_SIZE; archive.seek(off); byte[] sig = ZipOutputStream.EOCD_SIG.getBytes(); @@ -430,6 +451,9 @@ public class ZipFile { /** * Convert a DOS date/time field to a Date object. + * + * @param l contains the stored DOS time. + * @return a Date instance corresponding to the given time. */ protected static Date fromDosTime(ZipLong l) { long dosTime = l.getValue(); @@ -446,6 +470,10 @@ public class ZipFile { /** * Retrieve a String from the given bytes using the encoding set * for this ZipFile. + * + * @param bytes the byte array to transform + * @return String obtained by using the given encoding + * @throws ZipException if the encoding cannot be recognized. */ protected String getString(byte[] bytes) throws ZipException { if (encoding == null) { @@ -502,7 +530,7 @@ public class ZipFile { if (len <= 0) { return 0; } - + if (len > remaining) { len = (int) remaining; }