public class ContentStreamer extends Object implements org.springframework.context.ResourceLoaderAware
| Modifier and Type | Field and Description |
|---|---|
protected org.alfresco.service.cmr.repository.ContentService |
contentService |
protected org.alfresco.repo.events.EventPublisher |
eventPublisher |
static String |
KEY_ALLOW_BROWSER_TO_CACHE |
static String |
KEY_CACHE_DIRECTIVE |
protected org.alfresco.service.cmr.repository.MimetypeService |
mimetypeService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService
Services
|
protected org.springframework.core.io.ResourceLoader |
resourceLoader |
protected org.alfresco.service.cmr.site.SiteService |
siteService |
| Constructor and Description |
|---|
ContentStreamer() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
filterNameForQuotedString(String s) |
protected boolean |
isValidQuotedStringHeaderParamChar(char c) |
void |
setAttachment(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
boolean attach,
String attachFileName)
Set attachment header
|
void |
setContentService(org.alfresco.service.cmr.repository.ContentService contentService) |
void |
setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher) |
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
protected void |
setResponseCache(org.springframework.extensions.webscripts.WebScriptResponse res,
Date modified,
String eTag,
Map<String,Object> model)
Set the cache settings on the response
|
void |
setSiteService(org.alfresco.service.cmr.site.SiteService siteService) |
void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
File file,
Long modifiedTime,
boolean attach,
String attachFileName,
Map<String,Object> model)
Streams content back to client from a given File.
|
void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
String attachFileName,
Map<String,Object> model)
Streams the content on a given node's content property to the response of the web script.
|
void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
String resourcePath,
boolean attach,
Map<String,Object> model)
Streams content back to client from a given resource path.
|
protected void |
streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
String resourcePath,
boolean attach,
String attachFileName,
Map<String,Object> model)
Streams content back to client from a given resource path.
|
void |
streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
Date modified,
String eTag,
String attachFileName,
Map<String,Object> model)
Stream content implementation
|
public static final String KEY_ALLOW_BROWSER_TO_CACHE
public static final String KEY_CACHE_DIRECTIVE
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.service.cmr.repository.ContentService contentService
protected org.alfresco.service.cmr.repository.MimetypeService mimetypeService
protected org.springframework.core.io.ResourceLoader resourceLoader
protected org.alfresco.repo.events.EventPublisher eventPublisher
protected org.alfresco.service.cmr.site.SiteService siteService
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService - MimetypeServicepublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService - NodeServicepublic void setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher)
eventPublisher - EventPublisherpublic void setSiteService(org.alfresco.service.cmr.site.SiteService siteService)
siteService - SiteServicepublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
contentService - ContentServicepublic void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
File file,
Long modifiedTime,
boolean attach,
String attachFileName,
Map<String,Object> model)
throws IOException
req - The requestres - The responsefile - The file whose content is to be streamed.modifiedTime - The modified datetime to use for the streamed content. If null the
file's timestamp will be used.attach - Indicates whether the content should be streamed as an attachment or notattachFileName - Optional file name to use when attach is trueIOExceptionpublic void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
String attachFileName,
Map<String,Object> model)
throws IOException
req - Requestres - ResponsenodeRef - The node referencepropertyQName - The content property nameattach - Indicates whether the content should be streamed as an attachment or notattachFileName - Optional file name to use when attach is trueIOExceptionpublic void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
String resourcePath,
boolean attach,
Map<String,Object> model)
throws IOException
req - The requestres - The responseresourcePath - The classpath resource path the content is required forattach - Indicates whether the content should be streamed as an attachment or notIOExceptionprotected void streamContent(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
String resourcePath,
boolean attach,
String attachFileName,
Map<String,Object> model)
throws IOException
req - The requestres - The responseresourcePath - The classpath resource path the content is required for.attach - Indicates whether the content should be streamed as an attachment or notattachFileName - Optional file name to use when attach is trueIOExceptionpublic void streamContentImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName propertyQName,
boolean attach,
Date modified,
String eTag,
String attachFileName,
Map<String,Object> model)
throws IOException
req - The requestres - The responsereader - The readernodeRef - The content nodeRef if applicablepropertyQName - The content property if applicableattach - Indicates whether the content should be streamed as an attachment or notmodified - Modified date of contenteTag - ETag to useattachFileName - Optional file name to use when attach is trueIOExceptionpublic void setAttachment(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
boolean attach,
String attachFileName)
req - WebScriptRequestres - WebScriptResponseattach - booleanattachFileName - Stringprotected boolean isValidQuotedStringHeaderParamChar(char c)
Copyright © 2005–2018 Alfresco Software. All rights reserved.