Class ResourceBasedRemoteFile
- java.lang.Object
-
- org.craftercms.commons.file.stores.impl.ResourceBasedRemoteFile
-
- All Implemented Interfaces:
RemoteFile
public class ResourceBasedRemoteFile extends Object implements RemoteFile
Implementation ofRemoteFile
that basically is facade to a SpringResource
.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description ResourceBasedRemoteFile(RemotePath path, org.springframework.core.io.Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getContentLength()
Returns the content length of the file.InputStream
getInputStream()
Returns an input stream to the content of the file.RemotePath
getPath()
Returns information about the path of the file in the remote store.org.springframework.core.io.Resource
toResource()
Returns the remote file as a SpringResource
.
-
-
-
Constructor Detail
-
ResourceBasedRemoteFile
public ResourceBasedRemoteFile(RemotePath path, org.springframework.core.io.Resource resource)
-
-
Method Detail
-
getPath
public RemotePath getPath()
Description copied from interface:RemoteFile
Returns information about the path of the file in the remote store.- Specified by:
getPath
in interfaceRemoteFile
-
getInputStream
public InputStream getInputStream() throws IOException
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
public long getContentLength() throws IOException
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
public org.springframework.core.io.Resource toResource() throws IOException
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
-
-