Skip to content

Commit

Permalink
Integrata correzione "Fix a bug in file times and expose the headers"
Browse files Browse the repository at this point in the history
  • Loading branch information
albertus82 committed Jan 28, 2016
1 parent d349dfe commit 8709dcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions 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
1 change: 1 addition & 0 deletions src/main/java/com/github/junrar/rarfile/FileHeader.java
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

0 comments on commit 8709dcd

Please sign in to comment.