Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.kristofa.test.http.file;

File name builder which is used by HttpRequestResponseFileLogger.

Author(s):
kristof
 
 enum FileNameBuilder {

    
File name in which to store http request (except entity).
    REQUEST_FILE_NAME("request"),
    
File name in which to store http request entity.
    REQUEST_ENTITY_FILE_NAME("request_entity"),
    
File name in which to store http response.
    RESPONSE_FILE_NAME("response"),
    
File name in which to store http response entity.
    RESPONSE_ENTITY_FILE_NAME("response_entity");
    private String fileTypeNamePart;
    private FileNameBuilder(final String fileTypeNamePart) {
        this. = fileTypeNamePart;
    }

    
Gets full file name.

Parameters:
uniqueFileNamePart When storing request/responses we want a unique part o the file name.
seqNr When storing multiple request/responses we want unique seq nr.
Returns:
File name.
    public String getFileName(final String uniqueFileNamePartfinal int seqNr) {
        return uniqueFileNamePart + "_" +  + "_" + String.format("%05d"seqNr) + ".txt";
    }
New to GrepCode? Check out our FAQ X