Skip to content

Commit

Permalink
v7.3.24116.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ITHitBuild committed Dec 14, 2023
1 parent c662f00 commit 4652635
Show file tree
Hide file tree
Showing 47 changed files with 1,035 additions and 119 deletions.
4 changes: 2 additions & 2 deletions Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
<PackageReference Include="ITHit.FileSystem" Version="7.3.24116.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions Windows/Common/Core/Common.Windows.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041.0;net48</TargetFrameworks>
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
<Description>Contains functionality common for all Windows Virtual Drive samples.</Description>
<Authors>IT Hit LTD.</Authors>
<Product>IT Hit User File System</Product>
Expand All @@ -20,8 +20,8 @@
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.3.24116.0" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041.0;net48</TargetFrameworks>
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
<Description>Contains functionality common for all Windows Virtual Drive samples.</Description>
<Authors>IT Hit LTD.</Authors>
<Product>IT Hit User File System</Product>
Expand All @@ -13,7 +13,7 @@
<Compile Remove="IVirtualFolder.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<EnableComHosting>True</EnableComHosting>
<Platforms>x64</Platforms>
<ApplicationIcon />
Expand All @@ -19,7 +19,7 @@
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.3.24116.0" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
Expand Down
4 changes: 2 additions & 2 deletions Windows/VirtualDrive/VirtualDrive/VirtualDrive.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<Authors>IT Hit LTD.</Authors>
<Company>IT Hit LTD.</Company>
<Product>Virtual Drive</Product>
Expand Down 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="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.3.24116.0" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
</ItemGroup>
Expand Down
35 changes: 28 additions & 7 deletions Windows/VirtualDrive/VirtualDrive/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ public async Task ValidateDataAsync(long offset, long length, IValidateDataOpera
}

/// <inheritdoc/>
public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFileMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
Logger.LogMessage($"{nameof(IFile)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);

if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;

// Send the ETag to the server as part of the update to ensure
// the file in the remote storge is not modified since last read.
Expand Down Expand Up @@ -129,15 +129,36 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
}

// Update remote storage file metadata.
remoteStorageItem.Attributes = fileMetadata.Attributes & ~FileAttributes.ReadOnly;
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
remoteStorageItem.Attributes = fileMetadata.Attributes;
if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
}

if (fileBasicInfo.CreationTime.HasValue)
{
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastWriteTime.HasValue)
{
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastAccessTime.HasValue)
{
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
}

if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
}

// Save ETag received from your remote storage in persistent placeholder properties.
// string newEtag = ...
// placeholder.SetETag(newEtag);

return null;
}
}
}
35 changes: 28 additions & 7 deletions Windows/VirtualDrive/VirtualDrive/VirtualFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,40 @@ public async Task<IEnumerable<FileSystemItemMetadataExt>> EnumerateChildrenAsync
}

/// <inheritdoc/>
public async Task WriteAsync(IFolderMetadata folderMetadata, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFolderMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
Logger.LogMessage($"{nameof(IFolder)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);

if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;
DirectoryInfo remoteStorageItem = new DirectoryInfo(remoteStoragePath);

// Update remote storage folder metadata.
remoteStorageItem.Attributes = folderMetadata.Attributes & ~FileAttributes.ReadOnly;
remoteStorageItem.CreationTimeUtc = folderMetadata.CreationTime.UtcDateTime;
remoteStorageItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
remoteStorageItem.LastAccessTimeUtc = folderMetadata.LastAccessTime.UtcDateTime;
remoteStorageItem.Attributes = folderMetadata.Attributes;
if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
}

if (fileBasicInfo.CreationTime.HasValue)
{
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastWriteTime.HasValue)
{
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastAccessTime.HasValue)
{
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
}

if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
}

return null;
}


Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualDrive/VirtualDrive/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Your virtual file system will be mounted under this path.
// Make sure to delete the all plceholders created by previous version of the software under the sync root.
"UserFileSystemRootPath": "%USERPROFILE%\\VirtualDriveV7\\",
"UserFileSystemRootPath": "%USERPROFILE%\\VirtualDriveV73\\",


