-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
FileManagerInterface.swift
24 lines (21 loc) · 1.12 KB
/
FileManagerInterface.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
import Foundation
protocol FileManagerInterface {
func contents(atPath path: String) -> Data?
func contentsOfDirectory(at url: URL,
includingPropertiesForKeys keys: [URLResourceKey]?,
options mask: FileManager.DirectoryEnumerationOptions) throws -> [URL]
func createFile(atPath path: String,
contents data: Data?,
attributes attr: [FileAttributeKey: Any]?) -> Bool
func createDirectory(atPath path: String,
withIntermediateDirectories createIntermediates: Bool,
attributes: [FileAttributeKey: Any]?) throws
func fileExists(atPath path: String) -> Bool
func removeItem(at URL: URL) throws
func urls(for directory: FileManager.SearchPathDirectory,
in domainMask: FileManager.SearchPathDomainMask) -> [URL]
}
extension FileManager: FileManagerInterface { }