APISonar


ch.cyberduck.core.TranscriptListener.log

> ch > cyberduck > core > TranscriptListener > log
ch APIs cyberduck APIs core APIs TranscriptListener APIs log APIs

Example 1
private TranscriptListener transcriptListener;

    public void log(final boolean request, final String message) {
        transcript.append(message).append(LINE_SEPARATOR);
        transcriptListener.log(request, message);
    }
Example 2
private final TranscriptListener listener;

    protected HttpResponse doSendRequest(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws IOException, HttpException {
        listener.log(TranscriptListener.Type.request, request.getRequestLine().toString());
        for(Header header : request.getAllHeaders()) {
            if(StringUtils.equals(HttpHeaders.AUTHORIZATION, header.getName())) {
                listener.log(TranscriptListener.Type.request, String.format("%s: %s", header.getName(), StringUtils.repeat("*", StringUtils.length(header.getValue()))));
            }
            else {
                listener.log(TranscriptListener.Type.request, header.toString());
            }

        }
        return super.doSendRequest(request, conn, context);
    }
Example 3
private final TranscriptListener listener;

    protected HttpResponse doReceiveResponse(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws HttpException, IOException {
        final HttpResponse response = super.doReceiveResponse(request, conn, context);
        listener.log(TranscriptListener.Type.response, response.getStatusLine().toString());
        for(Header header : response.getAllHeaders()) {
            listener.log(TranscriptListener.Type.response, header.toString());
        }
        return response;
    }