Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 40694 invoked from network); 23 Jun 2006 04:26:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jun 2006 04:26:32 -0000 Received: (qmail 75617 invoked by uid 500); 23 Jun 2006 04:26:32 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 75569 invoked by uid 500); 23 Jun 2006 04:26:32 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 75558 invoked by uid 99); 23 Jun 2006 04:26:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 21:26:32 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 21:26:31 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 62F1C1A983A; Thu, 22 Jun 2006 21:26:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r416560 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Date: Fri, 23 Jun 2006 04:26:10 -0000 To: cvs@cocoon.apache.org From: antonio@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060623042611.62F1C1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: antonio Date: Thu Jun 22 21:26:09 2006 New Revision: 416560 URL: http://svn.apache.org/viewvc?rev=416560&view=rev Log: Cleanup. Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?rev=416560&r1=416559&r2=416560&view=diff ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Thu Jun 22 21:26:09 2006 @@ -177,8 +177,7 @@ this.diskPersistent = parameters.getParameterAsBoolean("disk-persistent", true); this.eternal = parameters.getParameterAsBoolean("eternal", true); - if (!this.eternal) - { + if (!this.eternal) { this.timeToLiveSeconds = parameters.getParameterAsLong("timeToLiveSeconds", 0L); this.timeToIdleSeconds = parameters.getParameterAsLong("timeToIdleSeconds", 0L); } @@ -189,26 +188,24 @@ getLogger().debug("Using cache directory: " + cacheDir); } setDirectory(cacheDir); - } - else if (parameters.getParameterAsBoolean("use-work-directory", false)) { + } else if (parameters.getParameterAsBoolean("use-work-directory", false)) { if (this.getLogger().isDebugEnabled()) { getLogger().debug("Using work directory: " + workDir); } setDirectory(workDir); - } - else if (parameters.getParameter("directory", null) != null) { + } else if (parameters.getParameter("directory", null) != null) { String dir = parameters.getParameter("directory"); dir = IOUtils.getContextFilePath(workDir.getPath(), dir); if (this.getLogger().isDebugEnabled()) { getLogger().debug("Using directory: " + dir); } setDirectory(new File(dir)); - } - else { + } else { try { // Legacy: use working directory by default setDirectory(workDir); } catch (IOException e) { + // Empty } } } catch (IOException e) { @@ -242,7 +239,6 @@ if (!(directory.canRead() && directory.canWrite())) { throw new IOException("Directory '" + directoryPath + "' is not readable/writable"); } - System.setProperty("java.io.tmpdir", directoryPath); } @@ -259,8 +255,7 @@ private static String getFullFilename(File file) { try { return file.getCanonicalPath(); - } - catch (Exception e) { + } catch (Exception e) { return file.getAbsolutePath(); } } @@ -327,15 +322,13 @@ if (element != null) { value = element.getValue(); } - } - catch (CacheException e) { + } catch (CacheException e) { getLogger().error("Failure retrieving object from store", e); } if (getLogger().isDebugEnabled()) { if (value != null) { getLogger().debug("Found key: " + key); - } - else { + } else { getLogger().debug("NOT Found key: " + key); } } @@ -351,10 +344,10 @@ } // without these checks we get cryptic "ClassCastException" messages - if(!(key instanceof Serializable)) { + if (!(key instanceof Serializable)) { throw new IOException("Key of class " + key.getClass().getName() + " is not Serializable"); } - if(!(value instanceof Serializable)) { + if (!(value instanceof Serializable)) { throw new IOException("Value of class " + value.getClass().getName() + " is not Serializable"); } @@ -382,8 +375,7 @@ } } } - } - catch (CacheException e) { + } catch (CacheException e) { if (getLogger().isWarnEnabled()) { getLogger().warn("Error in free()", e); } @@ -409,8 +401,7 @@ } try { this.cache.removeAll(); - } - catch (IOException e) { + } catch (IOException e) { getLogger().error("Failure to clearing store", e); } } @@ -421,8 +412,7 @@ public boolean containsKey(Object key) { try { return this.cache.get((Serializable) key) != null; - } - catch (CacheException e) { + } catch (CacheException e) { getLogger().error("Failure retrieving object from store",e); } return false; @@ -435,8 +425,7 @@ List keys = null; try { keys = this.cache.getKeys(); - } - catch (CacheException e) { + } catch (CacheException e) { if (getLogger().isWarnEnabled()) { getLogger().warn("Error while getting cache keys", e); } @@ -451,8 +440,7 @@ public int size() { try { return this.cache.getSize(); - } - catch (CacheException e) { + } catch (CacheException e) { if (getLogger().isWarnEnabled()) { getLogger().warn("Error while getting cache size", e); }