Skip to content

Commit abf8f9d

Browse files
committed
v5.6.16415.0
1 parent 0329171 commit abf8f9d

File tree

11 files changed

+42
-34
lines changed

11 files changed

+42
-34
lines changed

Common/Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<Platforms>AnyCPU;x64</Platforms>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ITHit.FileSystem" Version="5.6.16382.0" />
13+
<PackageReference Include="ITHit.FileSystem" Version="5.6.16415.0" />
1414
</ItemGroup>
1515
</Project>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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="5.6.16382.0" />
24-
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16382.0" />
23+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="5.6.16415.0" />
24+
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16415.0" />
2525
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2626
</ItemGroup>
2727
</Project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Platforms>AnyCPU;x64</Platforms>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16382.0" />
12+
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16415.0" />
1313
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1414
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
1515
</ItemGroup>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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="5.6.16382.0" />
22+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16415.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
@@ -40,8 +40,8 @@ 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="5.6.16382.0" />
44-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16382.0" />
43+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="5.6.16415.0" />
44+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16415.0" />
4545
<ProjectReference Include="..\..\..\Common\Common.csproj" />
4646
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
4747
<ProjectReference Include="..\VirtualDrive.ShellExtension\VirtualDrive.ShellExtension.csproj" />

Windows/WebDAVDrive/WebDAVDrive.ShellExtension/WebDAVDrive.ShellExtension.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Copyright>IT HIT LTD.</Copyright>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16382.0" />
15+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16415.0" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<None Update="log4net.config">

Windows/WebDAVDrive/WebDAVDrive.UI/WebDAVDrive.UI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="ITHitWebDAVClient" Version="5.3.3490" />
1919
</ItemGroup>
2020
<ItemGroup>
21-
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16382.0" />
21+
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16415.0" />
2222
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2323
</ItemGroup>
2424
<ItemGroup>

