@@ -12,55 +12,55 @@ public protocol FileSystem: Equatable, CustomStringConvertible {
1212 init ( store: Store < Self > )
1313}
1414
15- public extension FileSystem {
15+ extension FileSystem {
1616 /// FileSystem Description
17- var description : String {
17+ public var description : String {
1818 return " (name: \( name) , path: \( store. path. rawValue) ) "
1919 }
2020
2121 /// FileSystem URL
22- var url : URL {
22+ public var url : URL {
2323 return URL ( fileURLWithPath: store. path. rawValue)
2424 }
2525
2626 /// FileSystem Name
27- var name : String {
27+ public var name : String {
2828 return url. pathComponents. last!
2929 }
3030
3131 /// File Extension in File System
32- var `extension` : String ? {
32+ public var `extension` : String ? {
3333 let components = name. split ( separator: " . " )
3434 guard components. count > 1 else { return nil }
3535 return String ( components. last!)
3636 }
3737
3838 /// The date when the item at this FileSystem was created
39- var creationDate : Date ? {
39+ public var creationDate : Date ? {
4040 return store. attributes [ . creationDate] as? Date
4141 }
4242
4343 /// The date when the item at this FileSystem was last modified
44- var modificationDate : Date ? {
44+ public var modificationDate : Date ? {
4545 return store. attributes [ . modificationDate] as? Date
4646 }
4747
4848 /// Initalizer path inside FileSystem
49- init ( path: Path ) throws {
49+ public init ( path: Path ) throws {
5050 try self . init ( store: Store (
5151 path: path,
5252 fileManager: . default
5353 ) )
5454 }
5555
56- static func == ( lhs: Self , rhs: Self ) -> Bool {
56+ public static func == ( lhs: Self , rhs: Self ) -> Bool {
5757 return lhs. description == rhs. description
5858 }
5959}
6060
61- public extension FileSystem {
61+ extension FileSystem {
6262 /// Rename this FileSystem, keeping its exist `extension`
63- func rename( to newName: String , keepExtensions: Bool = true ) throws {
63+ public func rename( to newName: String , keepExtensions: Bool = true ) throws {
6464 var newName = newName
6565 if keepExtensions {
6666 `extension`. map {
@@ -71,25 +71,25 @@ public extension FileSystem {
7171 }
7272
7373 /// Move this File System to a new parents Folder
74- func move( to newParent: Folder ) throws {
74+ public func move( to newParent: Folder ) throws {
7575 let path = Path ( newParent. store. path. rawValue + name)
7676 try store. move ( to: path)
7777 }
7878
7979 /// Copy the content of this File System to a given folder
80- func copy( to folder: Folder ) throws -> Self {
80+ public func copy( to folder: Folder ) throws -> Self {
8181 let path = Path ( folder. store. path. rawValue + name)
8282 try store. copy ( to: path)
8383 return try Self ( path: path)
8484 }
8585
8686 /// Delete this FileSystem.
87- func delete( ) throws {
87+ public func delete( ) throws {
8888 try store. delete ( )
8989 }
9090
9191 /// FileSystem `FileManager` Setting
92- func managedBy( _ manager: FileManager ) throws -> Self {
92+ public func managedBy( _ manager: FileManager ) throws -> Self {
9393 return try Self ( store: Store (
9494 path: store. path,
9595 fileManager: manager
0 commit comments