Class TrackerWebPageResponseImpl
java.lang.Object
com.biglybt.pifimpl.local.tracker.TrackerWebPageResponseImpl
- All Implemented Interfaces:
TrackerWebPageResponse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStreamprivate booleanprivate Stringprivate intprivate booleanprivate booleanprivate static final Stringprivate booleanprivate intprivate TrackerWebPageRequestImpl -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected voidcomplete()booleanRequest complete responsibility for writing the output streambooleanisActive()voidsetAsynchronous(boolean a) For a non-blocking tracker the construction of the response can be completed asynchronously by setting async=true and then, when complete, setting it to falsevoidsetContentType(String type) voidsetExpires(long time) voidsetGZIP(boolean gzip) voidvoidsetLastModified(long time) voidvoidsetReplyStatus(int status) booleanuse a file contents as the response.voiduseStream(String file_type, InputStream input_stream) voidwriteTorrent(TrackerTorrent tracker_torrent)
-
Field Details
-
NL
- See Also:
-
baos
-
baos_set
private boolean baos_set -
content_type
-
reply_status
private int reply_status -
header_map
-
request
-
raw_output
private boolean raw_output -
is_async
private boolean is_async -
explicit_gzip
private int explicit_gzip -
is_gzipped
private boolean is_gzipped
-
-
Constructor Details
-
TrackerWebPageResponseImpl
-
-
Method Details
-
setLastModified
public void setLastModified(long time) - Specified by:
setLastModifiedin interfaceTrackerWebPageResponse
-
setExpires
public void setExpires(long time) - Specified by:
setExpiresin interfaceTrackerWebPageResponse
-
setContentType
- Specified by:
setContentTypein interfaceTrackerWebPageResponse
-
getContentType
- Specified by:
getContentTypein interfaceTrackerWebPageResponse
-
setReplyStatus
public void setReplyStatus(int status) - Specified by:
setReplyStatusin interfaceTrackerWebPageResponse
-
setHeader
- Specified by:
setHeaderin interfaceTrackerWebPageResponse
-
setGZIP
public void setGZIP(boolean gzip) - Specified by:
setGZIPin interfaceTrackerWebPageResponse
-
addHeader
-
getOutputStream
- Specified by:
getOutputStreamin interfaceTrackerWebPageResponse
-
setOutputStream
- Specified by:
setOutputStreamin interfaceTrackerWebPageResponse
-
getRawOutputStream
Description copied from interface:TrackerWebPageResponseRequest complete responsibility for writing the output stream- Specified by:
getRawOutputStreamin interfaceTrackerWebPageResponse- Returns:
- Throws:
IOException
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceTrackerWebPageResponse
-
complete
- Throws:
IOException
-
useFile
Description copied from interface:TrackerWebPageResponseuse a file contents as the response. returns true of loaded ok, false if doesn't exist exception if error occurred during processing.- Specified by:
useFilein interfaceTrackerWebPageResponse- Parameters:
root_dir- e.g. c:\temp\parp or /tmp/trout/relative_url- e.g. /here/there/wibble.html- Returns:
- Throws:
IOException
-
useStream
- Specified by:
useStreamin interfaceTrackerWebPageResponse- Throws:
IOException
-
writeTorrent
- Specified by:
writeTorrentin interfaceTrackerWebPageResponse- Throws:
IOException
-
setAsynchronous
Description copied from interface:TrackerWebPageResponseFor a non-blocking tracker the construction of the response can be completed asynchronously by setting async=true and then, when complete, setting it to false- Specified by:
setAsynchronousin interfaceTrackerWebPageResponse- Parameters:
a-- Throws:
IOException
-
getAsynchronous
public boolean getAsynchronous()- Specified by:
getAsynchronousin interfaceTrackerWebPageResponse
-