From 71ca13651934e519ee881f77b29fc498eb195914 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Tue, 14 Feb 2006 15:11:10 +0000 Subject: [PATCH] Fixed WebDAV missing content handling git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2374 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../filesys/smb/server/repo/ContentNetworkFile.java | 2 +- .../repo/content/filestore/FileContentReader.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/filesys/smb/server/repo/ContentNetworkFile.java b/source/java/org/alfresco/filesys/smb/server/repo/ContentNetworkFile.java index c5dd6c3783..86c17659e3 100644 --- a/source/java/org/alfresco/filesys/smb/server/repo/ContentNetworkFile.java +++ b/source/java/org/alfresco/filesys/smb/server/repo/ContentNetworkFile.java @@ -300,7 +300,7 @@ public class ContentNetworkFile extends NetworkFile // ensure that the content we are going to read is valid content = FileContentReader.getSafeContentReader( (ContentReader) content, - I18NUtil.getMessage("content.content_missing"), + I18NUtil.getMessage(FileContentReader.MSG_MISSING_CONTENT), nodeRef, content); // Indicate that we only have a read-only channel to the data diff --git a/source/java/org/alfresco/repo/content/filestore/FileContentReader.java b/source/java/org/alfresco/repo/content/filestore/FileContentReader.java index 02d60f4242..a1318b64b4 100644 --- a/source/java/org/alfresco/repo/content/filestore/FileContentReader.java +++ b/source/java/org/alfresco/repo/content/filestore/FileContentReader.java @@ -43,6 +43,15 @@ import org.apache.commons.logging.LogFactory; */ public class FileContentReader extends AbstractContentReader { + /** + * message key for missing content. Parameters are + * + */ + public static final String MSG_MISSING_CONTENT = "content.content_missing"; + private static final Log logger = LogFactory.getLog(FileContentReader.class); private File file; @@ -56,7 +65,7 @@ public class FileContentReader extends AbstractContentReader * It is a convenience method that clients can use to cheaply get a reader that * is valid, regardless of whether the initial reader is valid. * - * @param existingReader a potentially valid reader + * @param existingReader a potentially invalid reader or null * @param msgTemplate the template message that will used to format the final fake content * @param args arguments to put into the fake content * @return Returns a the existing reader or a new reader onto some generated text content