• Post Reply Bookmark Topic Watch Topic
  • New Topic

File lock for Zip files in Java  RSS feed

 
Rajalakshmi Balasubramanian
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an application the following takes place.
1) On one side data is getting written to the output file which is in zip file format.
2) On the other hand simultaneously data will be read [i.e edited] from the same zip file.
There are certain API�s in java to control the simultaneous access [i.e Read and write problem] for a flat file.
Like wise is there any kind of exclusive file access control mechanism to handle the simultaneous access of the zip file (i.e which is getting written with data) from being read when the edit command is issued.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what these "certain APIs" are, but have you tried them out in this situation? It seems like they would work since it either involves File, InputStream, OutputStream, Writer, or Reader. Depending on where these "certain APIs" are located in the hierarchy, you may be able to use them unchanged.

Layne
 
Rajalakshmi Balasubramanian
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.nio.channels.FileLock - This api was used for setting the lock for the flat file but it doesn't work with the zip files.Could you please let me know if there are any such APIs available for working with Zip files?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!