This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read timestamp of a file present inside a ZIP/JAR/WAR file in java?  RSS feed

 
Yogesh Gandhi
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a ZIP file, which has multiple files...

I want to know, the timestamp of a particular file present inside the ZIP file.

One way is, I have to iterate over all the present files that are present in the ZIP file and then I can get..

Is there any other better way to do that..??

One way is given at

http://www.thecoderscorner.com/team-blog/java-and-jvm/12-reading-a-zip-file-from-java-using-zipinputstream

Any better and efficient method... because I might neeed to read 50 files.
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out ZipFile.
 
Santosh Kumar Nayak
Ranch Hand
Posts: 193
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an efficient way to read time stamp of file in tar File format.

For example : Tar file has multiple files in it and I want to read the last modified timestamp for a file.
 
vijay kumar nara
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only option I see is to iterate through the TarEntries and get the modified time stamp of the entry.
 
Campbell Ritchie
Marshal
Posts: 55672
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!