Class WebDavResource
- java.lang.Object
-
- org.craftercms.commons.spring.resources.WebDavResource
-
- All Implemented Interfaces:
RangeAwareResource
,org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
public class WebDavResource extends Object implements RangeAwareResource
Implementation ofResource
for WebDAV- Since:
- 3.1.4
- Author:
- joseross
-
-
Constructor Summary
Constructors Constructor Description WebDavResource(com.github.sardine.Sardine client, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
contentLength()
org.springframework.core.io.Resource
createRelative(String relativePath)
boolean
exists()
String
getDescription()
File
getFile()
String
getFilename()
InputStream
getInputStream()
InputStream
getInputStream(long start, long end)
Returns a range of bytes from the resource's content.protected com.github.sardine.DavResource
getResource()
URI
getURI()
URL
getURL()
boolean
isOpen()
boolean
isReadable()
long
lastModified()
-
-
-
Field Detail
-
client
protected com.github.sardine.Sardine client
-
path
protected String path
-
-
Constructor Detail
-
WebDavResource
public WebDavResource(com.github.sardine.Sardine client, String path)
-
-
Method Detail
-
getInputStream
public InputStream getInputStream(long start, long end) throws IOException
Description copied from interface:RangeAwareResource
Returns a range of bytes from the resource's content.- Specified by:
getInputStream
in interfaceRangeAwareResource
- Parameters:
start
- the start of the rangeend
- the end of the range- Returns:
- an input stream with the content range
- Throws:
IOException
- if an IO error occurs
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
-
isReadable
public boolean isReadable()
- Specified by:
isReadable
in interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfaceorg.springframework.core.io.Resource
-
getURL
public URL getURL() throws IOException
- Specified by:
getURL
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getURI
public URI getURI() throws IOException
- Specified by:
getURI
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getFile
public File getFile() throws IOException
- Specified by:
getFile
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
contentLength
public long contentLength() throws IOException
- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
lastModified
public long lastModified() throws IOException
- Specified by:
lastModified
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
createRelative
public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
- Specified by:
createRelative
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getFilename
public String getFilename()
- Specified by:
getFilename
in interfaceorg.springframework.core.io.Resource
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceorg.springframework.core.io.Resource
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStream
in interfaceorg.springframework.core.io.InputStreamSource
- Throws:
IOException
-
getResource
protected com.github.sardine.DavResource getResource() throws IOException
- Throws:
IOException
-
-