Revision 0daedeef
b/trunk/Pithos.Client.WPF/Pithos.Client.WPF.csproj | ||
---|---|---|
340 | 340 |
<DependentUpon>ProxyAccountView.xaml</DependentUpon> |
341 | 341 |
</Compile> |
342 | 342 |
<Compile Include="Preferences\ProxyAccountViewModel.cs" /> |
343 |
<Compile Include="Properties\AssemblyVersion.cs" /> |
|
343 | 344 |
<Compile Include="Proxy.cs" /> |
344 | 345 |
<Compile Include="Shell\AboutView.xaml.cs"> |
345 | 346 |
<DependentUpon>AboutView.xaml</DependentUpon> |
b/trunk/Pithos.Client.WPF/Properties/AssemblyInfo.cs | ||
---|---|---|
48 | 48 |
// General Information about an assembly is controlled through the following |
49 | 49 |
// set of attributes. Change these attribute values to modify the information |
50 | 50 |
// associated with an assembly. |
51 |
[assembly: AssemblyProduct("Pithos+ Client for Windows")] |
|
51 | 52 |
[assembly: AssemblyTitle("Pithos+ Client for Windows")] |
52 | 53 |
[assembly: AssemblyDescription("Pithos+ Client for Windows")] |
53 | 54 |
[assembly: AssemblyConfiguration("")] |
54 |
[assembly: AssemblyCompany("GRNET")] |
|
55 |
[assembly: AssemblyProduct("Pithos+ Client for Windows")] |
|
56 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011-2012")] |
|
57 | 55 |
[assembly: AssemblyTrademark("")] |
58 | 56 |
[assembly: AssemblyCulture("")] |
59 |
[assembly: AssemblyInformationalVersion("2012-06-07")] |
|
57 |
|
|
60 | 58 |
|
61 | 59 |
// Setting ComVisible to false makes the types in this assembly not visible |
62 | 60 |
// to COM components. If you need to access a type in this assembly from |
... | ... | |
93 | 91 |
// You can specify all the values or you can default the Build and Revision Numbers |
94 | 92 |
// by using the '*' as shown below: |
95 | 93 |
// [assembly: AssemblyVersion("1.0.*")] |
96 |
[assembly: AssemblyVersion("0.7.20703.1")] |
|
97 |
[assembly: AssemblyFileVersionAttribute("0.7.20703.1")] |
b/trunk/Pithos.Client.WPF/Properties/AssemblyVersion.cs | ||
---|---|---|
1 |
#region |
|
2 |
/* ----------------------------------------------------------------------- |
|
3 |
* <copyright file="AssemblyInfo.cs" company="GRNet"> |
|
4 |
* |
|
5 |
* Copyright 2011-2012 GRNET S.A. All rights reserved. |
|
6 |
* |
|
7 |
* Redistribution and use in source and binary forms, with or |
|
8 |
* without modification, are permitted provided that the following |
|
9 |
* conditions are met: |
|
10 |
* |
|
11 |
* 1. Redistributions of source code must retain the above |
|
12 |
* copyright notice, this list of conditions and the following |
|
13 |
* disclaimer. |
|
14 |
* |
|
15 |
* 2. Redistributions in binary form must reproduce the above |
|
16 |
* copyright notice, this list of conditions and the following |
|
17 |
* disclaimer in the documentation and/or other materials |
|
18 |
* provided with the distribution. |
|
19 |
* |
|
20 |
* |
|
21 |
* THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
|
22 |
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
23 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
24 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
|
25 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
26 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
27 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
28 |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
29 |
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
30 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
31 |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
32 |
* POSSIBILITY OF SUCH DAMAGE. |
|
33 |
* |
|
34 |
* The views and conclusions contained in the software and |
|
35 |
* documentation are those of the authors and should not be |
|
36 |
* interpreted as representing official policies, either expressed |
|
37 |
* or implied, of GRNET S.A. |
|
38 |
* </copyright> |
|
39 |
* ----------------------------------------------------------------------- |
|
40 |
*/ |
|
41 |
#endregion |
|
42 |
using System.Reflection; |
|
43 |
|
|
44 |
// General Information about an assembly is controlled through the following |
|
45 |
// set of attributes. Change these attribute values to modify the information |
|
46 |
// associated with an assembly. |
|
47 |
[assembly: AssemblyCompany("GRNET")] |
|
48 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011-2012")] |
|
49 |
[assembly: AssemblyInformationalVersion("2012-07-03")] |
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
// Version information for an assembly consists of the following four values: |
|
54 |
// |
|
55 |
// Major Version |
|
56 |
// Minor Version |
|
57 |
// Build Number |
|
58 |
// Revision |
|
59 |
// |
|
60 |
// You can specify all the values or you can default the Build and Revision Numbers |
|
61 |
// by using the '*' as shown below: |
|
62 |
// [assembly: AssemblyVersion("1.0.*")] |
|
63 |
[assembly: AssemblyVersion("0.7.20704.*")] |
b/trunk/Pithos.Core.Test/NetworkAgentTest.cs | ||
---|---|---|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
|
53 |
client.DeleteObject(null, FolderConstants.PithosContainer, fileName); |
|
53 |
client.DeleteObject(null, FolderConstants.PithosContainer, fileName, false);
|
|
54 | 54 |
|
55 | 55 |
var treeHash = Signature.CalculateTreeHashAsync(filePath, accountInfo.BlockSize, accountInfo.BlockHash, 2, new Progress<double>()); |
56 | 56 |
var cloudFile = new ObjectInfo {Account = account, Container = "pithos"}; |
b/trunk/Pithos.Core/Agents/DeleteAgent.cs | ||
---|---|---|
226 | 226 |
var container = cloudFile.Container;//?? FolderConstants.PithosContainer; |
227 | 227 |
|
228 | 228 |
var client = new CloudFilesClient(accountInfo); |
229 |
client.DeleteObject(account, container, cloudFile.Name); |
|
229 |
|
|
230 |
client.DeleteObject(account, container, cloudFile.Name,cloudFile.IsDirectory); |
|
230 | 231 |
|
231 | 232 |
StatusKeeper.ClearFileStatus(fullPath); |
232 | 233 |
StatusNotification.Notify(new CloudNotification{Data=cloudFile}); |
b/trunk/Pithos.Core/Agents/FileAgent.cs | ||
---|---|---|
518 | 518 |
//Ignore takes into account Selective Sync |
519 | 519 |
if (Ignore(fullPath)) |
520 | 520 |
return; |
521 |
|
|
521 |
PollAgent.PostMove(e); |
|
522 | 522 |
_eventIdleBatch.Post(e); |
523 | 523 |
} |
524 | 524 |
|
b/trunk/Pithos.Core/Agents/PollAgent.cs | ||
---|---|---|
161 | 161 |
|
162 | 162 |
readonly ConcurrentQueue<IEnumerable<string>> _batchQueue=new ConcurrentQueue<IEnumerable<string>>(); |
163 | 163 |
|
164 |
ConcurrentDictionary<string,MovedEventArgs> _moves=new ConcurrentDictionary<string, MovedEventArgs>(); |
|
165 |
|
|
166 |
public void PostMove(MovedEventArgs args) |
|
167 |
{ |
|
168 |
TaskEx.Run(() => _moves.AddOrUpdate(args.OldFullPath, args,(s,e)=>e)); |
|
169 |
} |
|
170 |
|
|
164 | 171 |
/// <summary> |
165 | 172 |
/// Remote files are polled periodically. Any changes are processed |
166 | 173 |
/// </summary> |
... | ... | |
192 | 199 |
var accountBatch = batch.Where(path => path.IsAtOrBelow(account.AccountPath)); |
193 | 200 |
accountBatches[account.AccountKey] = accountBatch; |
194 | 201 |
} |
202 |
|
|
203 |
var moves=Interlocked.Exchange(ref _moves, new ConcurrentDictionary<string, MovedEventArgs>()); |
|
195 | 204 |
|
196 | 205 |
var tasks = new List<Task<DateTime?>>(); |
197 | 206 |
foreach(var accountInfo in _accounts.Values) |
198 | 207 |
{ |
199 | 208 |
IEnumerable<string> accountBatch ; |
200 | 209 |
accountBatches.TryGetValue(accountInfo.AccountKey,out accountBatch); |
201 |
var t=ProcessAccountFiles (accountInfo, accountBatch, since); |
|
210 |
var t=ProcessAccountFiles (accountInfo, accountBatch, moves,since);
|
|
202 | 211 |
tasks.Add(t); |
203 | 212 |
} |
204 | 213 |
|
... | ... | |
266 | 275 |
|
267 | 276 |
|
268 | 277 |
|
269 |
public async Task<DateTime?> ProcessAccountFiles(AccountInfo accountInfo, IEnumerable<string> accountBatch, DateTime? since = null) |
|
278 |
public async Task<DateTime?> ProcessAccountFiles(AccountInfo accountInfo, IEnumerable<string> accountBatch, ConcurrentDictionary<string, MovedEventArgs> moves, DateTime? since = null)
|
|
270 | 279 |
{ |
271 | 280 |
if (accountInfo == null) |
272 | 281 |
throw new ArgumentNullException("accountInfo"); |
... | ... | |
380 | 389 |
|
381 | 390 |
var token = _currentOperationCancellation.Token; |
382 | 391 |
|
383 |
var tuples = MergeSources(infos, files, states).ToList(); |
|
392 |
var tuples = MergeSources(infos, files, states,moves).ToList();
|
|
384 | 393 |
|
385 | 394 |
//Process only the changes in the batch file, if one exists |
386 | 395 |
var stateTuples = accountBatch==null?tuples:tuples.Where(t => accountBatch.Contains(t.FilePath)); |
... | ... | |
391 | 400 |
//Set the Merkle Hash |
392 | 401 |
//SetMerkleHash(accountInfo, tuple); |
393 | 402 |
|
394 |
await SyncSingleItem(accountInfo, tuple, agent, token).ConfigureAwait(false); |
|
403 |
await SyncSingleItem(accountInfo, tuple, agent, moves,token).ConfigureAwait(false);
|
|
395 | 404 |
|
396 | 405 |
} |
397 | 406 |
|
... | ... | |
466 | 475 |
Pause = false; |
467 | 476 |
} |
468 | 477 |
|
469 |
private async Task SyncSingleItem(AccountInfo accountInfo, StateTuple tuple, FileAgent agent, CancellationToken token) |
|
478 |
private async Task SyncSingleItem(AccountInfo accountInfo, StateTuple tuple, FileAgent agent, ConcurrentDictionary<string, MovedEventArgs> moves, CancellationToken token)
|
|
470 | 479 |
{ |
471 | 480 |
Log.DebugFormat("Sync [{0}] C:[{1}] L:[{2}] S:[{3}]", tuple.FilePath, tuple.C, tuple.L, tuple.S); |
472 | 481 |
|
... | ... | |
546 | 555 |
|
547 | 556 |
StatusKeeper.StoreInfo(targetPath, tuple.ObjectInfo); |
548 | 557 |
|
549 |
AddRootFolderToSelectives(accountInfo, tuple, targetPath);
|
|
558 |
AddOwnFolderToSelectives(accountInfo, tuple, targetPath);
|
|
550 | 559 |
} |
551 | 560 |
|
552 | 561 |
/* |
... | ... | |
595 | 604 |
|
596 | 605 |
if (isUnselectedRootFolder) |
597 | 606 |
{ |
598 |
ProcessChildren(accountInfo, tuple, agent, token); |
|
607 |
ProcessChildren(accountInfo, tuple, agent, moves,token);
|
|
599 | 608 |
} |
600 | 609 |
} |
601 | 610 |
} |
... | ... | |
614 | 623 |
var targetPath = MoveForServerMove(accountInfo, tuple); |
615 | 624 |
StatusKeeper.StoreInfo(targetPath, tuple.ObjectInfo); |
616 | 625 |
|
617 |
AddRootFolderToSelectives(accountInfo, tuple, targetPath);
|
|
626 |
AddOwnFolderToSelectives(accountInfo, tuple, targetPath);
|
|
618 | 627 |
} |
619 | 628 |
else |
620 | 629 |
{ |
... | ... | |
658 | 667 |
} |
659 | 668 |
} |
660 | 669 |
|
661 |
private void AddRootFolderToSelectives(AccountInfo accountInfo, StateTuple tuple, string targetPath)
|
|
670 |
private void AddOwnFolderToSelectives(AccountInfo accountInfo, StateTuple tuple, string targetPath)
|
|
662 | 671 |
{ |
672 |
//Not for shared folders |
|
673 |
if (tuple.ObjectInfo.IsShared==true) |
|
674 |
return; |
|
663 | 675 |
//Also ensure that any newly created folders are added to the selectives, if the original folder was selected |
664 | 676 |
var containerPath = Path.Combine(accountInfo.AccountPath, tuple.ObjectInfo.Container); |
665 | 677 |
|
666 | 678 |
//If this is a root folder encountered for the first time |
667 | 679 |
if (tuple.L == null && Directory.Exists(tuple.FileInfo.FullName) |
668 |
&& (tuple.FileInfo.FullName.IsAtOrDirectlyBelow(containerPath)))
|
|
680 |
&& (tuple.FileInfo.FullName.IsAtOrBelow(containerPath))) |
|
669 | 681 |
{ |
670 | 682 |
|
671 | 683 |
var relativePath = tuple.ObjectInfo.RelativeUrlToFilePath(accountInfo.UserName); |
672 | 684 |
var initialPath = Path.Combine(accountInfo.AccountPath, relativePath); |
673 | 685 |
|
674 |
var hasMoved = true;// !initialPath.Equals(targetPath); |
|
675 |
if (hasMoved && Selectives.IsSelected(accountInfo, initialPath)) |
|
686 |
//var hasMoved = true;// !initialPath.Equals(targetPath); |
|
687 |
//If the new path is under a selected folder, add it to the selectives as well |
|
688 |
if (Selectives.IsSelected(accountInfo, initialPath)) |
|
676 | 689 |
{ |
677 | 690 |
Selectives.AddUri(accountInfo, tuple.ObjectInfo.Uri); |
678 | 691 |
Selectives.Save(accountInfo); |
... | ... | |
724 | 737 |
} |
725 | 738 |
} |
726 | 739 |
|
727 |
private void ProcessChildren(AccountInfo accountInfo, StateTuple tuple, FileAgent agent, CancellationToken token) |
|
740 |
private void ProcessChildren(AccountInfo accountInfo, StateTuple tuple, FileAgent agent, ConcurrentDictionary<string, MovedEventArgs> moves,CancellationToken token)
|
|
728 | 741 |
{ |
729 | 742 |
|
730 | 743 |
var dirInfo = tuple.FileInfo as DirectoryInfo; |
... | ... | |
734 | 747 |
select new StateTuple(file); |
735 | 748 |
|
736 | 749 |
//Process folders first, to ensure folders appear on the sever as soon as possible |
737 |
folderTuples.ApplyAction(async t =>await SyncSingleItem(accountInfo, t, agent, token).ConfigureAwait(false)); |
|
750 |
folderTuples.ApplyAction(async t =>await SyncSingleItem(accountInfo, t, agent, moves, token).ConfigureAwait(false));
|
|
738 | 751 |
|
739 |
fileTuples.ApplyAction(async t => await SyncSingleItem(accountInfo, t, agent, token).ConfigureAwait(false)); |
|
752 |
fileTuples.ApplyAction(async t => await SyncSingleItem(accountInfo, t, agent, moves, token).ConfigureAwait(false));
|
|
740 | 753 |
} |
741 | 754 |
|
742 | 755 |
|
... | ... | |
793 | 806 |
return results; |
794 | 807 |
|
795 | 808 |
*/ |
796 |
private IEnumerable<StateTuple> MergeSources( |
|
797 |
IEnumerable<Tuple<string, ObjectInfo>> infos, |
|
798 |
IEnumerable<FileSystemInfo> files, |
|
799 |
IEnumerable<FileState> states) |
|
809 |
private IEnumerable<StateTuple> MergeSources(IEnumerable<Tuple<string, ObjectInfo>> infos, IEnumerable<FileSystemInfo> files, IEnumerable<FileState> states, ConcurrentDictionary<string, MovedEventArgs> moves) |
|
800 | 810 |
{ |
801 | 811 |
var tuplesByPath = files.ToDictionary(f => f.FullName, f => new StateTuple {FileInfo = f}); new Dictionary<string, StateTuple>(); |
802 | 812 |
|
b/trunk/Pithos.Core/Pithos.Core.csproj | ||
---|---|---|
380 | 380 |
<Reference Include="System.Xml" /> |
381 | 381 |
</ItemGroup> |
382 | 382 |
<ItemGroup> |
383 |
<Compile Include="..\Pithos.Client.WPF\Properties\AssemblyVersion.cs"> |
|
384 |
<Link>AssemblyVersion.cs</Link> |
|
385 |
</Compile> |
|
383 | 386 |
<Compile Include="Agents\Agent.cs" /> |
384 | 387 |
<Compile Include="Agents\AgentLocator.cs" /> |
385 | 388 |
<Compile Include="Agents\AsyncAutoResetEvent.cs" /> |
b/trunk/Pithos.Core/Properties/AssemblyInfo.cs | ||
---|---|---|
49 | 49 |
[assembly: AssemblyTitle("Pithos.Core")] |
50 | 50 |
[assembly: AssemblyDescription("")] |
51 | 51 |
[assembly: AssemblyConfiguration("")] |
52 |
[assembly: AssemblyCompany("GRNet")] |
|
53 | 52 |
[assembly: AssemblyProduct("Pithos.Core")] |
54 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011")] |
|
55 | 53 |
[assembly: AssemblyTrademark("")] |
56 | 54 |
[assembly: AssemblyCulture("")] |
57 | 55 |
|
... | ... | |
73 | 71 |
// You can specify all the values or you can default the Build and Revision Numbers |
74 | 72 |
// by using the '*' as shown below: |
75 | 73 |
// [assembly: AssemblyVersion("1.0.*")] |
76 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
77 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
b/trunk/Pithos.IntegrationTests/FileCreationTest.cs | ||
---|---|---|
66 | 66 |
|
67 | 67 |
var deleted= !_client.ObjectExists(_account, PithosContainer, "File1.txt"); |
68 | 68 |
Assert.That(deleted, Is.True); |
69 |
_client.DeleteObject(_account, PithosContainer, "File1.txt"); |
|
69 |
_client.DeleteObject(_account, PithosContainer, "File1.txt", false);
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
[Test] |
... | ... | |
93 | 93 |
var targetExists = _client.ObjectExists(_account, PithosContainer, "File2.txt"); |
94 | 94 |
Assert.That(targetExists, Is.True); |
95 | 95 |
|
96 |
_client.DeleteObject(_account,PithosContainer,"File2.txt"); |
|
96 |
_client.DeleteObject(_account,PithosContainer,"File2.txt", false);
|
|
97 | 97 |
|
98 | 98 |
var deleted= !_client.ObjectExists(_account, PithosContainer, "File2.txt"); |
99 | 99 |
Assert.That(deleted, Is.True); |
b/trunk/Pithos.Interfaces/Pithos.Interfaces.csproj | ||
---|---|---|
228 | 228 |
<Reference Include="System.Xml" /> |
229 | 229 |
</ItemGroup> |
230 | 230 |
<ItemGroup> |
231 |
<Compile Include="..\Pithos.Client.WPF\Properties\AssemblyVersion.cs"> |
|
232 |
<Link>AssemblyVersion.cs</Link> |
|
233 |
</Compile> |
|
231 | 234 |
<Compile Include="AccountSettings.cs" /> |
232 | 235 |
<Compile Include="FileInfoExtensions.cs" /> |
233 | 236 |
<Compile Include="FolderConstants.cs" /> |
b/trunk/Pithos.Interfaces/Properties/AssemblyInfo.cs | ||
---|---|---|
49 | 49 |
[assembly: AssemblyTitle("Pithos.Interfaces")] |
50 | 50 |
[assembly: AssemblyDescription("")] |
51 | 51 |
[assembly: AssemblyConfiguration("")] |
52 |
[assembly: AssemblyCompany("GRNet")] |
|
53 | 52 |
[assembly: AssemblyProduct("Pithos.Interfaces")] |
54 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011")] |
|
55 | 53 |
[assembly: AssemblyTrademark("")] |
56 | 54 |
[assembly: AssemblyCulture("")] |
57 | 55 |
|
... | ... | |
73 | 71 |
// You can specify all the values or you can default the Build and Revision Numbers |
74 | 72 |
// by using the '*' as shown below: |
75 | 73 |
// [assembly: AssemblyVersion("1.0.*")] |
76 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
77 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
b/trunk/Pithos.Network.Test/FolderTests.cs | ||
---|---|---|
93 | 93 |
var localInfo = new FileInfo("test.txt"); |
94 | 94 |
client.PutObject(null, "Pithos","RootFolder/Folder1/test.txt","test.txt"); |
95 | 95 |
|
96 |
client.DeleteObject(null, "pithos", "RootFolder/Folder1"); |
|
96 |
client.DeleteObject(null, "pithos", "RootFolder/Folder1", false);
|
|
97 | 97 |
|
98 | 98 |
Assert.IsTrue(client.ObjectExists(null, "Pithos", "RootFolder/Folder1")); |
99 | 99 |
var folderInfo = client.GetObjectInfo(null, "Pithos", "RootFolder/Folder1"); |
b/trunk/Pithos.Network.Test/NetworkOpsTest.cs | ||
---|---|---|
218 | 218 |
|
219 | 219 |
Assert.IsTrue(client.ObjectExists(null, "Shares",info.Name),"File Created"); |
220 | 220 |
|
221 |
client.DeleteObject(null, "Shares/devguide.pdf",info.Name); |
|
221 |
client.DeleteObject(null, "Shares/devguide.pdf",info.Name, false);
|
|
222 | 222 |
|
223 | 223 |
}); |
224 | 224 |
|
... | ... | |
246 | 246 |
|
247 | 247 |
Assert.IsTrue(client.ObjectExists(null, "Shares",info.Name),"File Created"); |
248 | 248 |
|
249 |
client.DeleteObject(null, "Shares",info.Name); |
|
249 |
client.DeleteObject(null, "Shares",info.Name, false);
|
|
250 | 250 |
Assert.IsFalse(client.ObjectExists(null, "Shares", info.Name),"Container Deleted"); |
251 | 251 |
|
252 |
client.DeleteObject(null, "Moo",info.Name); |
|
252 |
client.DeleteObject(null, "Moo",info.Name, false);
|
|
253 | 253 |
Assert.IsFalse(client.ObjectExists(null, "Moo", info.Name),"Container Deleted"); |
254 | 254 |
|
255 | 255 |
}); |
b/trunk/Pithos.Network/CloudFilesClient.cs | ||
---|---|---|
1456 | 1456 |
} |
1457 | 1457 |
} |
1458 | 1458 |
|
1459 |
public void DeleteObject(string account, string sourceContainer, string objectName) |
|
1459 |
public void DeleteObject(string account, string sourceContainer, string objectName, bool isDirectory)
|
|
1460 | 1460 |
{ |
1461 | 1461 |
if (String.IsNullOrWhiteSpace(sourceContainer)) |
1462 | 1462 |
throw new ArgumentNullException("sourceContainer", "The container property can't be empty"); |
... | ... | |
1465 | 1465 |
Contract.EndContractBlock(); |
1466 | 1466 |
|
1467 | 1467 |
var targetUrl = FolderConstants.TrashContainer + "/" + objectName; |
1468 |
/* |
|
1469 |
if (isDirectory) |
|
1470 |
targetUrl = targetUrl + "?delimiter=/"; |
|
1471 |
*/ |
|
1472 |
|
|
1468 | 1473 |
var sourceUrl = String.Format("/{0}/{1}", sourceContainer, objectName); |
1469 | 1474 |
|
1470 | 1475 |
using (var client = new RestClient(_baseClient)) |
... | ... | |
1520 | 1525 |
|
1521 | 1526 |
var expectedCodes = new[] { HttpStatusCode.OK, HttpStatusCode.NoContent, HttpStatusCode.Created}; |
1522 | 1527 |
var result=(expectedCodes.Contains(client.StatusCode)); |
1523 |
DeleteObject(account, cloudFile.Container, fileUrl); |
|
1528 |
DeleteObject(account, cloudFile.Container, fileUrl, cloudFile.IsDirectory);
|
|
1524 | 1529 |
return result; |
1525 | 1530 |
} |
1526 | 1531 |
catch |
b/trunk/Pithos.Network/ICloudClient.cs | ||
---|---|---|
80 | 80 |
#region Object operations |
81 | 81 |
Task GetObject(string account, string container, string objectName, string fileName,CancellationToken cancellationToken); |
82 | 82 |
Task PutObject(string account, string container, string objectName, string fileName, string hash = null, string contentType = "application/octet-stream"); |
83 |
void DeleteObject(string account, string container, string objectName); |
|
83 |
void DeleteObject(string account, string container, string objectName,bool isDirectory);
|
|
84 | 84 |
//void DeleteObject(string container, string objectName, string account = null); |
85 | 85 |
void MoveObject(string account, string sourceContainer, string oldObjectName, string targetContainer, string newObjectName); |
86 | 86 |
bool ObjectExists(string account, string container, string objectName); |
... | ... | |
272 | 272 |
return default(Task); |
273 | 273 |
} |
274 | 274 |
|
275 |
public void DeleteObject(string account, string container, string objectName) |
|
275 |
public void DeleteObject(string account, string container, string objectName,bool isDirectory)
|
|
276 | 276 |
{ |
277 | 277 |
|
278 | 278 |
Contract.Requires(!String.IsNullOrWhiteSpace(Token)); |
b/trunk/Pithos.Network/Pithos.Network.csproj | ||
---|---|---|
228 | 228 |
<Reference Include="System.Xml" /> |
229 | 229 |
</ItemGroup> |
230 | 230 |
<ItemGroup> |
231 |
<Compile Include="..\Pithos.Client.WPF\Properties\AssemblyVersion.cs"> |
|
232 |
<Link>AssemblyVersion.cs</Link> |
|
233 |
</Compile> |
|
231 | 234 |
<Compile Include="AccountInfo.cs" /> |
232 | 235 |
<Compile Include="BlockHashAlgorithms.cs" /> |
233 | 236 |
<Compile Include="CloudFilesClient.cs" /> |
b/trunk/Pithos.Network/Properties/AssemblyInfo.cs | ||
---|---|---|
49 | 49 |
[assembly: AssemblyTitle("Pithos.Network")] |
50 | 50 |
[assembly: AssemblyDescription("")] |
51 | 51 |
[assembly: AssemblyConfiguration("")] |
52 |
[assembly: AssemblyCompany("GRNet")] |
|
53 | 52 |
[assembly: AssemblyProduct("Pithos.Network")] |
54 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011")] |
|
55 | 53 |
[assembly: AssemblyTrademark("")] |
56 | 54 |
[assembly: AssemblyCulture("")] |
57 | 55 |
|
... | ... | |
73 | 71 |
// You can specify all the values or you can default the Build and Revision Numbers |
74 | 72 |
// by using the '*' as shown below: |
75 | 73 |
// [assembly: AssemblyVersion("1.0.*")] |
76 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
77 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
b/trunk/Pithos.ShellExtensions/Pithos.ShellExtensions.csproj | ||
---|---|---|
301 | 301 |
<Reference Include="System.Xml" /> |
302 | 302 |
</ItemGroup> |
303 | 303 |
<ItemGroup> |
304 |
<Compile Include="..\Pithos.Client.WPF\Properties\AssemblyVersion.cs"> |
|
305 |
<Link>AssemblyVersion.cs</Link> |
|
306 |
</Compile> |
|
304 | 307 |
<Compile Include="FileContext.cs" /> |
305 | 308 |
<Compile Include="IoC.cs" /> |
306 | 309 |
<Compile Include="LogCategories.cs" /> |
b/trunk/Pithos.ShellExtensions/Properties/AssemblyInfo.cs | ||
---|---|---|
49 | 49 |
[assembly: AssemblyTitle("Pithos.ShellExtensions")] |
50 | 50 |
[assembly: AssemblyDescription("")] |
51 | 51 |
[assembly: AssemblyConfiguration("")] |
52 |
[assembly: AssemblyCompany("GRNet")] |
|
53 | 52 |
[assembly: AssemblyProduct("Pithos.ShellExtensions")] |
54 |
[assembly: AssemblyCopyright("Copyright © GRNet 2011")] |
|
55 | 53 |
[assembly: AssemblyTrademark("")] |
56 | 54 |
[assembly: AssemblyCulture("")] |
57 | 55 |
|
... | ... | |
73 | 71 |
// You can specify all the values or you can default the Build and Revision Numbers |
74 | 72 |
// by using the '*' as shown below: |
75 | 73 |
// [assembly: AssemblyVersion("1.0.*")] |
76 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
77 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
Also available in: Unified diff