Skip to content

Commit

Permalink
v6.1.17328.0-Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ITHitBuild committed Aug 22, 2022
1 parent 5c91f1d commit 3a526bc
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem" Version="6.1.17328.0-Beta" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Windows/Common/Core/Common.Windows.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.17328.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.17328.0-Beta" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Windows/Common/Core/LogFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public bool DebugLoggingEnabled
private const int sourcePathWidth = 60;
private const int remoteStorageIdWidth = 20;

private const int indent = -30;
private const int indent = -45;

/// <summary>
/// Creates instance of this class.
Expand Down Expand Up @@ -133,7 +133,8 @@ public async Task PrintEngineDescriptionAsync(EngineWindows engine)
log.Info($"\n{"AutoLock:",indent} {engine.AutoLock}");
log.Info($"\n{"Outgoing sync, ms:",indent} {engine.SyncService.SyncIntervalMs}");
log.Info($"\n{"Shell extensions RPC enabled:",indent} {engine.ShellExtensionsComServerRpcEnabled}");
log.Info($"\n{"Max Transfer concurrent requests:",indent} {engine.MaxTransferConcurrentRequests}");
log.Info($"\n{"Max create/read/write concurrent requests:",indent} {engine.MaxTransferConcurrentRequests}");
log.Info($"\n{"Max list/move/delete concurrent requests:",indent} {engine.MaxOperationsConcurrentRequests}");

