Class TrackerWebPageResponseImpl
java.lang.Object
com.biglybt.pifimpl.local.tracker.TrackerWebPageResponseImpl
- All Implemented Interfaces:
TrackerWebPageResponse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStream
private boolean
private String
private int
private boolean
private boolean
private static final String
private boolean
private int
private TrackerWebPageRequestImpl
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected void
complete()
boolean
Request complete responsibility for writing the output streamboolean
isActive()
void
setAsynchronous
(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 falsevoid
setContentType
(String type) void
setExpires
(long time) void
setGZIP
(boolean gzip) void
void
setLastModified
(long time) void
void
setReplyStatus
(int status) boolean
use a file contents as the response.void
useStream
(String file_type, InputStream input_stream) void
writeTorrent
(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:
setLastModified
in interfaceTrackerWebPageResponse
-
setExpires
public void setExpires(long time) - Specified by:
setExpires
in interfaceTrackerWebPageResponse
-
setContentType
- Specified by:
setContentType
in interfaceTrackerWebPageResponse
-
getContentType
- Specified by:
getContentType
in interfaceTrackerWebPageResponse
-
setReplyStatus
public void setReplyStatus(int status) - Specified by:
setReplyStatus
in interfaceTrackerWebPageResponse
-
setHeader
- Specified by:
setHeader
in interfaceTrackerWebPageResponse
-
setGZIP
public void setGZIP(boolean gzip) - Specified by:
setGZIP
in interfaceTrackerWebPageResponse
-
addHeader
-
getOutputStream
- Specified by:
getOutputStream
in interfaceTrackerWebPageResponse
-
setOutputStream
- Specified by:
setOutputStream
in interfaceTrackerWebPageResponse
-
getRawOutputStream
Description copied from interface:TrackerWebPageResponse
Request complete responsibility for writing the output stream- Specified by:
getRawOutputStream
in interfaceTrackerWebPageResponse
- Returns:
- Throws:
IOException
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceTrackerWebPageResponse
-
complete
- Throws:
IOException
-
useFile
Description copied from interface:TrackerWebPageResponse
use a file contents as the response. returns true of loaded ok, false if doesn't exist exception if error occurred during processing.- Specified by:
useFile
in 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:
useStream
in interfaceTrackerWebPageResponse
- Throws:
IOException
-
writeTorrent
- Specified by:
writeTorrent
in interfaceTrackerWebPageResponse
- Throws:
IOException
-
setAsynchronous
Description copied from interface:TrackerWebPageResponse
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 false- Specified by:
setAsynchronous
in interfaceTrackerWebPageResponse
- Parameters:
a
-- Throws:
IOException
-
getAsynchronous
public boolean getAsynchronous()- Specified by:
getAsynchronous
in interfaceTrackerWebPageResponse
-