Class ResourceBasedRemoteFile
java.lang.Object
org.craftercms.commons.file.stores.impl.ResourceBasedRemoteFile
- All Implemented Interfaces:
RemoteFile
Implementation of
RemoteFile
that basically is facade to a Spring Resource
.- Author:
- avasquez
-
Constructor Summary
ConstructorDescriptionResourceBasedRemoteFile
(RemotePath path, org.springframework.core.io.Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the content length of the file.Returns an input stream to the content of the file.getPath()
Returns information about the path of the file in the remote store.org.springframework.core.io.Resource
Returns the remote file as a SpringResource
.
-
Constructor Details
-
ResourceBasedRemoteFile
-
-
Method Details
-
getPath
Description copied from interface:RemoteFile
Returns information about the path of the file in the remote store.- Specified by:
getPath
in interfaceRemoteFile
-
getInputStream
Description copied from interface:RemoteFile
Returns an input stream to the content of the file.- Specified by:
getInputStream
in interfaceRemoteFile
- Throws:
IOException
- if an error occurs while trying to access the file content
-
getContentLength
Description copied from interface:RemoteFile
Returns the content length of the file.- Specified by:
getContentLength
in interfaceRemoteFile
- Throws:
IOException
- if an error occurs while trying to access the file
-
toResource
Description copied from interface:RemoteFile
Returns the remote file as a SpringResource
.- Specified by:
toResource
in interfaceRemoteFile
- Throws:
IOException
- if the file can't be resolved successfully as a resource
-