// Log indexing state. Sync root must be indexed.
await PrintIndexingStateAsync(engine.Path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.17328.0-Beta" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualDrive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<p>To run the sample open the project in Visual Studio and run the project in debug mode. When starting in the debug mode, it will automatically create a folder in which the virtual file system will reside, register the virtual drive with the platform and then open&nbsp;two instances of Windows File Manager, one of which will show a virtual drive and another a folder simulating remote storage.&nbsp;</p>
<p>You can find more about running and stopping the sample as well as about basic synchronization features in the&nbsp;<a title="Virtual File System Sample for Windows" href="https://www.userfilesystem.com/examples/virtual_file_system/">Virtual File System</a>&nbsp;sample description.&nbsp;</p>
<h2><span>Shell Extensions Support</span></h2>
<p>This sample provides thumbnails handler, context menu handler and custom states and properties handler.&nbsp;<span>All handlers are registered as an application extension by the packing project provided with the sample or as a sparse package manifest of the main application. To register thumbnails you will simply run either VirtualDrive project directly or the VirtualDrive.Package project. You do NOT need to register the handlers using regsrv32 or any using any other COM registration technique.</span></p>
<p>This sample provides thumbnails handler, context menu handler and custom states and properties handler.&nbsp;<span>All handlers are registered as an application extension by the packing project provided with the sample or as a sparse package manifest of the main application. To register handlers you will simply run either VirtualDrive project directly or the VirtualDrive.Package project. You do NOT need to register the handlers using regsrv32 or any using any other COM registration technique.</span></p>
<p><span>The COM handlers are automatically unregistered on package uninstall, you do not need to unregister them manually.</span></p>
<h3>Thumbnails Support</h3>
<p><span>The Virtual Drive sample provides <a title="Creating Thumbnails Provider" href="https://www.userfilesystem.com/programming/creating_thumbnails_provider/">thumbnail provider shell extension implementation</a> in the COM object. It loads thumbnails from files located in the remote storage simulation folder and displays them in Windows Explorer. You will adapt the code to load thumbnails from your real remote storage.</span></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.1.17328.0-Beta" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualDrive/VirtualDrive/VirtualDrive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This is an advanced project with ETags support, Microsoft Office documents editi
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.17328.0-Beta" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualDrive/VirtualDrive/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task CloseCompletionAsync(IOperationContext operationContext, IResu
public async Task ReadAsync(Stream output, long offset, long length, ITransferDataOperationContext operationContext, ITransferDataResultContext resultContext, CancellationToken cancellationToken)
{
// On Windows this method has a 60 sec timeout.
// To process longer requests and reset the timout timer call the resultContext.ReportProgress() or resultContext.ReturnData() method.
// To process longer requests and reset the timout timer write to the output stream or call the resultContext.ReportProgress() or resultContext.ReturnData() methods.

Logger.LogMessage($"{nameof(IFile)}.{nameof(ReadAsync)}({offset}, {length})", UserFileSystemPath, default, operationContext);

Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualFileSystem/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task CloseCompletionAsync(IOperationContext operationContext, IResu
public async Task ReadAsync(Stream output, long offset, long length, ITransferDataOperationContext operationContext, ITransferDataResultContext resultContext, CancellationToken cancellationToken)
{
// On Windows this method has a 60 sec timeout.
// To process longer requests and reset the timout timer call the resultContext.ReportProgress() or resultContext.ReturnData() method.
// To process longer requests and reset the timout timer write to the output stream or call the resultContext.ReportProgress() or resultContext.ReturnData() methods.

Logger.LogMessage($"{nameof(IFile)}.{nameof(ReadAsync)}({offset}, {length})", UserFileSystemPath, default, operationContext);

Expand Down
4 changes: 2 additions & 2 deletions Windows/WebDAVDrive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<li>To connect to WebDAV servers with cookies authentication Microsoft Edge&nbsp;is required.&nbsp;</li>
</ul>
<h2>Configuring the Sample</h2>
<p>To specify the WebDAV server URL edit the&nbsp;<code class="code">"WebDAVServerUrl"</code>&nbsp;parameter in&nbsp;<code class="code">appsettings.json</code>. This could be either a server root path (https://server/) or a WebDAV folder on your server (https://server/dav/).</p>
<p>To specify the WebDAV server URL edit the&nbsp;<code class="code">"WebDAVServerUrl"</code>&nbsp;<span>parameter in</span>&nbsp;<code class="code">appsettings.json</code>. This could be either a server root path (https://server/) or a WebDAV folder on your server (https://server/dav/).</p>
<p>For testing and demo purposes you can use one of the IT Hit demo servers. Navigate to https://webdavserver.net or to https://webdavserver.com in a web browser. Copy the URL or your test folder, that looks like https://webdavserver.net/User123456/ and specify it in the&nbsp;<code class="code">WebDAVServerUrl</code>&nbsp;parameter.</p>
<p>By default, this sample will mount the user file system under the&nbsp;<code class="code">%USERPROFILE%\DAV\</code>&nbsp;folder (typically&nbsp;<code class="code">C:\Users\&lt;username&gt;\DAV\</code>). To specify a different folder edit the&nbsp;<code class="code">"UserFileSystemRootPath"</code>&nbsp;parameter&nbsp;in&nbsp;<code class="code">appsettings.json</code>.</p>
<p>By default, this sample will mount the user file system under the&nbsp;<code class="code">%USERPROFILE%\DAV\</code>&nbsp;folder (typically&nbsp;<code class="code">C:\Users\&lt;username&gt;\DAV\</code>). To specify a different folder edit the&nbsp;<code class="code">"UserFileSystemRootPath"</code>&nbsp;<span>parameter in</span>&nbsp;<code class="code">appsettings.json</code>.</p>
<h2>Setting the License</h2>
<p><span class="warn">Note that to use the sample you need both the IT Hit WebDAV Client Library license and IT Hit User File System license.</span></p>
<p>To run the example, you will need both IT Hit WebDAV Client Library for .NET license and IT Hit User File System Engine for .NET License. You can download <span>a trial license in the&nbsp;<a title="Download" href="https://www.webdavsystem.com/client/download/">IT Hit WebDAV Client Library product download area</a>&nbsp;and in the&nbsp;<a title="Download" href="https://www.userfilesystem.com/download/">IT Hit User File System&nbsp;</a></span><a title="Download" href="https://www.userfilesystem.com/download/">product download area</a>.&nbsp;Note that this sample is fully functional with a trial license and does not have any limitations. The trial licenses are valid for one month will stop working after this. You can check the expiration date inside the license file.&nbsp;Download the licenses file and specify license strings in the&nbsp;<span><code class="code">WebDAVClientLicense</code> and&nbsp;<code class="code">UserFileSystemLicense</code></span>&nbsp;fields respectively in&nbsp;<code class="code">appsettings.json</code>&nbsp;file.&nbsp;Set the license content directly as a value (NOT as a path to the license file). Do not forget to escape quotes: \":</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Copyright>IT HIT LTD.</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.1.17328.0-Beta" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
Expand Down
28 changes: 19 additions & 9 deletions Windows/WebDAVDrive/WebDAVDrive/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task CloseCompletionAsync(IOperationContext operationContext, IResu
public async Task ReadAsync(Stream output, long offset, long length, ITransferDataOperationContext operationContext, ITransferDataResultContext resultContext, CancellationToken cancellationToken)
{
// On Windows this method has a 60 sec timeout.
// To process longer requests and reset the timout timer call the resultContext.ReportProgress() or resultContext.ReturnData() method.
// To process longer requests and reset the timout timer write to the output stream or call the resultContext.ReportProgress() or resultContext.ReturnData() methods.

Logger.LogMessage($"{nameof(IFile)}.{nameof(ReadAsync)}({offset}, {length})", UserFileSystemPath, default, operationContext);

Expand Down Expand Up @@ -129,16 +129,26 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
}
}

// Update remote storage file content,
// also get and save a new ETag returned by the server, if any.
string newEtag = await Program.DavClient.UploadAsync(new Uri(RemoteStoragePath), async (outputStream) =>
try
{
// Setting position to 0 is required in case of retry.
content.Position = 0;
await content.CopyToAsync(outputStream);
}, null, content.Length, 0, -1, lockTokens, oldEtag, cancellationToken);
// Update remote storage file content.
string newEtag = await Program.DavClient.UploadAsync(new Uri(RemoteStoragePath), async (outputStream) =>
{
content.Position = 0; // Setting position to 0 is required in case of retry.
await content.CopyToAsync(outputStream);
}, null, content.Length, 0, -1, lockTokens, oldEtag, cancellationToken);

await placeholder.Properties.AddOrUpdateAsync("ETag", newEtag);
// Save a new ETag returned by the server, if any.
await placeholder.Properties.AddOrUpdateAsync("ETag", newEtag);
}
catch (Client.Exceptions.PreconditionFailedException)
{
// Server and client ETags do not match.
// Set conflict status in Windows Explorer.

Logger.LogMessage($"Conflict. The item is modified.", UserFileSystemPath, default, operationContext);
placeholder.SetErrorStatus(true);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Windows/WebDAVDrive/WebDAVDrive/WebDAVDrive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.0.16962.0-Beta" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.17328.0-Beta" />
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
<ProjectReference Include="..\WebDAVDrive.UI\WebDAVDrive.UI.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 3a526bc

Please sign in to comment.