Skip to content

Commit 616e4e9

Browse files
committed
v7.1.4792
1 parent ba7f57c commit 616e4e9

File tree

159 files changed

+5391
-399
lines changed

Some content is hidden

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

159 files changed

+5391
-399
lines changed

CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProductVersion>9.0.30729</ProductVersion>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<ProjectGuid>3DFC448C-7D81-4ADD-BBEC-E2D0C00591B6</ProjectGuid>
9+
<ProjectGuid>2281EA16-FF31-44C9-BD95-9BB6D43322FA</ProjectGuid>
1010
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1111
<OutputType>Library</OutputType>
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -74,6 +74,7 @@
7474
<Compile Include="Discovery.cs" />
7575
<Compile Include="Logger.cs" />
7676
<Compile Include="ExtendedAttributes\FileSystemInfoExtension.cs" />
77+
<Compile Include="ExtendedAttributes\FileSystemExtendedAttribute.cs" />
7778
<Compile Include="ExtendedAttributes\IExtendedAttribute.cs" />
7879
<Compile Include="ExtendedAttributes\LinuxExtendedAttribute.cs" />
7980
<Compile Include="ExtendedAttributes\OSXExtendedAttribute.cs" />
@@ -123,10 +124,10 @@
123124
</ItemGroup>
124125
<ItemGroup>
125126
<Reference Include="ITHit.WebDAV.Server">
126-
<HintPath>..\packages\ITHit.WebDAV.Server.7.1.4620\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
127+
<HintPath>..\packages\ITHit.WebDAV.Server.7.1.4792\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
127128
</Reference>
128129
<Reference Include="ITHit.WebDAV.Server.Web">
129-
<HintPath>..\packages\ITHit.WebDAV.Server.Web.7.1.4620\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
130+
<HintPath>..\packages\ITHit.WebDAV.Server.Web.7.1.4792\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
130131
</Reference>
131132
</ItemGroup>
132133
<PropertyGroup>
@@ -144,7 +145,7 @@
144145
<AutoAssignPort>True</AutoAssignPort>
145146
<DevelopmentServerPort>9658</DevelopmentServerPort>
146147
<DevelopmentServerVPath>/</DevelopmentServerVPath>
147-
<IISUrl>http://localhost:18524/</IISUrl>
148+
<IISUrl>http://localhost:13414/</IISUrl>
148149
<NTLMAuthentication>True</NTLMAuthentication>
149150
<UseCustomServer>False</UseCustomServer>
150151
<CustomServerUrl>

CS/CalDAVServer.FileSystemStorage.AspNet/DavContext.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
using ITHit.WebDAV.Server.Quota;
1515
using CalDAVServer.FileSystemStorage.AspNet.Acl;
1616
using CalDAVServer.FileSystemStorage.AspNet.CalDav;
17+
using CalDAVServer.FileSystemStorage.AspNet.ExtendedAttributes;
18+
1719

1820

1921
namespace CalDAVServer.FileSystemStorage.AspNet
@@ -180,6 +182,24 @@ public DavContext(HttpContext httpContext) : base(httpContext)
180182
RepositoryPath = configRepositoryPath.StartsWith("~") ?
181183
HttpContext.Current.Server.MapPath(configRepositoryPath) : configRepositoryPath;
182184

185+
string attrStoragePath = (ConfigurationManager.AppSettings["AttrStoragePath"] ?? string.Empty).TrimEnd(Path.DirectorySeparatorChar);
186+
attrStoragePath = attrStoragePath.StartsWith("~") ?
187+
HttpContext.Current.Server.MapPath(attrStoragePath) : attrStoragePath;
188+
189+
if (!FileSystemInfoExtension.IsUsingFileSystemAttribute)
190+
{
191+
if (!string.IsNullOrEmpty(attrStoragePath))
192+
{
193+
FileSystemInfoExtension.UseFileSystemAttribute(new FileSystemExtendedAttribute(attrStoragePath, this.RepositoryPath));
194+
}
195+
else if (!(new DirectoryInfo(RepositoryPath).IsExtendedAttributesSupported()))
196+
{
197+
var tempPath = Path.Combine(Path.GetTempPath(), System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
198+
FileSystemInfoExtension.UseFileSystemAttribute(new FileSystemExtendedAttribute(tempPath, this.RepositoryPath));
199+
}
200+
}
201+
202+
183203
if (!Directory.Exists(RepositoryPath))
184204
{
185205
CalDAVServer.FileSystemStorage.AspNet.Logger.Instance.LogError("Repository path specified in Web.config is invalid.", null);

CS/CalDAVServer.FileSystemStorage.AspNet/DavFile.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,17 @@ public override async Task CopyToAsync(IItemCollectionAsync destFolder, string d
229229
{
230230
File.Copy(fileSystemInfo.FullName, newFilePath);
231231

232+
var newFileSystemInfo = new FileInfo(newFilePath);
233+
if (FileSystemInfoExtension.IsUsingFileSystemAttribute)
234+
{
235+
await fileSystemInfo.CopyExtendedAttributes(newFileSystemInfo);
236+
}
237+
232238
// Locks should not be copied, delete them.
233239
if (await fileSystemInfo.HasExtendedAttributeAsync("Locks"))
234-
await new FileInfo(newFilePath).DeleteExtendedAttributeAsync("Locks");
240+
{
241+
await newFileSystemInfo.DeleteExtendedAttributeAsync("Locks");
242+
}
235243
}
236244
catch (UnauthorizedAccessException)
237245
{
@@ -284,8 +292,13 @@ public override async Task MoveToAsync(IItemCollectionAsync destFolder, string d
284292
{
285293
File.Move(fileSystemInfo.FullName, newDirPath);
286294

287-
// Locks should not be copied, delete them.
288295
var newFileInfo = new FileInfo(newDirPath);
296+
if (FileSystemInfoExtension.IsUsingFileSystemAttribute)
297+
{
298+
await fileSystemInfo.MoveExtendedAttributes(newFileInfo);
299+
}
300+
301+
// Locks should not be copied, delete them.
289302
if (await newFileInfo.HasExtendedAttributeAsync("Locks"))
290303
await newFileInfo.DeleteExtendedAttributeAsync("Locks");
291304
}
@@ -307,6 +320,11 @@ public override async Task MoveToAsync(IItemCollectionAsync destFolder, string d
307320
/// <param name="multistatus">Information about items that failed to delete.</param>
308321
public override async Task DeleteAsync(MultistatusException multistatus)
309322
{
323+
if (FileSystemInfoExtension.IsUsingFileSystemAttribute)
324+
{
325+
await fileSystemInfo.DeleteExtendedAttributes();
326+
}
327+
310328
fileSystemInfo.Delete();
311329
}
312330

0 commit comments

Comments
 (0)