         // Have we already downloaded the item?
         let filename = downloadedItems[portalItem.identifier] ?? portalItem.filename
         let tempURL = destinationURLProvider.makeURL(filename: filename)
-        let pathURL = tempURL.pathExtension == "zip" ? tempURL.deletingPathExtension() : tempURL
+        let fileURL = tempURL.pathExtension == "zip" ? tempURL.deletingPathExtension() : tempURL
         
-        // Check if a single file or a folder exists.
-        var isDirectory = ObjCBool(false)
-        let isFileExist = FileManager.default.fileExists(atPath: pathURL.path, isDirectory: &isDirectory)
-        
-        if isFileExist && isDirectory.boolValue {
-            print("Item \(portalItem.identifier) has already been downloaded, and is extracted to an folder")
-            downloadedItems[portalItem.identifier] = filename
-        } else if isFileExist {
+        // Check if a single file or a directory exists.
+        if FileManager.default.fileExists(atPath: fileURL.path) {
             print("Item \(portalItem.identifier) has already been downloaded")
             // This is a temporary measure for users who currently don't have a downloaded items file.
             downloadedItems[portalItem.identifier] = filename

    var filename: String
}

// MARK: Enters the script from here.

let arguments = CommandLine.arguments


    }
}

/// Creates a URL such as
/// `{portalURL}/sharing/rest/content/items/{itemIdentifier}/data`
/// for the given item in the given portal.
///
/// - Parameters:
