class IcapScanFile {

  public static IcapClient getIcapClient(final IcapScanFile icapScanFile) {
    if (icapScanFile == null) {
      throw new IllegalArgumentException(ARGUMENTS_CANNOT_BE_EMPTY_OR_NULL);
    }
    final IcapClient icapClient =
        new IcapClient(icapScanFile.serverIP, icapScanFile.port,
                       icapScanFile.icapService, icapScanFile.stdPreviewSize);
    icapClient.setSendLength(icapScanFile.sendLength)
              .setReceiveLength(icapScanFile.receiveLength)
              .setMaxSize(icapScanFile.maxSize).setTimeout(icapScanFile.timeout)
              .setKeyIcapPreview(icapScanFile.keyIcapPreview)
              .setSubStringFromKeyIcapPreview(
                  icapScanFile.subStringFromKeyIcapPreview)
              .setKeyIcap204(icapScanFile.keyIcap204)
              .setSubStringFromKeyIcap204(icapScanFile.subStringFromKeyIcap204)
              .setKeyIcap200(icapScanFile.keyIcap200)
              .setSubStringFromKeyIcap200(icapScanFile.subStringFromKeyIcap200)
              .setSubstringHttpStatus200(icapScanFile.substringHttpStatus200);
    return icapClient;
  }

  private  IcapScanFile();

}