[RFC][Icedtea-Web]: Enforce cache size limit.
Andrew Su
asu at redhat.com
Wed Apr 20 07:25:15 PDT 2011
----- Original Message -----
> From: "Deepak Bhole" <dbhole at redhat.com>
> To: "Andrew Su" <asu at redhat.com>
> Cc: "IcedTea" <distro-pkg-dev at openjdk.java.net>
> Sent: Tuesday, April 19, 2011 6:29:01 PM
> Subject: Re: [RFC][Icedtea-Web]: Enforce cache size limit.
> * Andrew Su <asu at redhat.com> [2011-04-19 17:30]:
> >
> >
> > ----- Original Message -----
> <snip>
> > + } catch (IOException e1) {
> > + e1.printStackTrace();
>
>
> Why e1 and not e?
e is being used for iterating through the entries already.
I've attached an updated patch with some changes discussed on irc with Denis.
>
> Rest looks fine to me. Okay from me after above e1 -> e change.
>
> Cheers,
> Deepak
>
> > + }
> > + }
> > + }
> > }
> > } else {
> > lruHandler.removeEntry(key);
> > @@ -560,20 +600,26 @@
> > }
> > lruHandler.store();
> >
> > - removeUntrackedDirectories(keep);
> > + /*
> > + * FIXME: if cacheDir is for example $USER_HOME and they have a
> > folder called http
> > + * and/or https. These would get removed.
> > + */
> > + remove.add(cacheDir + File.separator + "http");
> > + remove.add(cacheDir + File.separator + "https");
> > +
> > + remove.removeAll(keep);
> > +
> > + removeSetOfDirectories(remove);
> > +
> > }
> > }
> >
> > - private static void removeUntrackedDirectories(Set<String> keep) {
> > - File temp = new File(cacheDir);
> > - // Remove all folder not listed in keep.
> > - for (File f : temp.listFiles()) {
> > - if (f.isDirectory() && !keep.contains(f.getPath())) {
> > - try {
> > - FileUtils.recursiveDelete(f, f);
> > - } catch (IOException e) {
> > - e.printStackTrace();
> > - }
> > + private static void removeSetOfDirectories(Set<String> remove) {
> > + for (String s : remove) {
> > + File f = new File(s);
> > + try {
> > + FileUtils.recursiveDelete(f, f);
> > + } catch (IOException e) {
> > }
> > }
> > }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.patch
Type: text/x-patch
Size: 5455 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110420/7f698bc4/p.patch
More information about the distro-pkg-dev
mailing list