public class ResourceBasedRemoteFile extends Object implements RemoteFile
RemoteFile
that basically is facade to a Spring Resource
.Constructor and Description |
---|
ResourceBasedRemoteFile(RemotePath path,
org.springframework.core.io.Resource resource) |
Modifier and Type | Method and 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 Spring
Resource . |
public ResourceBasedRemoteFile(RemotePath path, org.springframework.core.io.Resource resource)
public RemotePath getPath()
RemoteFile
getPath
in interface RemoteFile
public InputStream getInputStream() throws IOException
RemoteFile
getInputStream
in interface RemoteFile
IOException
- if an error occurs while trying to access the file contentpublic long getContentLength() throws IOException
RemoteFile
getContentLength
in interface RemoteFile
IOException
- if an error occurs while trying to access the filepublic org.springframework.core.io.Resource toResource() throws IOException
RemoteFile
Resource
.toResource
in interface RemoteFile
IOException
- if the file can't be resolved successfully as a resourceCopyright © 2023 CrafterCMS. All rights reserved.