Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5544929
Merge branch 'fixes/task-cleanup' into enhancements/download-function…
StanleyGoldman Dec 19, 2017
d5e9914
Merge branch 'fixes/integration-test-refactor' into enhancements/down…
StanleyGoldman Dec 19, 2017
7c10c35
Initial draft of a download task
StanleyGoldman Dec 19, 2017
3165e56
Initial attempt at a download task
StanleyGoldman Dec 19, 2017
9c47ff7
Fixing download of partial files
StanleyGoldman Dec 19, 2017
3b3debf
Renaming some variables
StanleyGoldman Dec 19, 2017
668661d
Inline some methods
StanleyGoldman Dec 19, 2017
8e07c41
Uncommenting delete of integration test folder
StanleyGoldman Dec 19, 2017
5298102
Using DownloadResult and calculating MD5
StanleyGoldman Dec 19, 2017
48c1d5c
Adding MD5 to Resharper abbreviations
StanleyGoldman Dec 19, 2017
7c94cd0
Merge branch 'enhancements/async-git-setup-rollup' into enhancements/…
StanleyGoldman Dec 29, 2017
ad927a6
Adding a task to download the contents of a text file
StanleyGoldman Dec 29, 2017
117a44d
Removing download result object
StanleyGoldman Jan 2, 2018
3c1f6a7
Returning successful result
StanleyGoldman Jan 2, 2018
2800d7f
Adding functionality to validate the downloaded files md5 and retrying
StanleyGoldman Jan 2, 2018
28a741b
Better to throw an exception when things don't work out
StanleyGoldman Jan 2, 2018
c2f2859
Setting up a download sequence to show it works
StanleyGoldman Jan 2, 2018
fa74661
Fix Resharper abbreviation
StanleyGoldman Jan 3, 2018
122abe0
Commenting out integration test output
StanleyGoldman Jan 4, 2018
7ea50e5
Detecting errors properly when downloading
StanleyGoldman Jan 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions GitHub.Unity.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
</TypePattern>
&lt;/Patterns&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SSH/@EntryIndexedValue">SSH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand Down
1 change: 1 addition & 0 deletions src/GitHub.Api/GitHub.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<Compile Include="Tasks\BaseOutputProcessor.cs" />
<Compile Include="Tasks\ConcurrentExclusiveInterleave.cs" />
<Compile Include="Tasks\ConfigOutputProcessor.cs" />
<Compile Include="Tasks\DownloadTask.cs" />
<Compile Include="Tasks\ITaskManager.cs" />
<Compile Include="Tasks\ProcessTask.cs" />
<Compile Include="Tasks\TaskBase.cs" />
Expand Down
16 changes: 16 additions & 0 deletions src/GitHub.Api/IO/FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public bool FileExists(string filename)
return File.Exists(filename);
}

public long FileLength(string path)
{
var fileInfo = new FileInfo(path);
return fileInfo.Length;
}

public IEnumerable<string> GetDirectories(string path)
{
return Directory.GetDirectories(path);
Expand Down Expand Up @@ -167,6 +173,11 @@ public void WriteAllText(string path, string contents, Encoding encoding)
File.WriteAllText(path, contents, encoding);
}

public byte[] ReadAllBytes(string path)
{
return File.ReadAllBytes(path);
}

public string ReadAllText(string path)
{
return File.ReadAllText(path);
Expand Down Expand Up @@ -201,5 +212,10 @@ public Stream OpenRead(string path)
{
return File.OpenRead(path);
}

public Stream OpenWrite(string path, FileMode mode)
{
return new FileStream(path, mode);
}
}
}
3 changes: 3 additions & 0 deletions src/GitHub.Api/IO/IFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace GitHub.Unity
public interface IFileSystem
{
bool FileExists(string path);
long FileLength(string path);
string Combine(string path1, string path2);
string Combine(string path1, string path2, string path3);
string GetFullPath(string path);
Expand Down Expand Up @@ -37,9 +38,11 @@ public interface IFileSystem
string ReadAllText(string path);
string ReadAllText(string path, Encoding encoding);
Stream OpenRead(string path);
Stream OpenWrite(string path, FileMode mode);
string[] ReadAllLines(string path);
char DirectorySeparatorChar { get; }
bool ExistingPathIsDirectory(string path);
void SetCurrentDirectory(string currentDirectory);
byte[] ReadAllBytes(string path);
}
}
6 changes: 6 additions & 0 deletions src/GitHub.Api/IO/NiceIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,12 @@ public NPath WriteAllText(string contents, Encoding encoding)
return this;
}

public byte[] ReadAllBytes()
{
ThrowIfRelative();
return FileSystem.ReadAllBytes(ToString());
}

public string ReadAllText()
{
ThrowIfRelative();
Expand Down
Loading