forked from bobvanderlinden/sharpfilesystem
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
117 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace SharpFileSystem.FileSystems | ||
{ | ||
public abstract class AbstractFileSystem : IFileSystem | ||
{ | ||
public abstract ICollection<FileSystemPath> GetEntities(FileSystemPath path); | ||
public abstract bool Exists(FileSystemPath path); | ||
public abstract Stream CreateFile(FileSystemPath path); | ||
public abstract Stream OpenFile(FileSystemPath path, FileAccess access); | ||
public abstract void CreateDirectory(FileSystemPath path); | ||
public abstract void Delete(FileSystemPath path); | ||
|
||
public ICollection<FileSystemPath> GetFiles(FileSystemPath path) | ||
{ | ||
var files = GetEntities(path).Where(x => x.IsFile).ToList(); | ||
return files; | ||
} | ||
|
||
public ICollection<FileSystemPath> GetDirectories(FileSystemPath path) | ||
{ | ||
var directories = GetEntities(path).Where(x => x.IsDirectory).ToList(); | ||
return directories; | ||
} | ||
|
||
public abstract bool IsReadOnly { get; } | ||
|
||
public abstract void Dispose(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.