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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final URLConnectionprivate static final Patternprivate final Stringprivate final Fileprivate static final Patternprivate final InputStreamprivate final Stringprivate static final Patternprivate final intprivate final URI -
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 TypeMethodDescriptionprivate Stringvoidclose()private StringgetFile()Returns the input stream containing the resource data.private StringgetMessage(URLConnection con) longintgetState()getTag()Returns the ETag for the retrieved resource, ornullif the ETag was not provided by the server.getUrl()booleanbooleanbooleanbooleanisOk()voidthrowIt()toString()
-
Field Details
-
con
-
responseCode
private final int responseCode -
etag
-
in
-
url
-
file
-
message
-
HTML_TAGS_P
-
NEWLINES_P
-
ENTITIES_P
-
-
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
-
getMessage
-
cleanHtml
-
entity
-
getTag
Returns the ETag for the retrieved resource, ornullif 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-