Package aQute.bnd.service.url
Class TaggedData
java.lang.Object
aQute.bnd.service.url.TaggedData
- All Implemented Interfaces:
Closeable
,AutoCloseable
Represents a data stream that has a tag associated with it; the primary
use-case is an HTTP response stream with an ETag header.
- Author:
- Neil Bartlett
-
Constructor Summary
ConstructorsConstructorDescriptionTaggedData
(String tag, InputStream inputStream) Deprecated.TaggedData
(String tag, InputStream inputStream, int responseCode) Deprecated.TaggedData
(String tag, InputStream inputStream, int responseCode, long modified, URI url) Deprecated.TaggedData
(URI url, int responseCode, File file) TaggedData
(URLConnection con, InputStream in) TaggedData
(URLConnection con, InputStream in, File file) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getFile()
Returns the input stream containing the resource data.long
int
getState()
getTag()
Returns the ETag for the retrieved resource, ornull
if the ETag was not provided by the server.getUrl()
boolean
boolean
boolean
boolean
isOk()
void
throwIt()
toString()
-
Constructor Details
-
TaggedData
@Deprecated public TaggedData(String tag, InputStream inputStream, int responseCode, long modified, URI url) Deprecated. -
TaggedData
Deprecated. -
TaggedData
Deprecated. -
TaggedData
- Throws:
Exception
-
TaggedData
- Throws:
Exception
-
TaggedData
- Throws:
Exception
-
-
Method Details
-
getTag
Returns the ETag for the retrieved resource, ornull
if the ETag was not provided by the server. -
getInputStream
Returns the input stream containing the resource data.- Throws:
IOException
-
getResponseCode
public int getResponseCode() -
getModified
public long getModified() -
hasPayload
- Throws:
IOException
-
getUrl
-
getConnection
-
toString
-
isOk
public boolean isOk() -
isNotModified
public boolean isNotModified() -
throwIt
public void throwIt() -
getState
-
isNotFound
public boolean isNotFound() -
getFile
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-