// Full synchronization interval in milliseconds.
Expand Down
4 changes: 2 additions & 2 deletions Windows/VirtualFileSystem/RemoteStorageMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ internal static bool IsModified(string userFileSystemPath, string remoteStorageP
FileInfo fiUserFileSystem = new FileInfo(userFileSystemPath);
FileInfo fiRemoteStorage = new FileInfo(remoteStoragePath);

// This check is to prevent circular calls. In you real app you wouuld not send notifications to the client that generated the event.
// This check is to prevent circular calls. In your real app you would not send notifications to the client that generated the event.
if (fiUserFileSystem.LastWriteTimeUtc >= fiRemoteStorage.LastWriteTimeUtc)
{
return false;
Expand All @@ -328,7 +328,7 @@ internal static bool IsModified(string userFileSystemPath, string remoteStorageP
if (fiUserFileSystem.Length == fiRemoteStorage.Length)
{
// Verify that the file is not offline,
// therwise the file will be hydrated when the file stream is opened.
// otherwise the file will be hydrated when the file stream is opened.
if (fiUserFileSystem.Attributes.HasFlag(System.IO.FileAttributes.Offline)
|| fiUserFileSystem.Attributes.HasFlag(System.IO.FileAttributes.Offline))
{
Expand Down
35 changes: 28 additions & 7 deletions Windows/VirtualFileSystem/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public async Task ValidateDataAsync(long offset, long length, IValidateDataOpera
}

/// <inheritdoc/>
public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFileMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
Logger.LogMessage($"{nameof(IFile)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);

if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;

FileInfo remoteStorageItem = new FileInfo(remoteStoragePath);

Expand All @@ -102,11 +102,32 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
}

// Update remote storage file metadata.
remoteStorageItem.Attributes = fileMetadata.Attributes & ~FileAttributes.ReadOnly;
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
remoteStorageItem.Attributes = fileMetadata.Attributes;
if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
}

if (fileBasicInfo.CreationTime.HasValue)
{
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastWriteTime.HasValue)
{
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastAccessTime.HasValue)
{
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
}

if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
}

return null;
}
}
}
2 changes: 1 addition & 1 deletion Windows/VirtualFileSystem/VirtualFileSystem.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0-windows10.0.19041.0;net48</TargetFrameworks>
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
<Authors>IT Hit LTD.</Authors>
<Company>IT Hit LTD.</Company>
<Product>Virtual File System</Product>
Expand Down
35 changes: 28 additions & 7 deletions Windows/VirtualFileSystem/VirtualFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,40 @@ public async Task GetChildrenAsync(string pattern, IOperationContext operationCo
}

/// <inheritdoc/>
public async Task WriteAsync(IFolderMetadata folderMetadata, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFolderMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
Logger.LogMessage($"{nameof(IFolder)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);

if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;
DirectoryInfo remoteStorageItem = new DirectoryInfo(remoteStoragePath);

// Update remote storage folder metadata.
remoteStorageItem.Attributes = folderMetadata.Attributes & ~FileAttributes.ReadOnly;
remoteStorageItem.CreationTimeUtc = folderMetadata.CreationTime.UtcDateTime;
remoteStorageItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
remoteStorageItem.LastAccessTimeUtc = folderMetadata.LastAccessTime.UtcDateTime;
remoteStorageItem.Attributes = folderMetadata.Attributes;
if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
}

if (fileBasicInfo.CreationTime.HasValue)
{
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastWriteTime.HasValue)
{
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
}

if (fileBasicInfo.LastAccessTime.HasValue)
{
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
}

if (fileBasicInfo.Attributes.HasValue)
{
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
}

return null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualFileSystem/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Your virtual file system will be mounted under this path.
// Make sure to delete the all plceholders created by previous version of the software under the sync root.
"UserFileSystemRootPath": "%USERPROFILE%\\VFSv7\\"
"UserFileSystemRootPath": "%USERPROFILE%\\VFSv73\\"


// To test performance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<EnableComHosting>True</EnableComHosting>
<Platforms>x64</Platforms>
<ApplicationIcon />
Expand All @@ -12,7 +12,7 @@
<Copyright>IT HIT LTD.</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.2.23868.0" />
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.3.24116.0" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
Expand Down
2 changes: 1 addition & 1 deletion Windows/WebDAVDrive/WebDAVDrive.UI/WebDAVDrive.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<Copyright>IT Hit LTD.</Copyright>
Expand Down
4 changes: 3 additions & 1 deletion Windows/WebDAVDrive/WebDAVDrive/VirtualFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public async Task ValidateDataAsync(long offset, long length, IValidateDataOpera
}

/// <inheritdoc/>
public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFileMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, Stream content = null, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
Logger.LogMessage($"{nameof(IFile)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);

Expand Down Expand Up @@ -144,6 +144,8 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
inSyncResultContext.SetInSync = false;
}
}

return null;
}
}
}
3 changes: 2 additions & 1 deletion Windows/WebDAVDrive/WebDAVDrive/VirtualFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ public async Task<IEnumerable<FileSystemItemMetadataExt>> EnumerateChildrenAsync
}

/// <inheritdoc/>
public async Task WriteAsync(IFolderMetadata folderMetadata, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
public async Task<IFolderMetadata> WriteAsync(IFileSystemBasicInfo fileBasicInfo, IOperationContext operationContext = null, IInSyncResultContext inSyncResultContext = null, CancellationToken cancellationToken = default)
{
// Typically we can not change any folder metadata on a WebDAV server, just logging the call.
Logger.LogMessage($"{nameof(IFolder)}.{nameof(WriteAsync)}()", UserFileSystemPath, default, operationContext);
return null;
}

/// <inheritdoc/>
Expand Down
Loading

0 comments on commit 4652635

Please sign in to comment.