"jaikiran" wrote : A bit more on a higher level - Assuming we have a
ZipEntryContext/Handler, does it know of the entries within that zip? I see a
ZipEntryContext.entries Map in the code, but haven't yet figured out whether looking
directly into this would indicate the presence/absence of a resource within the zip.
|
| So if a getChild(String path) is invoked, maybe looking into this "entries"
would tell us whether it's present or not?
|
Yes, ZipEntryContext.entries contains relative path of the entry within a zip as the key
and EntryInfo representing the entry as the value.
It reflects the state of a zip archive in a specific point in time.
Since entries is initialized in a lazy manner you need to make sure it was initialized
first - before relying on direct entries.get(path).
ensureEntries() is the method that does that and it is called from checkIfModified().
But you can call ensureEntries() directly of course - without going through
checkIfModified().
There is initStatus field you can use to check that entries have been initialized:
| if (initStatus == InitializationStatus.INITIALIZED) {
| EntryInfo entry = entries.get(path);
| }
|
But again, if you want to detect changes in the underlying zip file, you have to call
checkIfModified which does the reinit of entries for you if it detects a change.
- marko
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251468#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...