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 URLConnection
private static final Pattern
private final String
private final File
private static final Pattern
private final InputStream
private final String
private static final Pattern
private final int
private 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 String
void
close()
private String
getFile()
Returns the input stream containing the resource data.private String
getMessage
(URLConnection con) 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()
-
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, 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
-