Skip to content

Commit 4652635

Browse files
committed
v7.3.24116.0
1 parent c662f00 commit 4652635

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1035
-119
lines changed

Common/Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Platforms>AnyCPU;x64</Platforms>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
14-
<PackageReference Include="ITHit.FileSystem" Version="7.2.23868.0" />
13+
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
14+
<PackageReference Include="ITHit.FileSystem" Version="7.3.24116.0" />
1515
</ItemGroup>
1616
</Project>

Windows/Common/Core/Common.Windows.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0-windows10.0.19041.0;net48</TargetFrameworks>
3+
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
44
<Description>Contains functionality common for all Windows Virtual Drive samples.</Description>
55
<Authors>IT Hit LTD.</Authors>
66
<Product>IT Hit User File System</Product>
@@ -20,8 +20,8 @@
2020
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
2121
</ItemGroup>
2222
<ItemGroup>
23-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.2.23868.0" />
24-
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
23+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.3.24116.0" />
24+
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
2525
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2626
</ItemGroup>
2727
</Project>

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0-windows10.0.19041.0;net48</TargetFrameworks>
3+
<TargetFrameworks>net7.0-windows10.0.19041.0;net48</TargetFrameworks>
44
<Description>Contains functionality common for all Windows Virtual Drive samples.</Description>
55
<Authors>IT Hit LTD.</Authors>
66
<Product>IT Hit User File System</Product>
@@ -13,7 +13,7 @@
1313
<Compile Remove="IVirtualFolder.cs" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.2.23868.0" />
16+
<PackageReference Include="ITHit.FileSystem.Windows" Version="7.3.24116.0" />
1717
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1818
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
1919
</ItemGroup>

Windows/VirtualDrive/VirtualDrive.ShellExtension/VirtualDrive.ShellExtension.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
3+
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
44
<EnableComHosting>True</EnableComHosting>
55
<Platforms>x64</Platforms>
66
<ApplicationIcon />
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.2.23868.0" />
22+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="7.3.24116.0" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<None Update="log4net.config">

Windows/VirtualDrive/VirtualDrive/VirtualDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
55
<Authors>IT Hit LTD.</Authors>
66
<Company>IT Hit LTD.</Company>
77
<Product>Virtual Drive</Product>
@@ -40,7 +40,7 @@ This is an advanced project with ETags support, Microsoft Office documents editi
4040
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.2.23868.0" />
43+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="7.3.24116.0" />
4444
<ProjectReference Include="..\..\..\Common\Common.csproj" />
4545
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
4646
</ItemGroup>

Windows/VirtualDrive/VirtualDrive/VirtualFile.cs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public async Task ValidateDataAsync(long offset, long length, IValidateDataOpera
9090
}
9191

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

97-
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
97+
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;
9898

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

131131
// Update remote storage file metadata.
132-
remoteStorageItem.Attributes = fileMetadata.Attributes & ~FileAttributes.ReadOnly;
133-
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
134-
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
135-
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
136-
remoteStorageItem.Attributes = fileMetadata.Attributes;
132+
if (fileBasicInfo.Attributes.HasValue)
133+
{
134+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
135+
}
136+
137+
if (fileBasicInfo.CreationTime.HasValue)
138+
{
139+
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
140+
}
141+
142+
if (fileBasicInfo.LastWriteTime.HasValue)
143+
{
144+
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
145+
}
146+
147+
if (fileBasicInfo.LastAccessTime.HasValue)
148+
{
149+
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
150+
}
151+
152+
if (fileBasicInfo.Attributes.HasValue)
153+
{
154+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
155+
}
137156

138157
// Save ETag received from your remote storage in persistent placeholder properties.
139158
// string newEtag = ...
140159
// placeholder.SetETag(newEtag);
160+
161+
return null;
141162
}
142163
}
143164
}

Windows/VirtualDrive/VirtualDrive/VirtualFolder.cs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,40 @@ public async Task<IEnumerable<FileSystemItemMetadataExt>> EnumerateChildrenAsync
168168
}
169169

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

175-
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
175+
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;
176176
DirectoryInfo remoteStorageItem = new DirectoryInfo(remoteStoragePath);
177177

