         }
     }
     
-    public enum Error: ErrorType {
+    enum Error: ErrorType {
         case CreateNewWorkspaceFailed(String)
     }
     

        let id = NSUUID().UUIDString

        guard let archiveJSONDir = _workspaceDirURL.URLByAppendingPathComponent(id).path else { return /* TODO: throw Error.CreateNewWorkspaceFailed("Failed to get playdata directory") */ }
        
        do {
            // convert archive file (XML) to JSON file
            let converter = ArchiveToJSON(fromArchive: archiveFile, toDirectory: archiveJSONDir)
            try converter.convert()

            // read converted playdata
            let playdataFilePath = (archiveJSONDir as NSString).stringByAppendingPathComponent(ArchiveConstants.FILE_PLAYDATA_JSON)
            guard let playdataData = NSData(contentsOfFile: playdataFilePath) else { throw Error.CreateNewWorkspaceFailed("Failed to load playdata.json") }
            let playdata = JSON(data: playdataData)
            let title = playdata[ArchiveConstants.FULL_NAME].stringValue
            
            // create new Workspace object
            let ws = Workspace()
            ws.id = id
            ws.path = playdataFilePath
            ws.title = title
            
            try _realm.write {
                _realm.add(ws)
            }
        } catch let error {
            // remove failed workspace directory
            _ = try? NSFileManager.defaultManager().removeItemAtPath(archiveJSONDir)
            

import Eventitic
import RealmSwift
import SwiftyJSON
import SwiftTask

private let WORKSPACE_DIR = "workspace"
private let WORKSPACE_DB = "workspace.realm"
