From: <fa...@vh...> - 2005-09-12 15:01:00
|
Author: fabrice Date: 2005-09-12 16:52:01 +0200 (Mon, 12 Sep 2005) New Revision: 770 Modified: ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/PublishedFile.java ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java Log: Fix to optionally turn off p2fs for items Modified: ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/PublishedFile.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/PublishedFile.java 2005-09-12 14:51:00 UTC (rev 769) +++ ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/PublishedFile.java 2005-09-12 14:52:01 UTC (rev 770) @@ -90,6 +90,12 @@ // file. File getFile() { DestinationStub dest = PublishToFile.getDestination(getItemType()); + + // fix when turning off p2fs for items + if (dest == null) { + return null; + } + File f = new File(dest.getFile(), getFileName()); if (s_log.isDebugEnabled()) { Modified: ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java 2005-09-12 14:51:00 UTC (rev 769) +++ ccm-cms/trunk/src/com/arsdigita/cms/publishToFile/QueueManager.java 2005-09-12 14:52:01 UTC (rev 770) @@ -167,11 +167,17 @@ done.add(fileRecord.getFileName()); File file = fileRecord.getFile(); - if (file.exists()) { + + if (file == null) { + // fix when turning off p2fs for items + s_log.debug("Ignoring null file."); + + } else if (file.exists()) { if (s_log.isDebugEnabled()) { s_log.debug( "File " + file.getAbsolutePath() + " already exists"); } + } else { if (s_log.isInfoEnabled()) { s_log.info("Published file " + file.getAbsolutePath() + |