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 of
Resource that wraps site content- Since:
- 3.1.1
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentServiceThe content serviceprotected StringThe relative path of the contentprotected StringThe site id -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, equals, getFile, getFileForLastModifiedCheck, getURI, getURL, hashCode, isFile, isOpen, isReadable, readableChannel, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
getContentAsByteArray, getContentAsString
-
Field Details
-
contentService
The content service -
site
The site id -
path
The relative path of the content
-
-
Constructor Details
-
ContentResource
-
-
Method Details
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.springframework.core.io.Resource- Overrides:
existsin classorg.springframework.core.io.AbstractResource
-
contentLength
public long contentLength()- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Overrides:
contentLengthin classorg.springframework.core.io.AbstractResource
-
lastModified
public long lastModified()- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Overrides:
lastModifiedin classorg.springframework.core.io.AbstractResource
-
getFilename
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource- Overrides:
getFilenamein classorg.springframework.core.io.AbstractResource
-
getDescription
-
getInputStream
- Throws:
IOException
-