-
Notifications
You must be signed in to change notification settings - Fork 31
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
1 parent
1b0e419
commit ca45391
Showing
113 changed files
with
2,743 additions
and
1,598 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
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
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
11 changes: 11 additions & 0 deletions
11
ITHit.FileSystem.Samples.Common/ITHit.FileSystem.Samples.Common.csproj
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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="ITHit.FileSystem.Windows" Version="2.0.4465.0" /> | ||
<PackageReference Include="log4net" Version="2.0.12" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" /> | ||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" /> | ||
</ItemGroup> | ||
</Project> |
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,13 @@ | ||
using ITHit.FileSystem; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace ITHit.FileSystem.Samples.Common | ||
{ | ||
public interface IUserFile : IUserFileSystemItem | ||
{ | ||
Task<byte[]> ReadAsync(long offset, long length); | ||
Task<string> UpdateAsync(IFileBasicInfo fileInfo, Stream content = null, ServerLockInfo lockInfo = null); | ||
Task<bool> ValidateDataAsync(long offset, long length); | ||
} | ||
} |
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,12 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace ITHit.FileSystem.Samples.Common | ||
{ | ||
public interface IUserFileSystemItem | ||
{ | ||
Task DeleteAsync(); | ||
Task<ServerLockInfo> LockAsync(); | ||
Task MoveToAsync(string userFileSystemNewPath); | ||
Task UnlockAsync(string lockToken); | ||
} | ||
} |
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,15 @@ | ||
using ITHit.FileSystem; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace ITHit.FileSystem.Samples.Common | ||
{ | ||
public interface IUserFolder : IUserFileSystemItem | ||
{ | ||
Task<string> CreateFileAsync(IFileBasicInfo fileInfo, Stream content); | ||
Task<string> CreateFolderAsync(IFolderBasicInfo folderInfo); | ||
Task<IEnumerable<FileSystemItemBasicInfo>> EnumerateChildrenAsync(string pattern); | ||
Task<string> UpdateAsync(IFolderBasicInfo folderInfo, ServerLockInfo lockInfo = null); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ITHit.FileSystem.Samples.Common | ||
{ | ||
/// <summary> | ||
/// Information about the lock returned from the remote storage as a result of the lock operation. | ||
/// </summary> | ||
public class ServerLockInfo | ||
{ | ||
/// <summary> | ||
/// Lock-token. Must be supplied during the item update and unlock operations. | ||
/// </summary> | ||
public string LockToken { get; set; } | ||
|
||
/// <summary> | ||
/// Lock expidation date/time returned by the server. | ||
/// </summary> | ||
public DateTimeOffset LockExpirationDateUtc { get; set; } | ||
|
||
/// <summary> | ||
/// Name of the user that locked the item. | ||
/// </summary> | ||
public string Owner { get; set; } | ||
|
||
/// <summary> | ||
/// True if the item is locked exclusively. False in case the item has a shared lock. | ||
/// </summary> | ||
public bool Exclusive { get; set; } | ||
|
||
public IEnumerable<FileSystemItemPropertyData> GetLockProperties(string lockIconPath) | ||
{ | ||
List<FileSystemItemPropertyData> lockProps = new List<FileSystemItemPropertyData>(); | ||
lockProps.Add(new FileSystemItemPropertyData(2, Owner, lockIconPath)); | ||
lockProps.Add(new FileSystemItemPropertyData(3, Exclusive ? "Exclusive" : "Shared")); | ||
lockProps.Add(new FileSystemItemPropertyData(4, LockExpirationDateUtc.ToString())); | ||
return lockProps; | ||
} | ||
} | ||
} |
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.