class FtpControlConversationRecordBuilder extends BaseWARCRecordBuilder {

    @Override
    public boolean shouldBuildRecord(CrawlURI curi) {
        return "ftp".equalsIgnoreCase(curi.getUURI().getScheme()) || "sftp".equalsIgnoreCase(curi.getUURI().getScheme());
    }

    @Override
    public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException {<FILL_FUNCTION_BODY>}

}

        final String timestamp =
                ArchiveUtils.getLog14Date(curi.getFetchBeginTime());
        String controlConversation =
                curi.getData().get(A_FTP_CONTROL_CONVERSATION).toString();

        WARCRecordInfo recordInfo = new WARCRecordInfo();
        recordInfo.setRecordId(generateRecordID());
        if (concurrentTo != null) {
            recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO,
                    '<' + concurrentTo.toString() + '>');
        }
        recordInfo.setCreate14DigitDate(timestamp);
        recordInfo.setUrl(curi.toString());
        recordInfo.setMimetype(FTP_CONTROL_CONVERSATION_MIMETYPE);
        recordInfo.setEnforceLength(true);
        recordInfo.setType(WARCRecordType.metadata);

        if (curi.getServerIP() != null) {
            recordInfo.addExtraHeader(HEADER_KEY_IP, curi.getServerIP());
        }
        
        byte[] b = controlConversation.getBytes("UTF-8");
        
        recordInfo.setContentStream(new ByteArrayInputStream(b));
        recordInfo.setContentLength((long) b.length);

        return recordInfo;
    
<methods>public non-sealed void <init>() ,public static java.net.URI generateRecordID() <variables>