Skip to content

retaining ScanResult for lifetime of application #667

Answered by lukehutch
jechlin asked this question in Q&A
Discussion options

You must be logged in to vote

@jechlin great, I'm glad you have been getting some good usage out of ClassGraph!

To answer your general question:

You can keep a ScanResult open as long as you want to, including for the whole lifetime of a program, as long as you don't mind keeping some resources open. This will typically include only file handles, but under some circumstances (or on some platforms), this may also include some memory-mapped files (memory mapping can be disabled). The reason for keeping files open is that the user might request the content of some resource from the ScanResult, and it would be inefficient to have to re-open jarfiles (potentially including jars-within-jars) to access each resource requeste…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jechlin
Comment options

@lukehutch
Comment options

@jechlin-adaptavist
Comment options

Answer selected by jechlin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants