Package io.freefair.spring.okhttp
Class OkHttpResponseBodyResource
java.lang.Object
org.springframework.core.io.AbstractResource
io.freefair.spring.okhttp.OkHttpResponseBodyResource
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
- Direct Known Subclasses:
OkHttpResponseResource
public class OkHttpResponseBodyResource
extends org.springframework.core.io.AbstractResource
implements Closeable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
boolean
exists()
byte[]
getContentAsString
(Charset charset) boolean
isOpen()
boolean
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, equals, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, hashCode, isFile, lastModified, readableChannel, toString
-
Constructor Details
-
OkHttpResponseBodyResource
-
-
Method Details
-
getContentAsByteArray
- Specified by:
getContentAsByteArray
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getContentAsString
- Specified by:
getContentAsString
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getDescription
- Specified by:
getDescription
in interfaceorg.springframework.core.io.Resource
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.springframework.core.io.InputStreamSource
- Throws:
FileNotFoundException
-
contentLength
- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
- Overrides:
contentLength
in classorg.springframework.core.io.AbstractResource
- Throws:
FileNotFoundException
-
exists
- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
- Overrides:
exists
in classorg.springframework.core.io.AbstractResource
-
isOpen
- Specified by:
isOpen
in interfaceorg.springframework.core.io.Resource
- Overrides:
isOpen
in classorg.springframework.core.io.AbstractResource
-
isReadable
- Specified by:
isReadable
in interfaceorg.springframework.core.io.Resource
- Overrides:
isReadable
in classorg.springframework.core.io.AbstractResource
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getResponseBody
-