-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
3 changed files
with
58 additions
and
15 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,29 @@ | ||
using System.IO; | ||
using System.IO.Compression; | ||
|
||
namespace SIL.Machine.Corpora | ||
{ | ||
public class ZipParatextProjectTextUpdater : ZipParatextProjectTextUpdaterBase | ||
{ | ||
private readonly ZipArchive _archive; | ||
|
||
public ZipParatextProjectTextUpdater(ZipArchive archive) | ||
: base(new ZipParatextProjectSettingsParser(archive)) | ||
{ | ||
_archive = archive; | ||
} | ||
|
||
protected override bool Exists(string fileName) | ||
{ | ||
return _archive.GetEntry(fileName) != null; | ||
} | ||
|
||
protected override Stream Open(string fileName) | ||
{ | ||
ZipArchiveEntry entry = _archive.GetEntry(fileName); | ||
if (entry == null) | ||
return null; | ||
return entry.Open(); | ||
} | ||
} | ||
} |
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,8 @@ | ||
namespace SIL.Machine.Corpora | ||
{ | ||
public abstract class ZipParatextProjectTextUpdaterBase : ParatextProjectTextUpdaterBase | ||
{ | ||
protected ZipParatextProjectTextUpdaterBase(ParatextProjectSettingsParserBase settingsParser) | ||
: base(settingsParser) { } | ||
} | ||
} |
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