Class ContentStoreResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.craftercms.engine.util.spring.ContentStoreResource
-
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
public class ContentStoreResource extends org.springframework.core.io.AbstractResource
AResource
for a Crafter content storeContent
.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected SiteContext
siteContext
protected String
url
-
Constructor Summary
Constructors Constructor Description ContentStoreResource(SiteContext siteContext, String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
contentLength()
boolean
exists()
protected org.craftercms.core.service.Content
getContent()
String
getDescription()
File
getFile()
String
getFilename()
InputStream
getInputStream()
URL
getURL()
long
lastModified()
-
-
-
Field Detail
-
siteContext
protected SiteContext siteContext
-
url
protected String url
-
-
Constructor Detail
-
ContentStoreResource
public ContentStoreResource(SiteContext siteContext, String url)
-
-
Method Detail
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
- Overrides:
exists
in classorg.springframework.core.io.AbstractResource
-
getURL
public URL getURL() throws IOException
- Specified by:
getURL
in interfaceorg.springframework.core.io.Resource
- Overrides:
getURL
in classorg.springframework.core.io.AbstractResource
- Throws:
IOException
-
contentLength
public long contentLength() throws IOException
- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
- Overrides:
contentLength
in classorg.springframework.core.io.AbstractResource
- Throws:
IOException
-
lastModified
public long lastModified() throws IOException
- Specified by:
lastModified
in interfaceorg.springframework.core.io.Resource
- Overrides:
lastModified
in classorg.springframework.core.io.AbstractResource
- Throws:
IOException
-
getFile
public File getFile() throws IOException
- Specified by:
getFile
in interfaceorg.springframework.core.io.Resource
- Overrides:
getFile
in classorg.springframework.core.io.AbstractResource
- Throws:
IOException
-
getFilename
public String getFilename()
- Specified by:
getFilename
in interfaceorg.springframework.core.io.Resource
- Overrides:
getFilename
in classorg.springframework.core.io.AbstractResource
-
getDescription
public String getDescription()
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getContent
protected org.craftercms.core.service.Content getContent()
-
-