merge IOS-1511 refactor
authorAlejandro Gelos <alejandro@pep-project.org>
Fri, 17 May 2019 14:08:50 +0200
branchrefactor
changeset 8669e16f27101ac0
parent 8622 0255cb7ebf3f
parent 8668 638e51d0bebd
child 8670 949a6fcdbbf9
child 8672 166ae0c2051e
merge IOS-1511
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Constants.swift
pEpForiOS/Util/Extensions/URL+MIME.swift
pEpForiOS/Util/jsonMimeType.txt
     1.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Constants.swift	Wed May 15 15:22:42 2019 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,52 +0,0 @@
     1.4 -//
     1.5 -//  Constants.swift
     1.6 -//  pEpIOSToolbox
     1.7 -//
     1.8 -//  Created by Dirk Zimmermann on 22.02.19.
     1.9 -//  Copyright © 2019 pEp Security SA. All rights reserved.
    1.10 -//
    1.11 -
    1.12 -import Foundation
    1.13 -
    1.14 -public struct Constants {
    1.15 -    /** MIME content type for plain text */
    1.16 -    public static let contentTypeText = "text/plain"
    1.17 -
    1.18 -    /** MIME content type for HTML */
    1.19 -    public static let contentTypeHtml = "text/html"
    1.20 -
    1.21 -    /**
    1.22 -     Mime type for the "Version" attachment of PGP/MIME.
    1.23 -     */
    1.24 -    public static let contentTypePGPEncrypted = "application/pgp-encrypted"
    1.25 -
    1.26 -    /**
    1.27 -     Content type for MIME multipart/mixed.
    1.28 -     */
    1.29 -    public static let contentTypeMultipartMixed = "multipart/mixed"
    1.30 -
    1.31 -    /**
    1.32 -     Content type for MIME multipart/related.
    1.33 -     */
    1.34 -    public static let contentTypeMultipartRelated = "multipart/related"
    1.35 -
    1.36 -    /**
    1.37 -     Content type for MIME multipart/encrypted.
    1.38 -     */
    1.39 -    public static let contentTypeMultipartEncrypted = "multipart/encrypted"
    1.40 -
    1.41 -    /**
    1.42 -     Protocol for PGP/MIME application/pgp-encrypted.
    1.43 -     */
    1.44 -    public static let protocolPGPEncrypted = "application/pgp-encrypted"
    1.45 -
    1.46 -    /**
    1.47 -     Content type for MIME multipart/alternative.
    1.48 -     */
    1.49 -    public static let contentTypeMultipartAlternative = "multipart/alternative"
    1.50 -
    1.51 -    /**
    1.52 -     The MIME type for attached emails (e.g., when forwarding).
    1.53 -     */
    1.54 -    public static let attachedEmailMimeType = "message/rfc822"
    1.55 -}
     2.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Wed May 15 15:22:42 2019 +0200
     2.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Fri May 17 14:08:50 2019 +0200
     2.3 @@ -117,7 +117,6 @@
     2.4  		15410D252199ECD700BBF65F /* AttachmentViewModelTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15410D242199ECD700BBF65F /* AttachmentViewModelTest.swift */; };
     2.5  		1541D7ED1FC81D4200D52A5D /* URL+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1541D7EC1FC81D4200D52A5D /* URL+Extensions.swift */; };
     2.6  		1541D7F01FC81ED900D52A5D /* URL+ExtensionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1541D7EF1FC81ED900D52A5D /* URL+ExtensionsTest.swift */; };
     2.7 -		1541D7F31FC8292D00D52A5D /* URL+MIME.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1541D7F21FC8292D00D52A5D /* URL+MIME.swift */; };
     2.8  		1541D7F51FC82A4900D52A5D /* URL+MIME.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1541D7F41FC82A4900D52A5D /* URL+MIME.swift */; };
     2.9  		1544BD0221524C9F0075C5A0 /* AttachmentFilterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1544BD0121524C9F0075C5A0 /* AttachmentFilterTest.swift */; };
    2.10  		154D92CF20AC1745009A5868 /* MoveToFolderOperationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 154D92CE20AC1744009A5868 /* MoveToFolderOperationTest.swift */; };
    2.11 @@ -424,7 +423,6 @@
    2.12  		B722EC651E5B49BA00A2B9D5 /* FolderSectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B722EC641E5B49BA00A2B9D5 /* FolderSectionViewModel.swift */; };
    2.13  		B722EC7A1E5C879000A2B9D5 /* FolderUiProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = B722EC791E5C879000A2B9D5 /* FolderUiProtocols.swift */; };
    2.14  		B729BEC61E7C35E200793110 /* FilterUpdateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = B729BEC51E7C35E200793110 /* FilterUpdateProtocol.swift */; };
    2.15 -		B740B75D1E4B1C2D002585E1 /* jsonMimeType.txt in Resources */ = {isa = PBXBuildFile; fileRef = B740B75C1E4B1C2D002585E1 /* jsonMimeType.txt */; };
    2.16  		B74F81021EB0E20000519FCC /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B74F81011EB0E20000519FCC /* LoginViewModel.swift */; };
    2.17  		B75FF00B1EFD420F00C57289 /* EmailListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B75FF00A1EFD420F00C57289 /* EmailListViewModel.swift */; };
    2.18  		B76CF8B320D2739B002429A8 /* MoveToFolderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B76CF8B220D2739B002429A8 /* MoveToFolderViewModel.swift */; };
    2.19 @@ -597,7 +595,6 @@
    2.20  		15410D242199ECD700BBF65F /* AttachmentViewModelTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentViewModelTest.swift; sourceTree = "<group>"; };
    2.21  		1541D7EC1FC81D4200D52A5D /* URL+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Extensions.swift"; sourceTree = "<group>"; };
    2.22  		1541D7EF1FC81ED900D52A5D /* URL+ExtensionsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+ExtensionsTest.swift"; sourceTree = "<group>"; };
    2.23 -		1541D7F21FC8292D00D52A5D /* URL+MIME.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+MIME.swift"; sourceTree = "<group>"; };
    2.24  		1541D7F41FC82A4900D52A5D /* URL+MIME.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+MIME.swift"; sourceTree = "<group>"; };
    2.25  		1544BD0121524C9F0075C5A0 /* AttachmentFilterTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AttachmentFilterTest.swift; path = pEpForiOSTests/Models/Filter/AttachmentFilterTest.swift; sourceTree = SOURCE_ROOT; };
    2.26  		154D92CE20AC1744009A5868 /* MoveToFolderOperationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoveToFolderOperationTest.swift; sourceTree = "<group>"; };
    2.27 @@ -938,7 +935,6 @@
    2.28  		B722EC641E5B49BA00A2B9D5 /* FolderSectionViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FolderSectionViewModel.swift; path = Folder/ViewModel/FolderSectionViewModel.swift; sourceTree = "<group>"; };
    2.29  		B722EC791E5C879000A2B9D5 /* FolderUiProtocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FolderUiProtocols.swift; sourceTree = "<group>"; };
    2.30  		B729BEC51E7C35E200793110 /* FilterUpdateProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FilterUpdateProtocol.swift; path = Filter/ViewModel/FilterUpdateProtocol.swift; sourceTree = "<group>"; };
    2.31 -		B740B75C1E4B1C2D002585E1 /* jsonMimeType.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = jsonMimeType.txt; sourceTree = "<group>"; };
    2.32  		B74F81011EB0E20000519FCC /* LoginViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = "<group>"; };
    2.33  		B75FF00A1EFD420F00C57289 /* EmailListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailListViewModel.swift; sourceTree = "<group>"; };
    2.34  		B76CF8B220D2739B002429A8 /* MoveToFolderViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoveToFolderViewModel.swift; sourceTree = "<group>"; };
    2.35 @@ -1719,7 +1715,6 @@
    2.36  				431C2B181F38888B00D87FFD /* ConnectionTransport+AccountSettings.swift */,
    2.37  				43257C871F5067BE00DDC7F0 /* NSAttributedString+pEp.swift */,
    2.38  				1541D7EC1FC81D4200D52A5D /* URL+Extensions.swift */,
    2.39 -				1541D7F21FC8292D00D52A5D /* URL+MIME.swift */,
    2.40  				155050F11FE95D8A009CEAD2 /* UserNotificationTool+pEp.swift */,
    2.41  				439A23E420B40FAC00417AF5 /* PEP_rating+Extension.swift */,
    2.42  				1574D079211464CC00FEDC93 /* URL+MailTo.swift */,
    2.43 @@ -1875,7 +1870,6 @@
    2.44  			isa = PBXGroup;
    2.45  			children = (
    2.46  				4362398D1EAE08F400BD2EB9 /* Extensions */,
    2.47 -				B740B7571E4B1B80002585E1 /* MimeTypes */,
    2.48  				43306EBC1FE125950045DD00 /* OAuth2 */,
    2.49  				43980EF91CBD415700A7FC3C /* AppConfig.swift */,
    2.50  				A1B50A811CD26FF100B1A997 /* Constants.swift */,
    2.51 @@ -2357,14 +2351,6 @@
    2.52  			name = CellsAndSections;
    2.53  			sourceTree = "<group>";
    2.54  		};
    2.55 -		B740B7571E4B1B80002585E1 /* MimeTypes */ = {
    2.56 -			isa = PBXGroup;
    2.57 -			children = (
    2.58 -				B740B75C1E4B1C2D002585E1 /* jsonMimeType.txt */,
    2.59 -			);
    2.60 -			name = MimeTypes;
    2.61 -			sourceTree = "<group>";
    2.62 -		};
    2.63  		B74D08BF1F013F15003D092C /* ViewModel */ = {
    2.64  			isa = PBXGroup;
    2.65  			children = (
    2.66 @@ -2570,7 +2556,6 @@
    2.67  				220DCE2F1E0AB544002FE716 /* MessageData.plist in Resources */,
    2.68  				432E80FE2191AF5100359879 /* UniversLTStd-Bold.otf in Resources */,
    2.69  				43980E311CBD0BCA00A7FC3C /* Assets.xcassets in Resources */,
    2.70 -				B740B75D1E4B1C2D002585E1 /* jsonMimeType.txt in Resources */,
    2.71  				151DE7E41FC5D41600CDC273 /* FolderViews.storyboard in Resources */,
    2.72  				152A39D221905C3E00D9F8E4 /* AttachmentCell.xib in Resources */,
    2.73  				43C98AC7219C3691006418B0 /* InfoPlist.strings in Resources */,
    2.74 @@ -2755,7 +2740,6 @@
    2.75  				006BE6BC20F4B63C00DDE8C9 /* EmailDetailType.swift in Sources */,
    2.76  				00EB89AB20E3A27C00CDFA0D /* ThreadViewcontroller+SizeClasses.swift in Sources */,
    2.77  				43257C841F50629700DDC7F0 /* HtmlToAttributedTextSaxParser.swift in Sources */,
    2.78 -				1541D7F31FC8292D00D52A5D /* URL+MIME.swift in Sources */,
    2.79  				4351C2D61F4441190053381F /* man.c in Sources */,
    2.80  				150B8EB31FCEB93D00374438 /* UIUtils.swift in Sources */,
    2.81  				43AAC22A1F7A5AEE00F435F4 /* BaseTableViewController.swift in Sources */,
     3.1 --- a/pEpForiOS/HTMLParser/Axt/HtmlToAttributedTextSaxParser.swift	Wed May 15 15:22:42 2019 +0200
     3.2 +++ b/pEpForiOS/HTMLParser/Axt/HtmlToAttributedTextSaxParser.swift	Fri May 17 14:08:50 2019 +0200
     3.3 @@ -18,7 +18,6 @@
     3.4  class HtmlToAttributedTextSaxParser: HtmlToTextSaxParser {
     3.5      var attributedOutput = NSMutableAttributedString()
     3.6      let defaultFont = UIFont.preferredFont(forTextStyle: .body)
     3.7 -    let mimeUtil = MimeTypeUtil()
     3.8  
     3.9      weak var attachmentDelegate: HtmlToAttributedTextSaxParserAttachmentDelegate?
    3.10  
     4.1 --- a/pEpForiOS/UI/Compose/Cells/AttachmentCell/AttachmentViewModel.swift	Wed May 15 15:22:42 2019 +0200
     4.2 +++ b/pEpForiOS/UI/Compose/Cells/AttachmentCell/AttachmentViewModel.swift	Fri May 17 14:08:50 2019 +0200
     4.3 @@ -9,20 +9,21 @@
     4.4  import MessageModel
     4.5  
     4.6  class AttachmentViewModel: CellViewModel {
     4.7 +    public let attachment: Attachment
     4.8 +    private lazy var mimeTypeUtils = MimeTypeUtils()
     4.9 +
    4.10 +    init(attachment: Attachment) {
    4.11 +        self.attachment = attachment
    4.12 +    }
    4.13 +
    4.14      static let defaultFileName = NSLocalizedString("unknown",
    4.15 -                                            comment:
    4.16 +                                                   comment:
    4.17          "Displayed attachment filename if unknown")
    4.18      public var fileName: String {
    4.19          return attachment.fileName ?? AttachmentViewModel.defaultFileName
    4.20      }
    4.21 +
    4.22      public var fileExtension: String {
    4.23 -        return mimeTypeUtil?.fileExtension(mimeType: attachment.mimeType) ?? ""
    4.24 -    }
    4.25 -
    4.26 -    public let attachment: Attachment
    4.27 -    private let mimeTypeUtil = MimeTypeUtil()
    4.28 -
    4.29 -    init(attachment: Attachment) {
    4.30 -        self.attachment = attachment
    4.31 +        return mimeTypeUtils?.fileExtension(fromMimeType: attachment.mimeType) ?? ""
    4.32      }
    4.33  }
     5.1 --- a/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Wed May 15 15:22:42 2019 +0200
     5.2 +++ b/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Fri May 17 14:08:50 2019 +0200
     5.3 @@ -20,6 +20,7 @@
     5.4      lazy private var attachmentFileIOQueue = DispatchQueue(label:
     5.5          "security.pep.DocumentAttachmentPickerViewModel.attachmentFileIOQueue",
     5.6                                                             qos: .userInitiated)
     5.7 +    private let mimeUtils = MimeTypeUtils()
     5.8      weak public var resultDelegate: DocumentAttachmentPickerViewModelResultDelegate?
     5.9  
    5.10      public init(resultDelegate: DocumentAttachmentPickerViewModelResultDelegate? = nil) {
    5.11 @@ -59,7 +60,7 @@
    5.12      private func createAttachment(forSecurityScopedResource resourceUrl: URL,
    5.13                                    completion: @escaping (Attachment?) -> Void) {
    5.14          let cfUrl = resourceUrl as CFURL
    5.15 -        attachmentFileIOQueue.async {
    5.16 +        attachmentFileIOQueue.async { [weak self] in
    5.17              CFURLStartAccessingSecurityScopedResource(cfUrl)
    5.18              defer { CFURLStopAccessingSecurityScopedResource(cfUrl) }
    5.19              guard  let resourceData = try? Data(contentsOf: resourceUrl)  else {
    5.20 @@ -67,7 +68,8 @@
    5.21                  completion(nil)
    5.22                  return
    5.23              }
    5.24 -            let mimeType = resourceUrl.mimeType() ?? MimeTypeUtil.defaultMimeType
    5.25 +            let mimeType = self?.mimeUtils?.mimeType(fromURL: resourceUrl) ??
    5.26 +                MimeTypeUtils.MimesType.defaultMimeType
    5.27              let filename = resourceUrl.fileName(includingExtension: true)
    5.28              let attachment = Attachment.create(data: resourceData,
    5.29                                                 mimeType: mimeType,
     6.1 --- a/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Wed May 15 15:22:42 2019 +0200
     6.2 +++ b/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Fri May 17 14:08:50 2019 +0200
     6.3 @@ -23,6 +23,7 @@
     6.4          "security.pep.MediaAttachmentPickerProviderViewModel.attachmentFileIOQueue",
     6.5                                                             qos: .userInitiated)
     6.6      private var numVideosSelected = 0
     6.7 +    private let mimeTypeUtils = MimeTypeUtils()
     6.8      weak public var resultDelegate: MediaAttachmentPickerProviderViewModelResultDelegate?
     6.9  
    6.10      public init(resultDelegate: MediaAttachmentPickerProviderViewModelResultDelegate?) {
    6.11 @@ -83,7 +84,7 @@
    6.12                                    completion: @escaping (Attachment?) -> Void) {
    6.13          attachmentFileIOQueue.async { [weak self] in
    6.14              guard let me = self else {
    6.15 -                Log.shared.errorAndCrash("Lost MySelf")
    6.16 +                Log.shared.lostMySelf()
    6.17                  return
    6.18              }
    6.19              guard let resourceData = try? Data(contentsOf: resourceUrl) else {
    6.20 @@ -91,7 +92,8 @@
    6.21                  completion(nil)
    6.22                  return
    6.23              }
    6.24 -            let mimeType = resourceUrl.mimeType() ?? MimeTypeUtil.defaultMimeType
    6.25 +            let mimeType = me.mimeTypeUtils?.mimeType(fromURL: resourceUrl) ??
    6.26 +                MimeTypeUtils.MimesType.defaultMimeType
    6.27              let filename = me.fileName(forVideoAt: resourceUrl)
    6.28              let attachment =  Attachment.create(data: resourceData,
    6.29                                                  mimeType: mimeType,
    6.30 @@ -111,9 +113,8 @@
    6.31          return fileName + numDisplay + "." + fileExtension
    6.32      }
    6.33  
    6.34 -    private func createAttachment(forAssetWithUrl assetUrl: URL,
    6.35 -                                  image: UIImage) -> Attachment {
    6.36 -        let mimeType = assetUrl.mimeType() ?? MimeTypeUtil.defaultMimeType
    6.37 +    private func createAttachment(forAssetWithUrl assetUrl: URL, image: UIImage) -> Attachment {
    6.38 +        let mimeType = mimeTypeUtils?.mimeType(fromURL: assetUrl) ?? MimeTypeUtils.MimesType.defaultMimeType
    6.39          return Attachment.createFromAsset(mimeType: mimeType,
    6.40                                            assetUrl: assetUrl,
    6.41                                            image: image,
     7.1 --- a/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Wed May 15 15:22:42 2019 +0200
     7.2 +++ b/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Fri May 17 14:08:50 2019 +0200
     7.3 @@ -37,7 +37,7 @@
     7.4          
     7.5          var theURL = tmpDir.appendingPathComponent(fileName)
     7.6  
     7.7 -        if attachment.mimeType == "application/pdf" {
     7.8 +        if attachment.mimeType == MimeTypeUtils.MimesType.pdf {
     7.9              theURL = theURL.appendingPathExtension("pdf")
    7.10          }
    7.11          do {
     8.1 --- a/pEpForiOS/UI/EmailDisplay/Background/AttachmentsViewOperation.swift	Wed May 15 15:22:42 2019 +0200
     8.2 +++ b/pEpForiOS/UI/EmailDisplay/Background/AttachmentsViewOperation.swift	Fri May 17 14:08:50 2019 +0200
     8.3 @@ -16,7 +16,7 @@
     8.4          case docAttachment(Attachment)
     8.5      }
     8.6  
     8.7 -    let mimeTypes: MimeTypeUtil?
     8.8 +    let mimeTypes: MimeTypeUtils?
     8.9      let message: Message
    8.10  
    8.11      /**
    8.12 @@ -29,7 +29,7 @@
    8.13       */
    8.14      var attachmentsCount = 0
    8.15  
    8.16 -    init(mimeTypes: MimeTypeUtil?, message: Message) {
    8.17 +    init(mimeTypes: MimeTypeUtils?, message: Message) {
    8.18          self.mimeTypes = mimeTypes
    8.19          self.message = message
    8.20  
     9.1 --- a/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Wed May 15 15:22:42 2019 +0200
     9.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Fri May 17 14:08:50 2019 +0200
     9.3 @@ -649,7 +649,8 @@
     9.4  
     9.5      func didCreateLocally(attachment: Attachment, url: URL, cell: MessageCell, location: CGPoint,
     9.6                            inView: UIView?) {
     9.7 -        if attachment.mimeType == "application/pdf" && QLPreviewController.canPreview(url as QLPreviewItem){
     9.8 +        if attachment.mimeType == MimeTypeUtils.MimesType.pdf
     9.9 +            && QLPreviewController.canPreview(url as QLPreviewItem){
    9.10                  selectedAttachmentURL = url
    9.11                  let previewController = QLPreviewController()
    9.12                  previewController.dataSource = self
    10.1 --- a/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Wed May 15 15:22:42 2019 +0200
    10.2 +++ b/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Fri May 17 14:08:50 2019 +0200
    10.3 @@ -66,7 +66,7 @@
    10.4              let fileExtesion: String?
    10.5          }
    10.6          public private(set) var attachments = [Attachment]()
    10.7 -        let mimeTypeUtil = MimeTypeUtil()
    10.8 +        let mimeTypeUtils = MimeTypeUtils()
    10.9  
   10.10          func count() -> Int {
   10.11              return attachments.count
   10.12 @@ -79,7 +79,7 @@
   10.13              }
   10.14              let attachment = attachments[index]
   10.15              return Row(fileName: attachment.fileName,
   10.16 -                       fileExtesion: mimeTypeUtil?.fileExtension(mimeType: attachment.mimeType) ?? "")
   10.17 +                       fileExtesion: mimeTypeUtils?.fileExtension(fromMimeType: attachment.mimeType) ?? "")
   10.18          }
   10.19  
   10.20          /// Adds an attachment to the data source and returns the index it has been inserted in.
    11.1 --- a/pEpForiOS/UI/EmailDisplay/Util/AttachmentsViewHelper.swift	Wed May 15 15:22:42 2019 +0200
    11.2 +++ b/pEpForiOS/UI/EmailDisplay/Util/AttachmentsViewHelper.swift	Fri May 17 14:08:50 2019 +0200
    11.3 @@ -29,7 +29,7 @@
    11.4          }
    11.5      }
    11.6  
    11.7 -    let mimeTypes = MimeTypeUtil()
    11.8 +    let mimeTypes = MimeTypeUtils()
    11.9      var buildOp: AttachmentsViewOperation?
   11.10      let operationQueue = OperationQueue()
   11.11  
   11.12 @@ -46,7 +46,7 @@
   11.13              attachment.fileName?.splitFileExtension() ?? (Constants.defaultFileName, nil)
   11.14          return AttachmentSummaryView.AttachmentInfo(
   11.15              filename: name.extractFileNameOrCid(),
   11.16 -            theExtension: ext ?? mimeTypes?.fileExtension(mimeType: attachment.mimeType))
   11.17 +            theExtension: ext ?? mimeTypes?.fileExtension(fromMimeType: attachment.mimeType))
   11.18      }
   11.19  
   11.20      func opFinished(theBuildOp: AttachmentsViewOperation) {
    12.1 --- a/pEpForiOS/UI/ManualLogin/InfoUserSettup/UserInfoTableViewController.swift	Wed May 15 15:22:42 2019 +0200
    12.2 +++ b/pEpForiOS/UI/ManualLogin/InfoUserSettup/UserInfoTableViewController.swift	Fri May 17 14:08:50 2019 +0200
    12.3 @@ -11,8 +11,6 @@
    12.4  import MessageModel
    12.5  
    12.6  class UserInfoTableViewController: BaseTableViewController, TextfieldResponder, UITextFieldDelegate {
    12.7 -    let comp = "UserInfoTableView"
    12.8 -
    12.9      @IBOutlet weak var emailValue: UITextField!
   12.10      @IBOutlet weak var usernameValue: UITextField!
   12.11      @IBOutlet weak var passwordValue: UITextField!
    13.1 --- a/pEpForiOS/Util/Constants.swift	Wed May 15 15:22:42 2019 +0200
    13.2 +++ b/pEpForiOS/Util/Constants.swift	Fri May 17 14:08:50 2019 +0200
    13.3 @@ -8,12 +8,8 @@
    13.4  
    13.5  import pEpIOSToolbox
    13.6  
    13.7 -extension Constants {
    13.8 -    /** Settings key for storing the email of the last used account */
    13.9 -    static let kSettingLastAccountEmail = "kSettingLastAccountEmail"
   13.10 -
   13.11 -    static let defaultFileName = NSLocalizedString("unnamed",
   13.12 -                                                   comment:
   13.13 +struct Constants {
   13.14 +    static let defaultFileName = NSLocalizedString("unnamed", comment:
   13.15          "file name used for unnamed attachments")
   13.16  
   13.17      /// Storyboard ID to instantiate ComposeViewController
    14.1 --- a/pEpForiOS/Util/Extensions/NSAttributedString+pEp.swift	Wed May 15 15:22:42 2019 +0200
    14.2 +++ b/pEpForiOS/Util/Extensions/NSAttributedString+pEp.swift	Fri May 17 14:08:50 2019 +0200
    14.3 @@ -13,7 +13,7 @@
    14.4  class ToMarkdownDelegate: NSAttributedStringParsingDelegate {
    14.5      var attachments = [Attachment]()
    14.6  
    14.7 -    private let mimeUtil = MimeTypeUtil()
    14.8 +    private lazy var mimeUtils = MimeTypeUtils()
    14.9  
   14.10      func stringFor(attachment: NSTextAttachment) -> String? {
   14.11          if let textAttachment = attachment as? TextAttachment,
   14.12 @@ -22,7 +22,7 @@
   14.13              let count = attachments.count
   14.14  
   14.15              let theID = MessageID.generateUUID()
   14.16 -            let theExt = mimeUtil?.fileExtension(mimeType: theAttachment.mimeType) ?? "jpg"
   14.17 +            let theExt = mimeUtils?.fileExtension(fromMimeType: theAttachment.mimeType) ?? "jpg"
   14.18              let cidBase = "attached-inline-image-\(count)-\(theExt)-\(theID)"
   14.19              let cidSrc = "cid:\(cidBase)"
   14.20              let cidUrl = "cid://\(cidBase)"
   14.21 @@ -38,10 +38,6 @@
   14.22          }
   14.23          return nil
   14.24      }
   14.25 -
   14.26 -    func stringFor(string: String) -> String? {
   14.27 -        return string
   14.28 -    }
   14.29  }
   14.30  
   14.31  extension NSAttributedString {
    15.1 --- a/pEpForiOS/Util/Extensions/URL+MIME.swift	Wed May 15 15:22:42 2019 +0200
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,17 +0,0 @@
    15.4 -//
    15.5 -//  URL+MIME.swift
    15.6 -//  pEp
    15.7 -//
    15.8 -//  Created by Andreas Buff on 24.11.17.
    15.9 -//  Copyright © 2017 p≡p Security S.A. All rights reserved.
   15.10 -//
   15.11 -
   15.12 -import Foundation
   15.13 -
   15.14 -import MessageModel
   15.15 -
   15.16 -extension URL {
   15.17 -    public func mimeType() -> String? {
   15.18 -        return MimeTypeUtil()?.mimeType(fileExtension: self.pathExtension)
   15.19 -    }
   15.20 -}
    16.1 --- a/pEpForiOS/Util/jsonMimeType.txt	Wed May 15 15:22:42 2019 +0200
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,855 +0,0 @@
    16.4 -{
    16.5 -"mimeType" : {
    16.6 -"" : "DEFAULT_ATTACHMENT_MIME_TYPE" ,
    16.7 -"k9s" : "K9_SETTINGS_MIME_TYPE",
    16.8 -"txt" : "text/plain",
    16.9 -"123" : "application/vnd.lotus-1-2-3",
   16.10 -"323" : "text/h323",
   16.11 -"3dml" : "text/vnd.in3d.3dml",
   16.12 -"3g2" : "video/3gpp2",
   16.13 -"3gp" : "video/3gpp",
   16.14 -"aab" : "application/x-authorware-bin",
   16.15 -"aac" : "audio/x-aac",
   16.16 -"aam" : "application/x-authorware-map",
   16.17 -"a" : "application/octet-stream",
   16.18 -"aas" : "application/x-authorware-seg",
   16.19 -"abw" : "application/x-abiword",
   16.20 -"acc" : "application/vnd.americandynamics.acc",
   16.21 -"ace" : "application/x-ace-compressed",
   16.22 -"acu" : "application/vnd.acucobol",
   16.23 -"acutc" : "application/vnd.acucorp",
   16.24 -"acx" : "application/internet-property-stream",
   16.25 -"adp" : "audio/adpcm",
   16.26 -"aep" : "application/vnd.audiograph",
   16.27 -"afm" : "application/x-font-type1",
   16.28 -"afp" : "application/vnd.ibm.modcap",
   16.29 -"ai" : "application/postscript",
   16.30 -"aif" : "audio/x-aiff",
   16.31 -"aifc" : "audio/x-aiff",
   16.32 -"aiff" : "audio/x-aiff",
   16.33 -"air" : "application/vnd.adobe.air-application-installer-package+zip",
   16.34 -"ami" : "application/vnd.amiga.ami",
   16.35 -"apk" : "application/vnd.android.package-archive",
   16.36 -"application" : "application/x-ms-application",
   16.37 -"apr" : "application/vnd.lotus-approach",
   16.38 -"asc" : "application/pgp-signature",
   16.39 -"asf" : "video/x-ms-asf",
   16.40 -"asm" : "text/x-asm",
   16.41 -"aso" : "application/vnd.accpac.simply.aso",
   16.42 -"asr" : "video/x-ms-asf",
   16.43 -"asx" : "video/x-ms-asf",
   16.44 -"atc" : "application/vnd.acucorp",
   16.45 -"atom" : "application/atom+xml",
   16.46 -"atomcat" : "application/atomcat+xml",
   16.47 -"atomsvc" : "application/atomsvc+xml",
   16.48 -"atx" : "application/vnd.antix.game-component",
   16.49 -"au" : "audio/basic",
   16.50 -"avi" : "video/x-msvideo",
   16.51 -"aw" : "application/applixware",
   16.52 -"axs" : "application/olescript",
   16.53 -"azf" : "application/vnd.airzip.filesecure.azf",
   16.54 -"azs" : "application/vnd.airzip.filesecure.azs",
   16.55 -"azw" : "application/vnd.amazon.ebook",
   16.56 -"bas" : "text/plain",
   16.57 -"bat" : "application/x-msdownload",
   16.58 -"bcpio" : "application/x-bcpio",
   16.59 -"bdf" : "application/x-font-bdf",
   16.60 -"bdm" : "application/vnd.syncml.dm+wbxml",
   16.61 -"bh2" : "application/vnd.fujitsu.oasysprs",
   16.62 -"bin" : "application/octet-stream",
   16.63 -"bmi" : "application/vnd.bmi",
   16.64 -"bmp" : "image/bmp",
   16.65 -"book" : "application/vnd.framemaker",
   16.66 -"box" : "application/vnd.previewsystems.box",
   16.67 -"boz" : "application/x-bzip2",
   16.68 -"bpk" : "application/octet-stream",
   16.69 -"btif" : "image/prs.btif",
   16.70 -"bz2" : "application/x-bzip2",
   16.71 -"bz" : "application/x-bzip",
   16.72 -"c4d" : "application/vnd.clonk.c4group",
   16.73 -"c4f" : "application/vnd.clonk.c4group",
   16.74 -"c4g" : "application/vnd.clonk.c4group",
   16.75 -"c4p" : "application/vnd.clonk.c4group",
   16.76 -"c4u" : "application/vnd.clonk.c4group",
   16.77 -"cab" : "application/vnd.ms-cab-compressed",
   16.78 -"car" : "application/vnd.curl.car",
   16.79 -"cat" : "application/vnd.ms-pki.seccat",
   16.80 -"cct" : "application/x-director",
   16.81 -"cc" : "text/x-c",
   16.82 -"ccxml" : "application/ccxml+xml",
   16.83 -"cdbcmsg" : "application/vnd.contact.cmsg",
   16.84 -"cdf" : "application/x-cdf",
   16.85 -"cdkey" : "application/vnd.mediastation.cdkey",
   16.86 -"cdx" : "chemical/x-cdx",
   16.87 -"cdxml" : "application/vnd.chemdraw+xml",
   16.88 -"cdy" : "application/vnd.cinderella",
   16.89 -"cer" : "application/x-x509-ca-cert",
   16.90 -"cgm" : "image/cgm",
   16.91 -"chat" : "application/x-chat",
   16.92 -"chm" : "application/vnd.ms-htmlhelp",
   16.93 -"chrt" : "application/vnd.kde.kchart",
   16.94 -"cif" : "chemical/x-cif",
   16.95 -"cii" : "application/vnd.anser-web-certificate-issue-initiation",
   16.96 -"cla" : "application/vnd.claymore",
   16.97 -"class" : "application/java-vm",
   16.98 -"clkk" : "application/vnd.crick.clicker.keyboard",
   16.99 -"clkp" : "application/vnd.crick.clicker.palette",
  16.100 -"clkt" : "application/vnd.crick.clicker.template",
  16.101 -"clkw" : "application/vnd.crick.clicker.wordbank",
  16.102 -"clkx" : "application/vnd.crick.clicker",
  16.103 -"clp" : "application/x-msclip",
  16.104 -"cmc" : "application/vnd.cosmocaller",
  16.105 -"cmdf" : "chemical/x-cmdf",
  16.106 -"cml" : "chemical/x-cml",
  16.107 -"cmp" : "application/vnd.yellowriver-custom-menu",
  16.108 -"cmx" : "image/x-cmx",
  16.109 -"cod" : "application/vnd.rim.cod",
  16.110 -"com" : "application/x-msdownload",
  16.111 -"conf" : "text/plain",
  16.112 -"cpio" : "application/x-cpio",
  16.113 -"cpp" : "text/x-c",
  16.114 -"cpt" : "application/mac-compactpro",
  16.115 -"crd" : "application/x-mscardfile",
  16.116 -"crl" : "application/pkix-crl",
  16.117 -"crt" : "application/x-x509-ca-cert",
  16.118 -"csh" : "application/x-csh",
  16.119 -"csml" : "chemical/x-csml",
  16.120 -"csp" : "application/vnd.commonspace",
  16.121 -"css" : "text/css",
  16.122 -"cst" : "application/x-director",
  16.123 -"csv" : "text/csv",
  16.124 -"c" : "text/plain",
  16.125 -"cu" : "application/cu-seeme",
  16.126 -"curl" : "text/vnd.curl",
  16.127 -"cww" : "application/prs.cww",
  16.128 -"cxt" : "application/x-director",
  16.129 -"cxx" : "text/x-c",
  16.130 -"daf" : "application/vnd.mobius.daf",
  16.131 -"dataless" : "application/vnd.fdsn.seed",
  16.132 -"davmount" : "application/davmount+xml",
  16.133 -"dcr" : "application/x-director",
  16.134 -"dcurl" : "text/vnd.curl.dcurl",
  16.135 -"dd2" : "application/vnd.oma.dd2+xml",
  16.136 -"ddd" : "application/vnd.fujixerox.ddd",
  16.137 -"deb" : "application/x-debian-package",
  16.138 -"def" : "text/plain",
  16.139 -"deploy" : "application/octet-stream",
  16.140 -"der" : "application/x-x509-ca-cert",
  16.141 -"dfac" : "application/vnd.dreamfactory",
  16.142 -"dic" : "text/x-c",
  16.143 -"diff" : "text/plain",
  16.144 -"dir" : "application/x-director",
  16.145 -"dis" : "application/vnd.mobius.dis",
  16.146 -"dist" : "application/octet-stream",
  16.147 -"distz" : "application/octet-stream",
  16.148 -"djv" : "image/vnd.djvu",
  16.149 -"djvu" : "image/vnd.djvu",
  16.150 -"dll" : "application/x-msdownload",
  16.151 -"dmg" : "application/octet-stream",
  16.152 -"dms" : "application/octet-stream",
  16.153 -"dna" : "application/vnd.dna",
  16.154 -"doc" : "application/msword",
  16.155 -"docm" : "application/vnd.ms-word.document.macroenabled.12",
  16.156 -"docx" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  16.157 -"dot" : "application/msword",
  16.158 -"dotm" : "application/vnd.ms-word.template.macroenabled.12",
  16.159 -"dotx" : "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
  16.160 -"dp" : "application/vnd.osgi.dp",
  16.161 -"dpg" : "application/vnd.dpgraph",
  16.162 -"dsc" : "text/prs.lines.tag",
  16.163 -"dtb" : "application/x-dtbook+xml",
  16.164 -"dtd" : "application/xml-dtd",
  16.165 -"dts" : "audio/vnd.dts",
  16.166 -"dtshd" : "audio/vnd.dts.hd",
  16.167 -"dump" : "application/octet-stream",
  16.168 -"dvi" : "application/x-dvi",
  16.169 -"dwf" : "model/vnd.dwf",
  16.170 -"dwg" : "image/vnd.dwg",
  16.171 -"dxf" : "image/vnd.dxf",
  16.172 -"dxp" : "application/vnd.spotfire.dxp",
  16.173 -"dxr" : "application/x-director",
  16.174 -"ecelp4800" : "audio/vnd.nuera.ecelp4800",
  16.175 -"ecelp7470" : "audio/vnd.nuera.ecelp7470",
  16.176 -"ecelp9600" : "audio/vnd.nuera.ecelp9600",
  16.177 -"ecma" : "application/ecmascript",
  16.178 -"edm" : "application/vnd.novadigm.edm",
  16.179 -"edx" : "application/vnd.novadigm.edx",
  16.180 -"efif" : "application/vnd.picsel",
  16.181 -"ei6" : "application/vnd.pg.osasli",
  16.182 -"elc" : "application/octet-stream",
  16.183 -"eml" : "message/rfc822",
  16.184 -"emma" : "application/emma+xml",
  16.185 -"eol" : "audio/vnd.digital-winds",
  16.186 -"eot" : "application/vnd.ms-fontobject",
  16.187 -"eps" : "application/postscript",
  16.188 -"epub" : "application/epub+zip",
  16.189 -"es3" : "application/vnd.eszigno3+xml",
  16.190 -"esf" : "application/vnd.epson.esf",
  16.191 -"espass" : "application/vnd.espass-espass+zip",
  16.192 -"et3" : "application/vnd.eszigno3+xml",
  16.193 -"etx" : "text/x-setext",
  16.194 -"evy" : "application/envoy",
  16.195 -"exe" : "application/octet-stream",
  16.196 -"ext" : "application/vnd.novadigm.ext",
  16.197 -"ez2" : "application/vnd.ezpix-album",
  16.198 -"ez3" : "application/vnd.ezpix-package",
  16.199 -"ez" : "application/andrew-inset",
  16.200 -"f4v" : "video/x-f4v",
  16.201 -"f77" : "text/x-fortran",
  16.202 -"f90" : "text/x-fortran",
  16.203 -"fbs" : "image/vnd.fastbidsheet",
  16.204 -"fdf" : "application/vnd.fdf",
  16.205 -"fe_launch" : "application/vnd.denovo.fcselayout-link",
  16.206 -"fg5" : "application/vnd.fujitsu.oasysgp",
  16.207 -"fgd" : "application/x-director",
  16.208 -"fh4" : "image/x-freehand",
  16.209 -"fh5" : "image/x-freehand",
  16.210 -"fh7" : "image/x-freehand",
  16.211 -"fhc" : "image/x-freehand",
  16.212 -"fh" : "image/x-freehand",
  16.213 -"fif" : "application/fractals",
  16.214 -"fig" : "application/x-xfig",
  16.215 -"fli" : "video/x-fli",
  16.216 -"flo" : "application/vnd.micrografx.flo",
  16.217 -"flr" : "x-world/x-vrml",
  16.218 -"flv" : "video/x-flv",
  16.219 -"flw" : "application/vnd.kde.kivio",
  16.220 -"flx" : "text/vnd.fmi.flexstor",
  16.221 -"fly" : "text/vnd.fly",
  16.222 -"fm" : "application/vnd.framemaker",
  16.223 -"fnc" : "application/vnd.frogans.fnc",
  16.224 -"for" : "text/x-fortran",
  16.225 -"fpx" : "image/vnd.fpx",
  16.226 -"frame" : "application/vnd.framemaker",
  16.227 -"fsc" : "application/vnd.fsc.weblaunch",
  16.228 -"fst" : "image/vnd.fst",
  16.229 -"ftc" : "application/vnd.fluxtime.clip",
  16.230 -"f" : "text/x-fortran",
  16.231 -"fti" : "application/vnd.anser-web-funds-transfer-initiation",
  16.232 -"fvt" : "video/vnd.fvt",
  16.233 -"fzs" : "application/vnd.fuzzysheet",
  16.234 -"g3" : "image/g3fax",
  16.235 -"gac" : "application/vnd.groove-account",
  16.236 -"gdl" : "model/vnd.gdl",
  16.237 -"geo" : "application/vnd.dynageo",
  16.238 -"gex" : "application/vnd.geometry-explorer",
  16.239 -"ggb" : "application/vnd.geogebra.file",
  16.240 -"ggt" : "application/vnd.geogebra.tool",
  16.241 -"ghf" : "application/vnd.groove-help",
  16.242 -"gif" : "image/gif",
  16.243 -"gim" : "application/vnd.groove-identity-message",
  16.244 -"gmx" : "application/vnd.gmx",
  16.245 -"gnumeric" : "application/x-gnumeric",
  16.246 -"gph" : "application/vnd.flographit",
  16.247 -"gqf" : "application/vnd.grafeq",
  16.248 -"gqs" : "application/vnd.grafeq",
  16.249 -"gram" : "application/srgs",
  16.250 -"gre" : "application/vnd.geometry-explorer",
  16.251 -"grv" : "application/vnd.groove-injector",
  16.252 -"grxml" : "application/srgs+xml",
  16.253 -"gsf" : "application/x-font-ghostscript",
  16.254 -"gtar" : "application/x-gtar",
  16.255 -"gtm" : "application/vnd.groove-tool-message",
  16.256 -"gtw" : "model/vnd.gtw",
  16.257 -"gv" : "text/vnd.graphviz",
  16.258 -"gz" : "application/x-gzip",
  16.259 -"h261" : "video/h261",
  16.260 -"h263" : "video/h263",
  16.261 -"h264" : "video/h264",
  16.262 -"hbci" : "application/vnd.hbci",
  16.263 -"hdf" : "application/x-hdf",
  16.264 -"hh" : "text/x-c",
  16.265 -"hlp" : "application/winhlp",
  16.266 -"hpgl" : "application/vnd.hp-hpgl",
  16.267 -"hpid" : "application/vnd.hp-hpid",
  16.268 -"hps" : "application/vnd.hp-hps",
  16.269 -"hqx" : "application/mac-binhex40",
  16.270 -"hta" : "application/hta",
  16.271 -"htc" : "text/x-component",
  16.272 -"h" : "text/plain",
  16.273 -"htke" : "application/vnd.kenameaapp",
  16.274 -"html" : "text/html",
  16.275 -"htm" : "text/html",
  16.276 -"htt" : "text/webviewhtml",
  16.277 -"hvd" : "application/vnd.yamaha.hv-dic",
  16.278 -"hvp" : "application/vnd.yamaha.hv-voice",
  16.279 -"hvs" : "application/vnd.yamaha.hv-script",
  16.280 -"icc" : "application/vnd.iccprofile",
  16.281 -"ice" : "x-conference/x-cooltalk",
  16.282 -"icm" : "application/vnd.iccprofile",
  16.283 -"ico" : "image/x-icon",
  16.284 -"ics" : "text/calendar",
  16.285 -"ief" : "image/ief",
  16.286 -"ifb" : "text/calendar",
  16.287 -"ifm" : "application/vnd.shana.informed.formdata",
  16.288 -"iges" : "model/iges",
  16.289 -"igl" : "application/vnd.igloader",
  16.290 -"igs" : "model/iges",
  16.291 -"igx" : "application/vnd.micrografx.igx",
  16.292 -"iif" : "application/vnd.shana.informed.interchange",
  16.293 -"iii" : "application/x-iphone",
  16.294 -"imp" : "application/vnd.accpac.simply.imp",
  16.295 -"ims" : "application/vnd.ms-ims",
  16.296 -"ins" : "application/x-internet-signup",
  16.297 -"in" : "text/plain",
  16.298 -"ipk" : "application/vnd.shana.informed.package",
  16.299 -"irm" : "application/vnd.ibm.rights-management",
  16.300 -"irp" : "application/vnd.irepository.package+xml",
  16.301 -"iso" : "application/octet-stream",
  16.302 -"isp" : "application/x-internet-signup",
  16.303 -"itp" : "application/vnd.shana.informed.formtemplate",
  16.304 -"ivp" : "application/vnd.immervision-ivp",
  16.305 -"ivu" : "application/vnd.immervision-ivu",
  16.306 -"jad" : "text/vnd.sun.j2me.app-descriptor",
  16.307 -"jam" : "application/vnd.jam",
  16.308 -"jar" : "application/java-archive",
  16.309 -"java" : "text/x-java-source",
  16.310 -"jfif" : "image/pipeg",
  16.311 -"jisp" : "application/vnd.jisp",
  16.312 -"jlt" : "application/vnd.hp-jlyt",
  16.313 -"jnlp" : "application/x-java-jnlp-file",
  16.314 -"joda" : "application/vnd.joost.joda-archive",
  16.315 -"jpeg" : "image/jpeg",
  16.316 -"jpe" : "image/jpeg",
  16.317 -"jpg" : "image/jpeg",
  16.318 -"jpgm" : "video/jpm",
  16.319 -"jpgv" : "video/jpeg",
  16.320 -"jpm" : "video/jpm",
  16.321 -"js" : "application/x-javascript",
  16.322 -"json" : "application/json",
  16.323 -"kar" : "audio/midi",
  16.324 -"karbon" : "application/vnd.kde.karbon",
  16.325 -"kfo" : "application/vnd.kde.kformula",
  16.326 -"kia" : "application/vnd.kidspiration",
  16.327 -"kil" : "application/x-killustrator",
  16.328 -"kml" : "application/vnd.google-earth.kml+xml",
  16.329 -"kmz" : "application/vnd.google-earth.kmz",
  16.330 -"kne" : "application/vnd.kinar",
  16.331 -"knp" : "application/vnd.kinar",
  16.332 -"kon" : "application/vnd.kde.kontour",
  16.333 -"kpr" : "application/vnd.kde.kpresenter",
  16.334 -"kpt" : "application/vnd.kde.kpresenter",
  16.335 -"ksh" : "text/plain",
  16.336 -"ksp" : "application/vnd.kde.kspread",
  16.337 -"ktr" : "application/vnd.kahootz",
  16.338 -"ktz" : "application/vnd.kahootz",
  16.339 -"kwd" : "application/vnd.kde.kword",
  16.340 -"kwt" : "application/vnd.kde.kword",
  16.341 -"latex" : "application/x-latex",
  16.342 -"lbd" : "application/vnd.llamagraphics.life-balance.desktop",
  16.343 -"lbe" : "application/vnd.llamagraphics.life-balance.exchange+xml",
  16.344 -"les" : "application/vnd.hhe.lesson-player",
  16.345 -"lha" : "application/octet-stream",
  16.346 -"link66" : "application/vnd.route66.link66+xml",
  16.347 -"list3820" : "application/vnd.ibm.modcap",
  16.348 -"listafp" : "application/vnd.ibm.modcap",
  16.349 -"list" : "text/plain",
  16.350 -"log" : "text/plain",
  16.351 -"lostxml" : "application/lost+xml",
  16.352 -"lrf" : "application/octet-stream",
  16.353 -"lrm" : "application/vnd.ms-lrm",
  16.354 -"lsf" : "video/x-la-asf",
  16.355 -"lsx" : "video/x-la-asf",
  16.356 -"ltf" : "application/vnd.frogans.ltf",
  16.357 -"lvp" : "audio/vnd.lucent.voice",
  16.358 -"lwp" : "application/vnd.lotus-wordpro",
  16.359 -"lzh" : "application/octet-stream",
  16.360 -"m13" : "application/x-msmediaview",
  16.361 -"m14" : "application/x-msmediaview",
  16.362 -"m1v" : "video/mpeg",
  16.363 -"m2a" : "audio/mpeg",
  16.364 -"m2v" : "video/mpeg",
  16.365 -"m3a" : "audio/mpeg",
  16.366 -"m3u" : "audio/x-mpegurl",
  16.367 -"m4u" : "video/vnd.mpegurl",
  16.368 -"m4v" : "video/x-m4v",
  16.369 -"ma" : "application/mathematica",
  16.370 -"mag" : "application/vnd.ecowin.chart",
  16.371 -"maker" : "application/vnd.framemaker",
  16.372 -"man" : "text/troff",
  16.373 -"mathml" : "application/mathml+xml",
  16.374 -"mb" : "application/mathematica",
  16.375 -"mbk" : "application/vnd.mobius.mbk",
  16.376 -"mbox" : "application/mbox",
  16.377 -"mc1" : "application/vnd.medcalcdata",
  16.378 -"mcd" : "application/vnd.mcd",
  16.379 -"mcurl" : "text/vnd.curl.mcurl",
  16.380 -"mdb" : "application/x-msaccess",
  16.381 -"mdi" : "image/vnd.ms-modi",
  16.382 -"mesh" : "model/mesh",
  16.383 -"me" : "text/troff",
  16.384 -"mfm" : "application/vnd.mfmp",
  16.385 -"mgz" : "application/vnd.proteus.magazine",
  16.386 -"mht" : "message/rfc822",
  16.387 -"mhtml" : "message/rfc822",
  16.388 -"mid" : "audio/midi",
  16.389 -"midi" : "audio/midi",
  16.390 -"mif" : "application/vnd.mif",
  16.391 -"mime" : "message/rfc822",
  16.392 -"mj2" : "video/mj2",
  16.393 -"mjp2" : "video/mj2",
  16.394 -"mlp" : "application/vnd.dolby.mlp",
  16.395 -"mmd" : "application/vnd.chipnuts.karaoke-mmd",
  16.396 -"mmf" : "application/vnd.smaf",
  16.397 -"mmr" : "image/vnd.fujixerox.edmics-mmr",
  16.398 -"mny" : "application/x-msmoney",
  16.399 -"mobi" : "application/x-mobipocket-ebook",
  16.400 -"movie" : "video/x-sgi-movie",
  16.401 -"mov" : "video/quicktime",
  16.402 -"mp2a" : "audio/mpeg",
  16.403 -"mp2" : "video/mpeg",
  16.404 -"mp3" : "audio/mpeg",
  16.405 -"mp4a" : "audio/mp4",
  16.406 -"mp4s" : "application/mp4",
  16.407 -"mp4" : "video/mp4",
  16.408 -"mp4v" : "video/mp4",
  16.409 -"mpa" : "video/mpeg",
  16.410 -"mpc" : "application/vnd.mophun.certificate",
  16.411 -"mpeg" : "video/mpeg",
  16.412 -"mpe" : "video/mpeg",
  16.413 -"mpg4" : "video/mp4",
  16.414 -"mpga" : "audio/mpeg",
  16.415 -"mpg" : "video/mpeg",
  16.416 -"mpkg" : "application/vnd.apple.installer+xml",
  16.417 -"mpm" : "application/vnd.blueice.multipass",
  16.418 -"mpn" : "application/vnd.mophun.application",
  16.419 -"mpp" : "application/vnd.ms-project",
  16.420 -"mpt" : "application/vnd.ms-project",
  16.421 -"mpv2" : "video/mpeg",
  16.422 -"mpy" : "application/vnd.ibm.minipay",
  16.423 -"mqy" : "application/vnd.mobius.mqy",
  16.424 -"mrc" : "application/marc",
  16.425 -"mscml" : "application/mediaservercontrol+xml",
  16.426 -"mseed" : "application/vnd.fdsn.mseed",
  16.427 -"mseq" : "application/vnd.mseq",
  16.428 -"msf" : "application/vnd.epson.msf",
  16.429 -"msh" : "model/mesh",
  16.430 -"msi" : "application/x-msdownload",
  16.431 -"ms" : "text/troff",
  16.432 -"msty" : "application/vnd.muvee.style",
  16.433 -"mts" : "model/vnd.mts",
  16.434 -"mus" : "application/vnd.musician",
  16.435 -"musicxml" : "application/vnd.recordare.musicxml+xml",
  16.436 -"mvb" : "application/x-msmediaview",
  16.437 -"mxf" : "application/mxf",
  16.438 -"mxl" : "application/vnd.recordare.musicxml",
  16.439 -"mxml" : "application/xv+xml",
  16.440 -"mxs" : "application/vnd.triscape.mxs",
  16.441 -"mxu" : "video/vnd.mpegurl",
  16.442 -"nb" : "application/mathematica",
  16.443 -"nc" : "application/x-netcdf",
  16.444 -"ncx" : "application/x-dtbncx+xml",
  16.445 -"n-gage" : "application/vnd.nokia.n-gage.symbian.install",
  16.446 -"ngdat" : "application/vnd.nokia.n-gage.data",
  16.447 -"nlu" : "application/vnd.neurolanguage.nlu",
  16.448 -"nml" : "application/vnd.enliven",
  16.449 -"nnd" : "application/vnd.noblenet-directory",
  16.450 -"nns" : "application/vnd.noblenet-sealer",
  16.451 -"nnw" : "application/vnd.noblenet-web",
  16.452 -"npx" : "image/vnd.net-fpx",
  16.453 -"nsf" : "application/vnd.lotus-notes",
  16.454 -"nws" : "message/rfc822",
  16.455 -"oa2" : "application/vnd.fujitsu.oasys2",
  16.456 -"oa3" : "application/vnd.fujitsu.oasys3",
  16.457 -"o" : "application/octet-stream",
  16.458 -"oas" : "application/vnd.fujitsu.oasys",
  16.459 -"obd" : "application/x-msbinder",
  16.460 -"obj" : "application/octet-stream",
  16.461 -"oda" : "application/oda",
  16.462 -"odb" : "application/vnd.oasis.opendocument.database",
  16.463 -"odc" : "application/vnd.oasis.opendocument.chart",
  16.464 -"odf" : "application/vnd.oasis.opendocument.formula",
  16.465 -"odft" : "application/vnd.oasis.opendocument.formula-template",
  16.466 -"odg" : "application/vnd.oasis.opendocument.graphics",
  16.467 -"odi" : "application/vnd.oasis.opendocument.image",
  16.468 -"odp" : "application/vnd.oasis.opendocument.presentation",
  16.469 -"ods" : "application/vnd.oasis.opendocument.spreadsheet",
  16.470 -"odt" : "application/vnd.oasis.opendocument.text",
  16.471 -"oga" : "audio/ogg",
  16.472 -"ogg" : "audio/ogg",
  16.473 -"ogv" : "video/ogg",
  16.474 -"ogx" : "application/ogg",
  16.475 -"onepkg" : "application/onenote",
  16.476 -"onetmp" : "application/onenote",
  16.477 -"onetoc2" : "application/onenote",
  16.478 -"onetoc" : "application/onenote",
  16.479 -"opf" : "application/oebps-package+xml",
  16.480 -"oprc" : "application/vnd.palm",
  16.481 -"org" : "application/vnd.lotus-organizer",
  16.482 -"osf" : "application/vnd.yamaha.openscoreformat",
  16.483 -"osfpvg" : "application/vnd.yamaha.openscoreformat.osfpvg+xml",
  16.484 -"otc" : "application/vnd.oasis.opendocument.chart-template",
  16.485 -"otf" : "application/x-font-otf",
  16.486 -"otg" : "application/vnd.oasis.opendocument.graphics-template",
  16.487 -"oth" : "application/vnd.oasis.opendocument.text-web",
  16.488 -"oti" : "application/vnd.oasis.opendocument.image-template",
  16.489 -"otm" : "application/vnd.oasis.opendocument.text-master",
  16.490 -"otp" : "application/vnd.oasis.opendocument.presentation-template",
  16.491 -"ots" : "application/vnd.oasis.opendocument.spreadsheet-template",
  16.492 -"ott" : "application/vnd.oasis.opendocument.text-template",
  16.493 -"oxt" : "application/vnd.openofficeorg.extension",
  16.494 -"p10" : "application/pkcs10",
  16.495 -"p12" : "application/x-pkcs12",
  16.496 -"p7b" : "application/x-pkcs7-certificates",
  16.497 -"p7c" : "application/x-pkcs7-mime",
  16.498 -"p7m" : "application/x-pkcs7-mime",
  16.499 -"p7r" : "application/x-pkcs7-certreqresp",
  16.500 -"p7s" : "application/x-pkcs7-signature",
  16.501 -"pas" : "text/x-pascal",
  16.502 -"pbd" : "application/vnd.powerbuilder6",
  16.503 -"pbm" : "image/x-portable-bitmap",
  16.504 -"pcf" : "application/x-font-pcf",
  16.505 -"pcl" : "application/vnd.hp-pcl",
  16.506 -"pclxl" : "application/vnd.hp-pclxl",
  16.507 -"pct" : "image/x-pict",
  16.508 -"pcurl" : "application/vnd.curl.pcurl",
  16.509 -"pcx" : "image/x-pcx",
  16.510 -"pdb" : "application/vnd.palm",
  16.511 -"pdf" : "application/pdf",
  16.512 -"pfa" : "application/x-font-type1",
  16.513 -"pfb" : "application/x-font-type1",
  16.514 -"pfm" : "application/x-font-type1",
  16.515 -"pfr" : "application/font-tdpfr",
  16.516 -"pfx" : "application/x-pkcs12",
  16.517 -"pgm" : "image/x-portable-graymap",
  16.518 -"pgn" : "application/x-chess-pgn",
  16.519 -"pgp" : "application/pgp-encrypted",
  16.520 -"pic" : "image/x-pict",
  16.521 -"pkg" : "application/octet-stream",
  16.522 -"pki" : "application/pkixcmp",
  16.523 -"pkipath" : "application/pkix-pkipath",
  16.524 -"pkpass" : "application/vnd-com.apple.pkpass",
  16.525 -"pko" : "application/ynd.ms-pkipko",
  16.526 -"plb" : "application/vnd.3gpp.pic-bw-large",
  16.527 -"plc" : "application/vnd.mobius.plc",
  16.528 -"plf" : "application/vnd.pocketlearn",
  16.529 -"pls" : "application/pls+xml",
  16.530 -"pl" : "text/plain",
  16.531 -"pma" : "application/x-perfmon",
  16.532 -"pmc" : "application/x-perfmon",
  16.533 -"pml" : "application/x-perfmon",
  16.534 -"pmr" : "application/x-perfmon",
  16.535 -"pmw" : "application/x-perfmon",
  16.536 -"png" : "image/png",
  16.537 -"pnm" : "image/x-portable-anymap",
  16.538 -"portpkg" : "application/vnd.macports.portpkg",
  16.539 -"pot," : "application/vnd.ms-powerpoint",
  16.540 -"pot" : "application/vnd.ms-powerpoint",
  16.541 -"potm" : "application/vnd.ms-powerpoint.template.macroenabled.12",
  16.542 -"potx" : "application/vnd.openxmlformats-officedocument.presentationml.template",
  16.543 -"ppa" : "application/vnd.ms-powerpoint",
  16.544 -"ppam" : "application/vnd.ms-powerpoint.addin.macroenabled.12",
  16.545 -"ppd" : "application/vnd.cups-ppd",
  16.546 -"ppm" : "image/x-portable-pixmap",
  16.547 -"pps" : "application/vnd.ms-powerpoint",
  16.548 -"ppsm" : "application/vnd.ms-powerpoint.slideshow.macroenabled.12",
  16.549 -"ppsx" : "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
  16.550 -"ppt" : "application/vnd.ms-powerpoint",
  16.551 -"pptm" : "application/vnd.ms-powerpoint.presentation.macroenabled.12",
  16.552 -"pptx" : "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  16.553 -"pqa" : "application/vnd.palm",
  16.554 -"prc" : "application/x-mobipocket-ebook",
  16.555 -"pre" : "application/vnd.lotus-freelance",
  16.556 -"prf" : "application/pics-rules",
  16.557 -"ps" : "application/postscript",
  16.558 -"psb" : "application/vnd.3gpp.pic-bw-small",
  16.559 -"psd" : "image/vnd.adobe.photoshop",
  16.560 -"psf" : "application/x-font-linux-psf",
  16.561 -"p" : "text/x-pascal",
  16.562 -"ptid" : "application/vnd.pvi.ptid1",
  16.563 -"pub" : "application/x-mspublisher",
  16.564 -"pvb" : "application/vnd.3gpp.pic-bw-var",
  16.565 -"pwn" : "application/vnd.3m.post-it-notes",
  16.566 -"pwz" : "application/vnd.ms-powerpoint",
  16.567 -"pya" : "audio/vnd.ms-playready.media.pya",
  16.568 -"pyc" : "application/x-python-code",
  16.569 -"pyo" : "application/x-python-code",
  16.570 -"py" : "text/x-python",
  16.571 -"pyv" : "video/vnd.ms-playready.media.pyv",
  16.572 -"qam" : "application/vnd.epson.quickanime",
  16.573 -"qbo" : "application/vnd.intu.qbo",
  16.574 -"qfx" : "application/vnd.intu.qfx",
  16.575 -"qps" : "application/vnd.publishare-delta-tree",
  16.576 -"qt" : "video/quicktime",
  16.577 -"qwd" : "application/vnd.quark.quarkxpress",
  16.578 -"qwt" : "application/vnd.quark.quarkxpress",
  16.579 -"qxb" : "application/vnd.quark.quarkxpress",
  16.580 -"qxd" : "application/vnd.quark.quarkxpress",
  16.581 -"qxl" : "application/vnd.quark.quarkxpress",
  16.582 -"qxt" : "application/vnd.quark.quarkxpress",
  16.583 -"ra" : "audio/x-pn-realaudio",
  16.584 -"ram" : "audio/x-pn-realaudio",
  16.585 -"rar" : "application/x-rar-compressed",
  16.586 -"ras" : "image/x-cmu-raster",
  16.587 -"rcprofile" : "application/vnd.ipunplugged.rcprofile",
  16.588 -"rdf" : "application/rdf+xml",
  16.589 -"rdz" : "application/vnd.data-vision.rdz",
  16.590 -"rep" : "application/vnd.businessobjects",
  16.591 -"res" : "application/x-dtbresource+xml",
  16.592 -"rgb" : "image/x-rgb",
  16.593 -"rif" : "application/reginfo+xml",
  16.594 -"rl" : "application/resource-lists+xml",
  16.595 -"rlc" : "image/vnd.fujixerox.edmics-rlc",
  16.596 -"rld" : "application/resource-lists-diff+xml",
  16.597 -"rm" : "application/vnd.rn-realmedia",
  16.598 -"rmi" : "audio/midi",
  16.599 -"rmp" : "audio/x-pn-realaudio-plugin",
  16.600 -"rms" : "application/vnd.jcp.javame.midlet-rms",
  16.601 -"rnc" : "application/relax-ng-compact-syntax",
  16.602 -"roff" : "text/troff",
  16.603 -"rpm" : "application/x-rpm",
  16.604 -"rpss" : "application/vnd.nokia.radio-presets",
  16.605 -"rpst" : "application/vnd.nokia.radio-preset",
  16.606 -"rq" : "application/sparql-query",
  16.607 -"rs" : "application/rls-services+xml",
  16.608 -"rsd" : "application/rsd+xml",
  16.609 -"rss" : "application/rss+xml",
  16.610 -"rtf" : "application/rtf",
  16.611 -"rtx" : "text/richtext",
  16.612 -"saf" : "application/vnd.yamaha.smaf-audio",
  16.613 -"sbml" : "application/sbml+xml",
  16.614 -"sc" : "application/vnd.ibm.secure-container",
  16.615 -"scd" : "application/x-msschedule",
  16.616 -"scm" : "application/vnd.lotus-screencam",
  16.617 -"scq" : "application/scvp-cv-request",
  16.618 -"scs" : "application/scvp-cv-response",
  16.619 -"sct" : "text/scriptlet",
  16.620 -"scurl" : "text/vnd.curl.scurl",
  16.621 -"sda" : "application/vnd.stardivision.draw",
  16.622 -"sdc" : "application/vnd.stardivision.calc",
  16.623 -"sdd" : "application/vnd.stardivision.impress",
  16.624 -"sdkd" : "application/vnd.solent.sdkm+xml",
  16.625 -"sdkm" : "application/vnd.solent.sdkm+xml",
  16.626 -"sdp" : "application/sdp",
  16.627 -"sdw" : "application/vnd.stardivision.writer",
  16.628 -"see" : "application/vnd.seemail",
  16.629 -"seed" : "application/vnd.fdsn.seed",
  16.630 -"sema" : "application/vnd.sema",
  16.631 -"semd" : "application/vnd.semd",
  16.632 -"semf" : "application/vnd.semf",
  16.633 -"ser" : "application/java-serialized-object",
  16.634 -"setpay" : "application/set-payment-initiation",
  16.635 -"setreg" : "application/set-registration-initiation",
  16.636 -"sfd-hdstx" : "application/vnd.hydrostatix.sof-data",
  16.637 -"sfs" : "application/vnd.spotfire.sfs",
  16.638 -"sgl" : "application/vnd.stardivision.writer-global",
  16.639 -"sgml" : "text/sgml",
  16.640 -"sgm" : "text/sgml",
  16.641 -"sh" : "application/x-sh",
  16.642 -"shar" : "application/x-shar",
  16.643 -"shf" : "application/shf+xml",
  16.644 -"sic" : "application/vnd.wap.sic",
  16.645 -"sig" : "application/pgp-signature",
  16.646 -"silo" : "model/mesh",
  16.647 -"sis" : "application/vnd.symbian.install",
  16.648 -"sisx" : "application/vnd.symbian.install",
  16.649 -"sit" : "application/x-stuffit",
  16.650 -"si" : "text/vnd.wap.si",
  16.651 -"sitx" : "application/x-stuffitx",
  16.652 -"skd" : "application/vnd.koan",
  16.653 -"skm" : "application/vnd.koan",
  16.654 -"skp" : "application/vnd.koan",
  16.655 -"skt" : "application/vnd.koan",
  16.656 -"slc" : "application/vnd.wap.slc",
  16.657 -"sldm" : "application/vnd.ms-powerpoint.slide.macroenabled.12",
  16.658 -"sldx" : "application/vnd.openxmlformats-officedocument.presentationml.slide",
  16.659 -"slt" : "application/vnd.epson.salt",
  16.660 -"sl" : "text/vnd.wap.sl",
  16.661 -"smf" : "application/vnd.stardivision.math",
  16.662 -"smi" : "application/smil+xml",
  16.663 -"smil" : "application/smil+xml",
  16.664 -"snd" : "audio/basic",
  16.665 -"snf" : "application/x-font-snf",
  16.666 -"so" : "application/octet-stream",
  16.667 -"spc" : "application/x-pkcs7-certificates",
  16.668 -"spf" : "application/vnd.yamaha.smaf-phrase",
  16.669 -"spl" : "application/x-futuresplash",
  16.670 -"spot" : "text/vnd.in3d.spot",
  16.671 -"spp" : "application/scvp-vp-response",
  16.672 -"spq" : "application/scvp-vp-request",
  16.673 -"spx" : "audio/ogg",
  16.674 -"src" : "application/x-wais-source",
  16.675 -"srx" : "application/sparql-results+xml",
  16.676 -"sse" : "application/vnd.kodak-descriptor",
  16.677 -"ssf" : "application/vnd.epson.ssf",
  16.678 -"ssml" : "application/ssml+xml",
  16.679 -"sst" : "application/vnd.ms-pkicertstore",
  16.680 -"stc" : "application/vnd.sun.xml.calc.template",
  16.681 -"std" : "application/vnd.sun.xml.draw.template",
  16.682 -"s" : "text/x-asm",
  16.683 -"stf" : "application/vnd.wt.stf",
  16.684 -"sti" : "application/vnd.sun.xml.impress.template",
  16.685 -"stk" : "application/hyperstudio",
  16.686 -"stl" : "application/vnd.ms-pki.stl",
  16.687 -"stm" : "text/html",
  16.688 -"str" : "application/vnd.pg.format",
  16.689 -"stw" : "application/vnd.sun.xml.writer.template",
  16.690 -"sus" : "application/vnd.sus-calendar",
  16.691 -"susp" : "application/vnd.sus-calendar",
  16.692 -"sv4cpio" : "application/x-sv4cpio",
  16.693 -"sv4crc" : "application/x-sv4crc",
  16.694 -"svd" : "application/vnd.svd",
  16.695 -"svg" : "image/svg+xml",
  16.696 -"svgz" : "image/svg+xml",
  16.697 -"swa" : "application/x-director",
  16.698 -"swf" : "application/x-shockwave-flash",
  16.699 -"swi" : "application/vnd.arastra.swi",
  16.700 -"sxc" : "application/vnd.sun.xml.calc",
  16.701 -"sxd" : "application/vnd.sun.xml.draw",
  16.702 -"sxg" : "application/vnd.sun.xml.writer.global",
  16.703 -"sxi" : "application/vnd.sun.xml.impress",
  16.704 -"sxm" : "application/vnd.sun.xml.math",
  16.705 -"sxw" : "application/vnd.sun.xml.writer",
  16.706 -"tao" : "application/vnd.tao.intent-module-archive",
  16.707 -"t" : "application/x-troff",
  16.708 -"tar" : "application/x-tar",
  16.709 -"tcap" : "application/vnd.3gpp2.tcap",
  16.710 -"tcl" : "application/x-tcl",
  16.711 -"teacher" : "application/vnd.smart.teacher",
  16.712 -"tex" : "application/x-tex",
  16.713 -"texi" : "application/x-texinfo",
  16.714 -"texinfo" : "application/x-texinfo",
  16.715 -"text" : "text/plain",
  16.716 -"tfm" : "application/x-tex-tfm",
  16.717 -"tgz" : "application/x-gzip",
  16.718 -"tiff" : "image/tiff",
  16.719 -"tif" : "image/tiff",
  16.720 -"tmo" : "application/vnd.tmobile-livetv",
  16.721 -"torrent" : "application/x-bittorrent",
  16.722 -"tpl" : "application/vnd.groove-tool-template",
  16.723 -"tpt" : "application/vnd.trid.tpt",
  16.724 -"tra" : "application/vnd.trueapp",
  16.725 -"trm" : "application/x-msterminal",
  16.726 -"tr" : "text/troff",
  16.727 -"tsv" : "text/tab-separated-values",
  16.728 -"ttc" : "application/x-font-ttf",
  16.729 -"ttf" : "application/x-font-ttf",
  16.730 -"twd" : "application/vnd.simtech-mindmapper",
  16.731 -"twds" : "application/vnd.simtech-mindmapper",
  16.732 -"txd" : "application/vnd.genomatix.tuxedo",
  16.733 -"txf" : "application/vnd.mobius.txf",
  16.734 -"txt" : "text/plain",
  16.735 -"u32" : "application/x-authorware-bin",
  16.736 -"udeb" : "application/x-debian-package",
  16.737 -"ufd" : "application/vnd.ufdl",
  16.738 -"ufdl" : "application/vnd.ufdl",
  16.739 -"uls" : "text/iuls",
  16.740 -"umj" : "application/vnd.umajin",
  16.741 -"unityweb" : "application/vnd.unity",
  16.742 -"uoml" : "application/vnd.uoml+xml",
  16.743 -"uris" : "text/uri-list",
  16.744 -"uri" : "text/uri-list",
  16.745 -"urls" : "text/uri-list",
  16.746 -"ustar" : "application/x-ustar",
  16.747 -"utz" : "application/vnd.uiq.theme",
  16.748 -"uu" : "text/x-uuencode",
  16.749 -"vcd" : "application/x-cdlink",
  16.750 -"vcf" : "text/x-vcard",
  16.751 -"vcg" : "application/vnd.groove-vcard",
  16.752 -"vcs" : "text/x-vcalendar",
  16.753 -"vcx" : "application/vnd.vcx",
  16.754 -"vis" : "application/vnd.visionary",
  16.755 -"viv" : "video/vnd.vivo",
  16.756 -"vor" : "application/vnd.stardivision.writer",
  16.757 -"vox" : "application/x-authorware-bin",
  16.758 -"vrml" : "x-world/x-vrml",
  16.759 -"vsd" : "application/vnd.visio",
  16.760 -"vsf" : "application/vnd.vsf",
  16.761 -"vss" : "application/vnd.visio",
  16.762 -"vst" : "application/vnd.visio",
  16.763 -"vsw" : "application/vnd.visio",
  16.764 -"vtu" : "model/vnd.vtu",
  16.765 -"vxml" : "application/voicexml+xml",
  16.766 -"w3d" : "application/x-director",
  16.767 -"wad" : "application/x-doom",
  16.768 -"wav" : "audio/x-wav",
  16.769 -"wax" : "audio/x-ms-wax",
  16.770 -"wbmp" : "image/vnd.wap.wbmp",
  16.771 -"wbs" : "application/vnd.criticaltools.wbs+xml",
  16.772 -"wbxml" : "application/vnd.wap.wbxml",
  16.773 -"wcm" : "application/vnd.ms-works",
  16.774 -"wdb" : "application/vnd.ms-works",
  16.775 -"wiz" : "application/msword",
  16.776 -"wks" : "application/vnd.ms-works",
  16.777 -"wma" : "audio/x-ms-wma",
  16.778 -"wmd" : "application/x-ms-wmd",
  16.779 -"wmf" : "application/x-msmetafile",
  16.780 -"wmlc" : "application/vnd.wap.wmlc",
  16.781 -"wmlsc" : "application/vnd.wap.wmlscriptc",
  16.782 -"wmls" : "text/vnd.wap.wmlscript",
  16.783 -"wml" : "text/vnd.wap.wml",
  16.784 -"wm" : "video/x-ms-wm",
  16.785 -"wmv" : "video/x-ms-wmv",
  16.786 -"wmx" : "video/x-ms-wmx",
  16.787 -"wmz" : "application/x-ms-wmz",
  16.788 -"wpd" : "application/vnd.wordperfect",
  16.789 -"wpl" : "application/vnd.ms-wpl",
  16.790 -"wps" : "application/vnd.ms-works",
  16.791 -"wqd" : "application/vnd.wqd",
  16.792 -"wri" : "application/x-mswrite",
  16.793 -"wrl" : "x-world/x-vrml",
  16.794 -"wrz" : "x-world/x-vrml",
  16.795 -"wsdl" : "application/wsdl+xml",
  16.796 -"wspolicy" : "application/wspolicy+xml",
  16.797 -"wtb" : "application/vnd.webturbo",
  16.798 -"wvx" : "video/x-ms-wvx",
  16.799 -"x32" : "application/x-authorware-bin",
  16.800 -"x3d" : "application/vnd.hzn-3d-crossword",
  16.801 -"xaf" : "x-world/x-vrml",
  16.802 -"xap" : "application/x-silverlight-app",
  16.803 -"xar" : "application/vnd.xara",
  16.804 -"xbap" : "application/x-ms-xbap",
  16.805 -"xbd" : "application/vnd.fujixerox.docuworks.binder",
  16.806 -"xbm" : "image/x-xbitmap",
  16.807 -"xdm" : "application/vnd.syncml.dm+xml",
  16.808 -"xdp" : "application/vnd.adobe.xdp+xml",
  16.809 -"xdw" : "application/vnd.fujixerox.docuworks",
  16.810 -"xenc" : "application/xenc+xml",
  16.811 -"xer" : "application/patch-ops-error+xml",
  16.812 -"xfdf" : "application/vnd.adobe.xfdf",
  16.813 -"xfdl" : "application/vnd.xfdl",
  16.814 -"xht" : "application/xhtml+xml",
  16.815 -"xhtml" : "application/xhtml+xml",
  16.816 -"xhvml" : "application/xv+xml",
  16.817 -"xif" : "image/vnd.xiff",
  16.818 -"xla" : "application/vnd.ms-excel",
  16.819 -"xlam" : "application/vnd.ms-excel.addin.macroenabled.12",
  16.820 -"xlb" : "application/vnd.ms-excel",
  16.821 -"xlc" : "application/vnd.ms-excel",
  16.822 -"xlm" : "application/vnd.ms-excel",
  16.823 -"xls" : "application/vnd.ms-excel",
  16.824 -"xlsb" : "application/vnd.ms-excel.sheet.binary.macroenabled.12",
  16.825 -"xlsm" : "application/vnd.ms-excel.sheet.macroenabled.12",
  16.826 -"xlsx" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  16.827 -"xlt" : "application/vnd.ms-excel",
  16.828 -"xltm" : "application/vnd.ms-excel.template.macroenabled.12",
  16.829 -"xltx" : "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
  16.830 -"xlw" : "application/vnd.ms-excel",
  16.831 -"xml" : "application/xml",
  16.832 -"xo" : "application/vnd.olpc-sugar",
  16.833 -"xof" : "x-world/x-vrml",
  16.834 -"xop" : "application/xop+xml",
  16.835 -"xpdl" : "application/xml",
  16.836 -"xpi" : "application/x-xpinstall",
  16.837 -"xpm" : "image/x-xpixmap",
  16.838 -"xpr" : "application/vnd.is-xpr",
  16.839 -"xps" : "application/vnd.ms-xpsdocument",
  16.840 -"xpw" : "application/vnd.intercon.formnet",
  16.841 -"xpx" : "application/vnd.intercon.formnet",
  16.842 -"xsl" : "application/xml",
  16.843 -"xslt" : "application/xslt+xml",
  16.844 -"xsm" : "application/vnd.syncml+xml",
  16.845 -"xspf" : "application/xspf+xml",
  16.846 -"xul" : "application/vnd.mozilla.xul+xml",
  16.847 -"xvm" : "application/xv+xml",
  16.848 -"xvml" : "application/xv+xml",
  16.849 -"xwd" : "image/x-xwindowdump",
  16.850 -"xyz" : "chemical/x-xyz",
  16.851 -"z" : "application/x-compress",
  16.852 -"zaz" : "application/vnd.zzazz.deck+xml",
  16.853 -"zip" : "application/zip",
  16.854 -"zir" : "application/vnd.zul",
  16.855 -"zirz" : "application/vnd.zul",
  16.856 -"zmm" : "application/vnd.handheld-entertainment+xml"
  16.857 -}
  16.858 -}
    17.1 --- a/pEpForiOSTests/HandshakeTests.swift	Wed May 15 15:22:42 2019 +0200
    17.2 +++ b/pEpForiOSTests/HandshakeTests.swift	Fri May 17 14:08:50 2019 +0200
    17.3 @@ -60,7 +60,7 @@
    17.4  
    17.5          let theAttachments = pEpMessage.attachments ?? []
    17.6          XCTAssertEqual(theAttachments.count, 1)
    17.7 -        XCTAssertEqual(theAttachments[0].mimeType, MimeTypeUtil.contentTypeApplicationPGPKeys)
    17.8 +        XCTAssertEqual(theAttachments[0].mimeType, ContentTypeUtils.ContentType.pgpKeys)
    17.9  
   17.10          guard let optFields = pEpMessage.optionalFields else {
   17.11              XCTFail("expected optional_fields to be defined")
    18.1 --- a/pEpForiOSTests/MailParsingTests.swift	Wed May 15 15:22:42 2019 +0200
    18.2 +++ b/pEpForiOSTests/MailParsingTests.swift	Fri May 17 14:08:50 2019 +0200
    18.3 @@ -60,7 +60,7 @@
    18.4  
    18.5          let theAttachments = pEpMessage.attachments ?? []
    18.6          XCTAssertEqual(theAttachments.count, 1)
    18.7 -        XCTAssertEqual(theAttachments[0].mimeType, MimeTypeUtil.contentTypeApplicationPGPKeys)
    18.8 +        XCTAssertEqual(theAttachments[0].mimeType, ContentTypeUtils.ContentType.pgpKeys)
    18.9  
   18.10          guard let optFields = pEpMessage.optionalFields else {
   18.11              XCTFail("expected optional_fields to be defined")
    19.1 --- a/pEpForiOSTests/MiscTests.swift	Wed May 15 15:22:42 2019 +0200
    19.2 +++ b/pEpForiOSTests/MiscTests.swift	Fri May 17 14:08:50 2019 +0200
    19.3 @@ -33,9 +33,9 @@
    19.4      }
    19.5  
    19.6      func testMimeTypeJson() {
    19.7 -        let mimeTypeController = MimeTypeUtil()
    19.8 -        let s = mimeTypeController?.mimeType(fileExtension: "pdf")
    19.9 -        XCTAssertEqual(s, "application/pdf")
   19.10 +        let mimeTypeController = MimeTypeUtils()
   19.11 +        let s = mimeTypeController?.mimeType(fromFileExtension: "pdf")
   19.12 +        XCTAssertEqual(s, MimeTypeUtils.MimesType.pdf)
   19.13      }
   19.14  
   19.15      func testBinaryIndex() {
    20.1 --- a/pEpForiOSTests/PepAdapterTests.swift	Wed May 15 15:22:42 2019 +0200
    20.2 +++ b/pEpForiOSTests/PepAdapterTests.swift	Fri May 17 14:08:50 2019 +0200
    20.3 @@ -13,7 +13,6 @@
    20.4  import PEPObjCAdapterFramework
    20.5  
    20.6  class PepAdapterTests: XCTestCase {
    20.7 -    let comp = "PepAdapterTests"
    20.8      let identityMe = PEPIdentity(address: "some@mail.com",
    20.9                                   userID: CdIdentity.pEpOwnUserID,
   20.10                                   userName: "This is me",
    21.1 --- a/pEpForiOSTests/StringHTMLExtensionTests.swift	Wed May 15 15:22:42 2019 +0200
    21.2 +++ b/pEpForiOSTests/StringHTMLExtensionTests.swift	Fri May 17 14:08:50 2019 +0200
    21.3 @@ -114,7 +114,7 @@
    21.4          let alt1 = "Attached Image 1 (jpg)"
    21.5  
    21.6          let theData = "Not an image".data(using: .utf8)
    21.7 -        let theMimeType = MimeTypeUtil.jpegMimeType
    21.8 +        let theMimeType = MimeTypeUtils.MimesType.jpeg
    21.9          let attachment = Attachment.create(
   21.10              data: theData, mimeType: theMimeType, fileName: "cid:\(cid1)",
   21.11              size: theData?.count)
    22.1 --- a/pEpForiOSTests/TestUtils/PEPMessage+TestExtension.swift	Wed May 15 15:22:42 2019 +0200
    22.2 +++ b/pEpForiOSTests/TestUtils/PEPMessage+TestExtension.swift	Fri May 17 14:08:50 2019 +0200
    22.3 @@ -14,10 +14,12 @@
    22.4  
    22.5  extension PEPMessage {
    22.6      public func isLikelyPEPEncrypted() -> Bool {
    22.7 -        let theAttachments = attachments ?? []
    22.8 -        return theAttachments.count == 2 &&
    22.9 -            theAttachments[0].mimeType == "application/pgp-encrypted" &&
   22.10 -            theAttachments[1].mimeType == "application/octet-stream" &&
   22.11 -            theAttachments[1].filename == "file://msg.asc"
   22.12 +        guard let attachments = attachments else {
   22.13 +            return false
   22.14 +        }
   22.15 +        return attachments.count == 2 &&
   22.16 +            attachments[0].mimeType == MimeTypeUtils.MimesType.pgpEncrypted &&
   22.17 +            attachments[1].mimeType == MimeTypeUtils.MimesType.defaultMimeType &&
   22.18 +            attachments[1].filename == "file://msg.asc"
   22.19      }
   22.20  }
    23.1 --- a/pEpForiOSTests/TestUtils/TestUtil.swift	Wed May 15 15:22:42 2019 +0200
    23.2 +++ b/pEpForiOSTests/TestUtils/TestUtil.swift	Fri May 17 14:08:50 2019 +0200
    23.3 @@ -507,7 +507,7 @@
    23.4          let contentDisposition = inlined ? Attachment.ContentDispositionType.inline : .attachment
    23.5  
    23.6          return Attachment.create(data: imageData,
    23.7 -                          mimeType: MimeTypeUtil.jpegMimeType,
    23.8 +                          mimeType: MimeTypeUtils.MimesType.jpeg,
    23.9                            fileName: imageFileName,
   23.10                            contentDisposition: contentDisposition)
   23.11      }
    24.1 --- a/pEpForiOSTests/URL+MIME.swift	Wed May 15 15:22:42 2019 +0200
    24.2 +++ b/pEpForiOSTests/URL+MIME.swift	Fri May 17 14:08:50 2019 +0200
    24.3 @@ -12,15 +12,15 @@
    24.4  import pEpIOSToolbox
    24.5  import MessageModel
    24.6  
    24.7 -class URL_MIME: XCTestCase {
    24.8 +class URL_MimeTest: XCTestCase {
    24.9      let pathBuilder = "file://ma/path/to/nice_pic"
   24.10 -    let mimeUtil = MimeTypeUtil()
   24.11 +    let mimeUtils = MimeTypeUtils()
   24.12  
   24.13      func testJpg() {
   24.14          let jpgExt = "jpg"
   24.15          let url = urlWithExtension(ext: jpgExt)
   24.16 -        let testee = url.mimeType()
   24.17 -        let expected = mimeUtil?.mimeType(fileExtension: jpgExt)
   24.18 +        let testee = mimeUtils?.mimeType(fromURL: url)
   24.19 +        let expected = mimeUtils?.mimeType(fromFileExtension: jpgExt)
   24.20          XCTAssertEqual(testee, expected)
   24.21      }
   24.22  
    25.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox.xcodeproj/project.pbxproj	Wed May 15 15:22:42 2019 +0200
    25.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox.xcodeproj/project.pbxproj	Fri May 17 14:08:50 2019 +0200
    25.3 @@ -15,7 +15,6 @@
    25.4  		37904569223FA52B006DAB3B /* NetworkReachibilityMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37904567223FA52B006DAB3B /* NetworkReachibilityMock.swift */; };
    25.5  		3790456A223FA52B006DAB3B /* ReachabilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37904568223FA52B006DAB3B /* ReachabilityTests.swift */; };
    25.6  		37954C6E227C90C10099B8D8 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37954C6D227C90C10099B8D8 /* Log.swift */; };
    25.7 -		435F5129221FF9D7006EB11F /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 435F5128221FF9D7006EB11F /* Constants.swift */; };
    25.8  		B70A3A5522005BD400EDCE61 /* Date+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A5422005BD400EDCE61 /* Date+Extension.swift */; };
    25.9  		B70A3A5722005BE300EDCE61 /* NSRegularExpression+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A5622005BE300EDCE61 /* NSRegularExpression+Extension.swift */; };
   25.10  		B70A3A7322006B9F00EDCE61 /* SystemUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A7222006B9E00EDCE61 /* SystemUtils.swift */; };
   25.11 @@ -64,7 +63,6 @@
   25.12  		37904567223FA52B006DAB3B /* NetworkReachibilityMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachibilityMock.swift; sourceTree = "<group>"; };
   25.13  		37904568223FA52B006DAB3B /* ReachabilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReachabilityTests.swift; sourceTree = "<group>"; };
   25.14  		37954C6D227C90C10099B8D8 /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
   25.15 -		435F5128221FF9D7006EB11F /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Constants.swift; path = ../../../../Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Constants.swift; sourceTree = "<group>"; };
   25.16  		B70A3A5422005BD400EDCE61 /* Date+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+Extension.swift"; sourceTree = "<group>"; };
   25.17  		B70A3A5622005BE300EDCE61 /* NSRegularExpression+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSRegularExpression+Extension.swift"; sourceTree = "<group>"; };
   25.18  		B70A3A7222006B9E00EDCE61 /* SystemUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SystemUtils.swift; sourceTree = "<group>"; };
   25.19 @@ -260,7 +258,6 @@
   25.20  				B7A46C4F220C1F0C0027CCB5 /* MiscUtil.swift */,
   25.21  				B7DB7F512213120B003968DA /* SortedSet.swift */,
   25.22  				B70A3A7222006B9E00EDCE61 /* SystemUtils.swift */,
   25.23 -				435F5128221FF9D7006EB11F /* Constants.swift */,
   25.24  			);
   25.25  			path = Other;
   25.26  			sourceTree = "<group>";
   25.27 @@ -385,7 +382,6 @@
   25.28  				B7465DE72211E969008A1708 /* CGRect+Util.swift in Sources */,
   25.29  				B7465DCC2211BEEA008A1708 /* Tuple.swift in Sources */,
   25.30  				37904562223FA486006DAB3B /* NetworkReachabilityProtocol.swift in Sources */,
   25.31 -				435F5129221FF9D7006EB11F /* Constants.swift in Sources */,
   25.32  				B7A46C50220C1F0C0027CCB5 /* MiscUtil.swift in Sources */,
   25.33  				B70A3A7322006B9F00EDCE61 /* SystemUtils.swift in Sources */,
   25.34  				B7936E3D220DD8F5003B39E6 /* NSAttributedString+Extensions.swift in Sources */,
    26.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/NSAttributedString+Parsing.swift	Wed May 15 15:22:42 2019 +0200
    26.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/NSAttributedString+Parsing.swift	Fri May 17 14:08:50 2019 +0200
    26.3 @@ -11,7 +11,6 @@
    26.4  
    26.5  public protocol NSAttributedStringParsingDelegate: class {
    26.6      func stringFor(attachment: NSTextAttachment) -> String?
    26.7 -    func stringFor(string: String) -> String?
    26.8  }
    26.9  
   26.10  public extension NSAttributedString {
   26.11 @@ -28,9 +27,7 @@
   26.12              } else {
   26.13                  let theAttributedString = string.attributedSubstring(from: r)
   26.14                  let theString = theAttributedString.string
   26.15 -                if let theStringToAppend = delegate.stringFor(string: theString) {
   26.16 -                    resultString = "\(resultString)\(theStringToAppend)"
   26.17 -                }
   26.18 +                resultString = "\(resultString)\(theString)"
   26.19              }
   26.20          }
   26.21          return resultString