178178
// Update remote storage folder metadata.
179-
remoteStorageItem.Attributes = folderMetadata.Attributes & ~FileAttributes.ReadOnly;
180-
remoteStorageItem.CreationTimeUtc = folderMetadata.CreationTime.UtcDateTime;
181-
remoteStorageItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
182-
remoteStorageItem.LastAccessTimeUtc = folderMetadata.LastAccessTime.UtcDateTime;
183-
remoteStorageItem.Attributes = folderMetadata.Attributes;
179+
if (fileBasicInfo.Attributes.HasValue)
180+
{
181+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
182+
}
183+
184+
if (fileBasicInfo.CreationTime.HasValue)
185+
{
186+
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
187+
}
188+
189+
if (fileBasicInfo.LastWriteTime.HasValue)
190+
{
191+
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
192+
}
193+
194+
if (fileBasicInfo.LastAccessTime.HasValue)
195+
{
196+
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
197+
}
198+
199+
if (fileBasicInfo.Attributes.HasValue)
200+
{
201+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
202+
}
203+
204+
return null;
184205
}
185206

186207

Windows/VirtualDrive/VirtualDrive/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

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

2828

2929
// Full synchronization interval in milliseconds.

Windows/VirtualFileSystem/RemoteStorageMonitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ internal static bool IsModified(string userFileSystemPath, string remoteStorageP
317317
FileInfo fiUserFileSystem = new FileInfo(userFileSystemPath);
318318
FileInfo fiRemoteStorage = new FileInfo(remoteStoragePath);
319319

320-
// This check is to prevent circular calls. In you real app you wouuld not send notifications to the client that generated the event.
320+
// This check is to prevent circular calls. In your real app you would not send notifications to the client that generated the event.
321321
if (fiUserFileSystem.LastWriteTimeUtc >= fiRemoteStorage.LastWriteTimeUtc)
322322
{
323323
return false;
@@ -328,7 +328,7 @@ internal static bool IsModified(string userFileSystemPath, string remoteStorageP
328328
if (fiUserFileSystem.Length == fiRemoteStorage.Length)
329329
{
330330
// Verify that the file is not offline,
331-
// therwise the file will be hydrated when the file stream is opened.
331+
// otherwise the file will be hydrated when the file stream is opened.
332332
if (fiUserFileSystem.Attributes.HasFlag(System.IO.FileAttributes.Offline)
333333
|| fiUserFileSystem.Attributes.HasFlag(System.IO.FileAttributes.Offline))
334334
{

Windows/VirtualFileSystem/VirtualFile.cs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ public async Task ValidateDataAsync(long offset, long length, IValidateDataOpera
8383
}
8484

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

90-
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return;
90+
if (!Mapping.TryGetRemoteStoragePathById(RemoteStorageItemId, out string remoteStoragePath)) return null;
9191

9292
FileInfo remoteStorageItem = new FileInfo(remoteStoragePath);
9393

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

104104
// Update remote storage file metadata.
105-
remoteStorageItem.Attributes = fileMetadata.Attributes & ~FileAttributes.ReadOnly;
106-
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
107-
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
108-
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
109-
remoteStorageItem.Attributes = fileMetadata.Attributes;
105+
if (fileBasicInfo.Attributes.HasValue)
106+
{
107+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value & ~FileAttributes.ReadOnly;
108+
}
109+
110+
if (fileBasicInfo.CreationTime.HasValue)
111+
{
112+
remoteStorageItem.CreationTimeUtc = fileBasicInfo.CreationTime.Value.UtcDateTime;
113+
}
114+
115+
if (fileBasicInfo.LastWriteTime.HasValue)
116+
{
117+
remoteStorageItem.LastWriteTimeUtc = fileBasicInfo.LastWriteTime.Value.UtcDateTime;
118+
}
119+
120+
if (fileBasicInfo.LastAccessTime.HasValue)
121+
{
122+
remoteStorageItem.LastAccessTimeUtc = fileBasicInfo.LastAccessTime.Value.UtcDateTime;
123+
}
124+
125+
if (fileBasicInfo.Attributes.HasValue)
126+
{
127+
remoteStorageItem.Attributes = fileBasicInfo.Attributes.Value;
128+
}
129+
130+
return null;
110131
}
111132
}
112133
}

0 commit comments

Comments
 (0)