• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot view manifest property in jar, then rename that jar, it is locked  RSS feed

 
Chris Hyzer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I an writing an upgrader, and I would like to look at a jar in java, and look at the manifest inside, and see what version it is, and if it is not correct, rename it to a temp dir and replace it with another jar. but when I look in the jar, it is locked by the java process that is looking at it, and cannot be renamed. See this code, it throws an exception that it cannot be renamed... I need to read a manifest then rename a jar, how can i do it? Thanks, chris

Here is a sample java program which throws an exception:



 
Chris Hyzer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works with JarInputStream

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!