Windows/WebDAVDrive/WebDAVDrive/RemoteStorageMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private async Task CreatedAsync(string remoteStoragePath)
206206
// Because of the on-demand population the file or folder placeholder may not exist in the user file system.
207207
// We do not want to send extra requests to the remote storage if the parent folder is offline.
208208
if (Directory.Exists(userFileSystemParentPath)
209-
&& !new DirectoryInfo(userFileSystemParentPath).Attributes.HasFlag(System.IO.FileAttributes.Offline)
209+
&& !new DirectoryInfo(userFileSystemParentPath).Attributes.HasFlag(FileAttributes.Offline)
210210
&& !FsPath.Exists(userFileSystemPath))
211211
{
212212
IHierarchyItem remoteStorageItem = await Program.DavClient.GetItemAsync(new Uri(remoteStoragePath));

Windows/WebDAVDrive/WebDAVDrive/VirtualFileSystemItem.cs

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ public async Task LockAsync(LockMode lockMode, IOperationContext operationContex
264264
// Save the lock token and other lock info received from the remote storage on the client.
265265
// Supply the lock-token as part of each remote storage update in IFile.WriteAsync() method.
266266

267-
LockInfo lockInfo = await Program.DavClient.LockAsync(new Uri(RemoteStoragePath), LockScope.Exclusive, false, null, TimeSpan.MaxValue, cancellationToken);
267+
// Here we set lock owner name to loged-in user for demo purposes.
268+
string lockOwner = Environment.UserName;
269+
LockInfo lockInfo = await Program.DavClient.LockAsync(new Uri(RemoteStoragePath), LockScope.Exclusive, false, lockOwner, TimeSpan.MaxValue, cancellationToken);
268270
ServerLockInfo serverLockInfo = new ServerLockInfo
269271
{
270272
LockToken = lockInfo.LockToken.LockToken,
@@ -274,11 +276,14 @@ public async Task LockAsync(LockMode lockMode, IOperationContext operationContex
274276
};
275277

276278
// Save lock-token and lock-mode.
277-
PlaceholderItem placeholder = Engine.Placeholders.GetItem(UserFileSystemPath);
278-
await placeholder.Properties.AddOrUpdateAsync("LockInfo", serverLockInfo);
279-
await placeholder.Properties.AddOrUpdateAsync("LockMode", lockMode);
279+
if (Engine.Placeholders.TryGetItem(UserFileSystemPath, out PlaceholderItem placeholder))
280+
{
281+
await placeholder.Properties.AddOrUpdateAsync("LockInfo", serverLockInfo);
282+
await placeholder.Properties.AddOrUpdateAsync("LockMode", lockMode);
283+
placeholder.UpdateUI();
280284

281-
Logger.LogDebug("Locked in the remote storage successfully", UserFileSystemPath, default, operationContext);
285+
Logger.LogDebug("Locked in the remote storage successfully", UserFileSystemPath, default, operationContext);
286+
}
282287
}
283288

284289

@@ -308,25 +313,28 @@ public async Task UnlockAsync(IOperationContext operationContext = null, Cancell
308313
Logger.LogMessage($"{nameof(ILock)}.{nameof(UnlockAsync)}()", UserFileSystemPath, default, operationContext);
309314

310315
// Read the lock-token.
311-
PlaceholderItem placeholder = Engine.Placeholders.GetItem(UserFileSystemPath);
312-
string lockToken = (await placeholder.Properties["LockInfo"].GetValueAsync<ServerLockInfo>())?.LockToken;
316+
if (Engine.Placeholders.TryGetItem(UserFileSystemPath, out PlaceholderItem placeholder))
317+
{
318+
string lockToken = (await placeholder.Properties["LockInfo"].GetValueAsync<ServerLockInfo>())?.LockToken;
313319

314-
LockUriTokenPair[] lockTokens = new LockUriTokenPair[] { new LockUriTokenPair(new Uri(RemoteStoragePath), lockToken)};
320+
LockUriTokenPair[] lockTokens = new LockUriTokenPair[] { new LockUriTokenPair(new Uri(RemoteStoragePath), lockToken) };
315321

316-
// Unlock the item in the remote storage.
317-
try
318-
{
319-
await Program.DavClient.UnlockAsync(new Uri(RemoteStoragePath), lockTokens, cancellationToken);
320-
Logger.LogDebug("Unlocked in the remote storage successfully", UserFileSystemPath, default, operationContext);
321-
}
322-
catch (ITHit.WebDAV.Client.Exceptions.ConflictException)
323-
{
324-
Logger.LogDebug("The item is already unlocked.", UserFileSystemPath, default, operationContext);
325-
}
322+
// Unlock the item in the remote storage.
323+
try
324+
{
325+
await Program.DavClient.UnlockAsync(new Uri(RemoteStoragePath), lockTokens, cancellationToken);
326+
Logger.LogDebug("Unlocked in the remote storage successfully", UserFileSystemPath, default, operationContext);
327+
}
328+
catch (ITHit.WebDAV.Client.Exceptions.ConflictException)
329+
{
330+
Logger.LogDebug("The item is already unlocked.", UserFileSystemPath, default, operationContext);
331+
}
326332

327-
// Delete lock-mode and lock-token info.
328-
placeholder.Properties.Remove("LockInfo");
329-
placeholder.Properties.Remove("LockMode");
333+
// Delete lock-mode and lock-token info.
334+
placeholder.Properties.Remove("LockInfo");
335+
placeholder.Properties.Remove("LockMode");
336+
placeholder.UpdateUI();
337+
}
330338
}
331339

332340
}

Windows/WebDAVDrive/WebDAVDrive/VirtualFolder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public async Task<byte[]> CreateFolderAsync(IFolderMetadata folderMetadata, IInS
6666
Uri newFolderUri = new Uri(new Uri(RemoteStoragePath), folderMetadata.Name);
6767
await Program.DavClient.CreateFolderAsync(newFolderUri, null, cancellationToken);
6868

69-
// WebDAV server sypically does not provide eTags for folders.
69+
// WebDAV server typically does not provide eTags for folders.
7070
// Store ETag (if any) unlil the next update here.
7171
//PlaceholderItem placeholder = Engine.Placeholders.GetItem(userFileSystemNewItemPath);
7272
//await placeholder.Properties.AddOrUpdateAsync("ETag", eTag);

0 commit comments

Comments
 (0)