Class ContentResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.craftercms.studio.impl.v2.utils.spring.ContentResource
-
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
public class ContentResource extends org.springframework.core.io.AbstractResource
Implementation ofResource
that wraps site content- Since:
- 3.1.1
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentService
contentService
The content serviceprotected String
path
The relative path of the contentprotected String
site
The site id
-
Constructor Summary
Constructors Constructor Description ContentResource(ContentService contentService, String site, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
contentLength()
boolean
exists()
String
getDescription()
String
getFilename()
InputStream
getInputStream()
long
lastModified()
-
-
-
Field Detail
-
contentService
protected ContentService contentService
The content service
-
site
protected String site
The site id
-
path
protected String path
The relative path of the content
-
-
Constructor Detail
-
ContentResource
public ContentResource(ContentService contentService, String site, String path)
-
-
Method Detail
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
- Overrides:
exists
in classorg.springframework.core.io.AbstractResource
-
contentLength
public long contentLength()
- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
- Overrides:
contentLength
in classorg.springframework.core.io.AbstractResource
-
lastModified
public long lastModified()
- Specified by:
lastModified
in interfaceorg.springframework.core.io.Resource
- Overrides:
lastModified
in classorg.springframework.core.io.AbstractResource
-
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
-
-