diff --git a/src/main/java/com/github/junrar/Archive.java b/src/main/java/com/github/junrar/Archive.java index 23ca39bda..49657bf2f 100644 --- a/src/main/java/com/github/junrar/Archive.java +++ b/src/main/java/com/github/junrar/Archive.java @@ -167,6 +167,15 @@ public IReadOnlyAccess getRof() { return rof; } + /** + * Gets all of the headers in the archive. + * + * @return returns the headers. + */ + public List getHeaders() { + return new ArrayList(headers); + } + /** * @return returns all file headers of the archive */ @@ -429,7 +438,7 @@ private void readHeaders(long fileLength) throws IOException, RarException { * Extract the file specified by the given header and write it to the * supplied output stream * - * @param header + * @param hd * the header to be extracted * @param os * the outputstream @@ -455,7 +464,7 @@ public void extractFile(FileHeader hd, OutputStream os) throws RarException { * stream it. Please note that this method will create a new Thread and an a * pair of Pipe streams. * - * @param header + * @param hd * the header to be extracted * @throws RarException * @throws IOException diff --git a/src/main/java/com/github/junrar/rarfile/FileHeader.java b/src/main/java/com/github/junrar/rarfile/FileHeader.java index a7adef9bc..fcaab27e4 100644 --- a/src/main/java/com/github/junrar/rarfile/FileHeader.java +++ b/src/main/java/com/github/junrar/rarfile/FileHeader.java @@ -230,6 +230,7 @@ private Date getDateDos(int time) { cal.set(Calendar.HOUR_OF_DAY, (time >>> 11) & 0x1f); cal.set(Calendar.MINUTE, (time >>> 5) & 0x3f); cal.set(Calendar.SECOND, (time & 0x1f) * 2); + cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); }