files size for files inside the JAR file
Hey all!
first off I apologize if i might have posted this in the wrong category of the forum, I was a little unsure if to post it here or in the File I/O part.
anyways on to my problem:
I have a program with some files packed with it (they are contained inside the JAR file when compiled) and i need to be able to grab their filesize and the best way to do that would be to use the File class but I cant seem to get the path to the files correct since they are "baked" into the JAR file. Is there another smarter way to get filesize of a file then the File class with the method file.length(); when files are meant to be "baked" into the JAR file?
not asking to fix my code per say (thats why im posting in general) since I want to know for later if I make other programs and run into the same issue again :P
//your sincerely Natherul
Re: files size for files inside the JAR file
getSize()/getCompressedSize() provide two metrics for the size of a zip entry. (jar files are a sort of zip file, and are made up of a number of entries which when unzipped become files)
Re: files size for files inside the JAR file
thank you, I will try them out tomorrow as its late now :P any chance of a really small example on how to use them properly? :P
Re: files size for files inside the JAR file
There is an example at java2s.com.