LimeWire Consolidated API

com.limegroup.gnutella
Interface ResponseFactory

All Known Implementing Classes:
ResponseFactoryImpl

public interface ResponseFactory


Method Summary
 Response createFromStream(InputStream is)
          Factory method for instantiating individual responses from an InputStream instance.
 Response createResponse(FileDesc fd)
          Constructs a new Response instance from the data in the specified FileDesc.
 Response createResponse(long index, long size, String name, LimeXMLDocument doc, URN urn)
          Creates a new response with parsed metadata.
 Response createResponse(long index, long size, String name, URN urn)
          Creates a fresh new response.
 

Method Detail

createResponse

Response createResponse(long index,
                        long size,
                        String name,
                        URN urn)
Creates a fresh new response.


createResponse

Response createResponse(long index,
                        long size,
                        String name,
                        LimeXMLDocument doc,
                        URN urn)
Creates a new response with parsed metadata. Typically this is used to respond to query requests.

Parameters:
doc - the metadata to include

createResponse

Response createResponse(FileDesc fd)
Constructs a new Response instance from the data in the specified FileDesc. LimeXmlDocument is set by default if the data is available. It can be unset by calling response.setDocument(null) to save bandwidth over the wire.

Parameters:
fd - the FileDesc containing the data to construct this Response -- must not be null

createFromStream

Response createFromStream(InputStream is)
                          throws IOException
Factory method for instantiating individual responses from an InputStream instance.

Parameters:
is - the InputStream to read from
Throws:
IOException - if there are any problems reading from or writing to the stream
IOException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.