Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Fix a bug in file times and expose the headers #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions unrar/src/main/java/com/github/junrar/Archive.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ public IReadOnlyAccess getRof() {
return rof;
}

/**
* Gets all of the headers in the archive.
*
* @return returns the headers.
*/
public List<BaseBlock> getHeaders() {
return new ArrayList<BaseBlock>(headers);
}

/**
* @return returns all file headers of the archive
*/
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down