    public func createDirectoryIfNeeded() -> Bool{
         let directoryPath = self.saveDirectoryAbsolutePath()
         var error: NSError?
-        if self.fileManager.createDirectoryAtPath(directoryPath, withIntermediateDirectories: true, attributes: nil, error: &error) {
+        do {
+            try self.fileManager.createDirectoryAtPath(directoryPath, withIntermediateDirectories: true, attributes: nil)
             if error == nil {
                 WHLog("Create Directory Success \(directoryPath)")
                 return true

    
    public class func documentDirectoryPath() -> String {
        let paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)
        return paths.first as! String
    }
    
    public class func cacheDirectoryPath() -> String {
        let paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.CachesDirectory, NSSearchPathDomainMask.UserDomainMask, true)
        return paths.first as! String
    }
    
    public class func translateAbsoluteToRelative(path :String?) -> String? {
        if let path = path {
            if path.hasPrefix(self.homeDirectoryPath()) {
                return path.stringByReplacingOccurrencesOfString(self.homeDirectoryPath(), withString: "", options: nil, range: nil)
            } else {
                return path
            }

    }
    
    
    public func saveFile(fileName fileName: String, contents: NSData,
        success :((savedRelativePath: String?) -> Void)?, faiure:((error: NSError?) -> Void)?) {
        let subDirectoryPath = self.subDirectoryPath ?? ""
        let path = self.directoryType.Path() + "\(subDirectoryPath)/" + fileName
