[rfc][icedtea-web] Allow cache directory to be changed during runtime

Jiri Vanek jvanek at redhat.com
Wed Jan 21 10:00:28 UTC 2015


On 01/15/2015 07:16 PM, Andrew Azores wrote:
> On 01/05/2015 02:49 PM, Jie Kang wrote:
>> Hello,
>>
>> This patch consolidates the cacheDir instance to a single place and allows us to change it during
>> run-time. It also modifies a unit test to use this new feature. This feature is aimed mainly at
>> unit tests that need the cache, but do not want to modify the icedtea-web's user cache.
>>
>> Thoughts? Okay to push?

I'm wondering why it is needed at all.

JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); is the place 
where you can set the dir.


For unittest you may force refelction to do the job. if the chnage of the property isnot enough.


What I would rather see is, to get rid of all the static stuff in CacheLRUWrapper and have 
possibility to create in instance.
This instance will be also much more testable. But maybe it is overkill.

J.
>>
>>
>> Regards,
>>
>
> I think this looks generally ok. Maybe as a separate enhancement changeset, but since you're working
> in here anyway, could you look at doing some refactoring to store the cache directory as something
> better than a String? As a File, or using Java 7's nio2 stuff, a Path maybe?

On one side - yes, on the other - why? What operations are mainly done on the "string" string ops or 
file ops - I have not checked code, but seems like concate is most often :)

But yes - it is directory, so file or path is probably better then string.
Please, do this refactoring as separate changset anyway.

J.


More information about the distro-pkg-dev mailing list