fromContentTransferEncodingName static method

TransferEncoding fromContentTransferEncodingName(
  1. String name
)

Detects the transfer encoding from the given name.

Implementation

static TransferEncoding fromContentTransferEncodingName(String name) {
  switch (name.toLowerCase()) {
    case '7bit':
      return TransferEncoding.sevenBit;
    case '8bit':
      return TransferEncoding.eightBit;
    case 'quoted-printable':
      return TransferEncoding.quotedPrintable;
    case 'base64':
      return TransferEncoding.base64;
  }

  return TransferEncoding.automatic;
}