com.github.kristofa.test.http.file
Class HttpRequestResponseFileLoggerFactory

java.lang.Object
  extended by com.github.kristofa.test.http.file.HttpRequestResponseFileLoggerFactory
All Implemented Interfaces:
HttpRequestResponseLoggerFactory

public class HttpRequestResponseFileLoggerFactory
extends Object
implements HttpRequestResponseLoggerFactory

Factory that creates HttpRequestResponseFileLogger instances.

Author:
kristof
See Also:
HttpRequestResponseFileLogger, LoggingHttpProxy

Constructor Summary
HttpRequestResponseFileLoggerFactory(String directory, String fileName)
          Creates a new instance.
HttpRequestResponseFileLoggerFactory(String directory, String fileName, boolean deleteExistingFiles)
          Creates a new instance.
 
Method Summary
 HttpRequestResponseLogger getHttpRequestResponseLogger()
          Creates a new HttpRequestResponseLogger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequestResponseFileLoggerFactory

public HttpRequestResponseFileLoggerFactory(String directory,
                                            String fileName)
Creates a new instance. We will not delete any existing files.

Parameters:
directory - Target directory in which to store request/responses. Directory should already exist. Should not be null or blank.
fileName - Base file name. Should not contain extension. Will be suffixed with sequence number and .txt extension. Should not be null or blank.

HttpRequestResponseFileLoggerFactory

public HttpRequestResponseFileLoggerFactory(String directory,
                                            String fileName,
                                            boolean deleteExistingFiles)
Creates a new instance.

Parameters:
directory - Target directory in which to store request/responses. Directory should already exist. Should not be null or blank.
fileName - Base file name. Should not contain extension. Will be suffixed with sequence number and .txt extension. Should not be null or blank.
deleteExistingFiles - If value is true we will delete all existing files prior to logging new requests. This is often helpful because if we have less requests than before otherwise old files keep on lingering which can cause failing tests.
Method Detail

getHttpRequestResponseLogger

public HttpRequestResponseLogger getHttpRequestResponseLogger()
Creates a new HttpRequestResponseLogger. Each request should return a new instance.

Specified by:
getHttpRequestResponseLogger in interface HttpRequestResponseLoggerFactory
Returns:
a New HttpRequestResponseLogger.


Copyright © 2014. All Rights Reserved.