From: Panagiotis Kanavos Date: Mon, 9 Jan 2012 16:54:42 +0000 (+0200) Subject: Changes for directories X-Git-Url: https://code.grnet.gr/git/pithos-ms-client/commitdiff_plain/b9f5b594667fe56fc7caada8f9fc0f50096e385e Changes for directories Added copyright notices --- diff --git a/trunk/Pithos.Client.Test/Properties/AssemblyInfo.cs b/trunk/Pithos.Client.Test/Properties/AssemblyInfo.cs index 6054dd6..cb3c8c8 100644 --- a/trunk/Pithos.Client.Test/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Client.Test/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.Client.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Client.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/DebugLogger.cs b/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/DebugLogger.cs index d274791..f40f65c 100644 --- a/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/DebugLogger.cs +++ b/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/DebugLogger.cs @@ -1,4 +1,41 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System; using System.Diagnostics; namespace Caliburn.Micro.Logging diff --git a/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/log4netLogger.cs b/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/log4netLogger.cs index 5853ed1..047b93a 100644 --- a/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/log4netLogger.cs +++ b/trunk/Pithos.Client.WPF/Caliburn/Micro/Logging/log4netLogger.cs @@ -1,4 +1,41 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs b/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs index 26ed96b..838ed40 100644 --- a/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs +++ b/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs index 1ff5682..2efd787 100644 --- a/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs +++ b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Client.WPF/PithosAccount.cs b/trunk/Pithos.Client.WPF/PithosAccount.cs index 69e9be9..6ce8344 100644 --- a/trunk/Pithos.Client.WPF/PithosAccount.cs +++ b/trunk/Pithos.Client.WPF/PithosAccount.cs @@ -1,6 +1,38 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs index c7986cb..bcd7633 100644 --- a/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs +++ b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs @@ -1,6 +1,38 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Client.WPF/Services/StatusService.cs b/trunk/Pithos.Client.WPF/Services/StatusService.cs index 52f4632..057093d 100644 --- a/trunk/Pithos.Client.WPF/Services/StatusService.cs +++ b/trunk/Pithos.Client.WPF/Services/StatusService.cs @@ -1,11 +1,45 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- using System; +using System.Diagnostics; +using System.Linq; +using System.ServiceModel.Description; using Caliburn.Micro; using System.ServiceModel; using System.ComponentModel.Composition; @@ -48,6 +82,20 @@ namespace Pithos.Client.WPF.Services //Monitor. } + public void GotoSite(string filePath) + { + if (string.IsNullOrWhiteSpace(filePath)) + return; + var activeAccount = Settings.Accounts.FirstOrDefault(acc => filePath.StartsWith(acc.RootPath, StringComparison.InvariantCultureIgnoreCase)); + var address = String.Format("{0}/ui/?token={1}&user={2}", + activeAccount.ServerUrl, + activeAccount.ApiKey, + Uri.EscapeUriString(activeAccount.AccountName)); + + Process.Start(address); + + } + public PithosSettingsData GetSettings() { var data = new PithosSettingsData(Settings); @@ -74,6 +122,7 @@ namespace Pithos.Client.WPF.Services //// Add a mex endpoint /* + var smb = new ServiceMetadataBehavior { HttpGetEnabled = true, @@ -82,6 +131,7 @@ namespace Pithos.Client.WPF.Services service.Description.Behaviors.Add(smb); */ + service.Faulted+=OnError; service.Open(); return service; diff --git a/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs b/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs index 088b4ae..dbb764d 100644 --- a/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs +++ b/trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs b/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs index 2eb22a2..e241c19 100644 --- a/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs +++ b/trunk/Pithos.Client.WPF/Shell/FeedbackViewModel.cs @@ -1,9 +1,41 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- + using System.Collections.Specialized; using System.ComponentModel.Composition; using System.Diagnostics; diff --git a/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs index 7cdddf3..052a7fa 100644 --- a/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs +++ b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs @@ -730,11 +730,11 @@ namespace Pithos.Client.WPF { //TODO: Display file properties for non-container folders if (File.Exists(fileName)) //Retrieve the full name with exact casing. Pithos names are case sensitive - ShowFileProperties(GetProperFilePathCapitalization(fileName)); + ShowFileProperties(FileInfoExtensions.GetProperFilePathCapitalization(fileName)); else if (Directory.Exists(fileName)) //Retrieve the full name with exact casing. Pithos names are case sensitive { - var path = GetProperDirectoryCapitalization(fileName); + var path = FileInfoExtensions.GetProperDirectoryCapitalization(fileName); if (IsContainer(path)) ShowContainerProperties(path); else @@ -751,33 +751,5 @@ namespace Pithos.Client.WPF { return matchingFolders.Any(); } - static string GetProperDirectoryCapitalization(string fileName) - { - var dirInfo = new DirectoryInfo(fileName); - var parentDirInfo = dirInfo.Parent; - if (null == parentDirInfo) - return dirInfo.Name; - return Path.Combine(GetProperDirectoryCapitalization(parentDirInfo.FullName), - parentDirInfo.GetDirectories(dirInfo.Name)[0].Name); - } - - static string GetProperFilePathCapitalization(string fileName) - { - if (String.IsNullOrWhiteSpace(fileName)) - throw new ArgumentNullException("fileName"); - if (!Path.IsPathRooted(fileName)) - throw new ArgumentException("fileName must be an absolute path","fileName"); - Contract.EndContractBlock(); - - - var fileInfo = new FileInfo(fileName); - var dirInfo = fileInfo.Directory; - - //Directory will not be null for an absolute path - Contract.Assume(dirInfo!=null); - - return Path.Combine(GetProperDirectoryCapitalization(dirInfo.FullName), - dirInfo.GetFiles(fileInfo.Name)[0].Name); - } } } diff --git a/trunk/Pithos.Core.Test/ExtensionTests.cs b/trunk/Pithos.Core.Test/ExtensionTests.cs new file mode 100644 index 0000000..c34450a --- /dev/null +++ b/trunk/Pithos.Core.Test/ExtensionTests.cs @@ -0,0 +1,79 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System.Collections.Concurrent; +using NUnit.Framework; + +namespace Pithos.Core.Test +{ + using System.Linq; + using Agents; + + /// + /// TODO: Update summary. + /// + [TestFixture] + public class ExtensionTests + { + [Test] + public void TestRemoveConcurrent() + { + var test=new ConcurrentQueue(); + for (var i = 0; i < 100; i++) + { + test.Enqueue(i); + } + + test.RemoveFirst(t=>t==3); + Assert.IsFalse(test.Any(t => t == 3),"Item was not removed"); + for (var i=0;i<3;i++) + { + int item; + Assert.IsTrue(test.TryDequeue(out item),"Missing items"); + Assert.AreEqual(i, item,"Preceding items not queued correctly"); + } + for (var i = 4; i < 100; i++) + { + int item; + Assert.IsTrue(test.TryDequeue(out item), "Missing items"); + Assert.AreEqual(i, item, "Succeeding items not queued correctly"); + } + + + } + } +} diff --git a/trunk/Pithos.Core.Test/Pithos.Core.Test.csproj b/trunk/Pithos.Core.Test/Pithos.Core.Test.csproj index 190f7cd..824f409 100644 --- a/trunk/Pithos.Core.Test/Pithos.Core.Test.csproj +++ b/trunk/Pithos.Core.Test/Pithos.Core.Test.csproj @@ -47,6 +47,7 @@ Full %28none%29 0 + x86 pdbonly @@ -202,6 +203,7 @@ + diff --git a/trunk/Pithos.Core.Test/Properties/AssemblyInfo.cs b/trunk/Pithos.Core.Test/Properties/AssemblyInfo.cs index d08db46..8984e2e 100644 --- a/trunk/Pithos.Core.Test/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Core.Test/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.Core.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Core.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Core/Agents/Agent.cs b/trunk/Pithos.Core/Agents/Agent.cs index 486d459..57b08a7 100644 --- a/trunk/Pithos.Core/Agents/Agent.cs +++ b/trunk/Pithos.Core/Agents/Agent.cs @@ -6,12 +6,14 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using Pithos.Core.Agents; namespace Pithos.Core { public class Agent : IDisposable - { - private readonly BlockingCollection _messages = new BlockingCollection(); + { + private readonly ConcurrentQueue _queue; + private readonly BlockingCollection _messages; private readonly CancellationTokenSource _cancelSource = new CancellationTokenSource(); public CancellationToken CancellationToken; @@ -20,6 +22,8 @@ namespace Pithos.Core public Agent(Action> action) { + _queue=new ConcurrentQueue(); + _messages = new BlockingCollection(_queue); _process = action; CancellationToken = _cancelSource.Token; } @@ -132,6 +136,19 @@ namespace Pithos.Core return _messages; } + /// + /// Remove the first message that matches the predicate + /// + /// The condition to match + /// Removes the first message that matches the predicate by dequeing all + /// messages and re-enqueing all except the first matching message + public void Remove(Func predicate) + { + //Can this work? Dequeue all items + //and then enqueue everything except the filtered items + + _queue.RemoveFirst(predicate); + } public Task LoopAsync(Task process, Action loop,Action onError=null) { diff --git a/trunk/Pithos.Core/Agents/CloudTransferAction.cs b/trunk/Pithos.Core/Agents/CloudTransferAction.cs index 0229104..7bd5005 100644 --- a/trunk/Pithos.Core/Agents/CloudTransferAction.cs +++ b/trunk/Pithos.Core/Agents/CloudTransferAction.cs @@ -55,7 +55,7 @@ namespace Pithos.Core.Agents public CloudAction(AccountInfo accountInfo, CloudActionType action, FileSystemInfo localFile, ObjectInfo cloudFile, FileState state, int blockSize, string algorithm) : this(accountInfo,action) { - LocalFile = localFile; + LocalFile = localFile.WithProperCapitalization(); CloudFile = cloudFile; FileState = state; if (LocalFile != null) diff --git a/trunk/Pithos.Core/Agents/CollectionExtensions.cs b/trunk/Pithos.Core/Agents/CollectionExtensions.cs new file mode 100644 index 0000000..2c90a65 --- /dev/null +++ b/trunk/Pithos.Core/Agents/CollectionExtensions.cs @@ -0,0 +1,81 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System.Collections.Concurrent; + +namespace Pithos.Core.Agents +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + /// + /// Extension methods for collections + /// + public static class CollectionExtensions + { + /// + /// Remove the first message in a queue that matches the predicate + /// + /// The condition to match + /// Removes the first message that matches the predicate by dequeing all + /// messages and re-enqueing all except the first matching message + public static void RemoveFirst(this ConcurrentQueue queue, Func predicate) + { + //Can this work? Dequeue all items + //and then enqueue everything except the filtered items + + //Possible problems: + //* A matching item may be dequeued between one TryDequeue and the next + var temp = new Queue(); + TMessage message; + var alreadyFound = false; + while (queue.TryDequeue(out message)) + { + if (!predicate(message) || alreadyFound) + temp.Enqueue(message); + else + { + alreadyFound = true; + } + } + + queue.AddFromEnumerable(temp); + } + } +} diff --git a/trunk/Pithos.Core/Agents/FileAgent.cs b/trunk/Pithos.Core/Agents/FileAgent.cs index eb53d06..c6a6fbd 100644 --- a/trunk/Pithos.Core/Agents/FileAgent.cs +++ b/trunk/Pithos.Core/Agents/FileAgent.cs @@ -348,7 +348,7 @@ namespace Pithos.Core.Agents return false; } - public FileSystemInfo GetFileInfo(string relativePath) + public FileSystemInfo GetFileSystemInfo(string relativePath) { if (String.IsNullOrWhiteSpace(relativePath)) throw new ArgumentNullException("relativePath"); @@ -360,9 +360,9 @@ namespace Pithos.Core.Agents var absolutePath = Path.Combine(RootPath, relativePath); if (Directory.Exists(absolutePath)) - return new DirectoryInfo(absolutePath); + return new DirectoryInfo(absolutePath).WithProperCapitalization(); else - return new FileInfo(absolutePath); + return new FileInfo(absolutePath).WithProperCapitalization(); } diff --git a/trunk/Pithos.Core/Agents/FileInfoExtensions.cs b/trunk/Pithos.Core/Agents/FileInfoExtensions.cs index 4f8d309..23e9c13 100644 --- a/trunk/Pithos.Core/Agents/FileInfoExtensions.cs +++ b/trunk/Pithos.Core/Agents/FileInfoExtensions.cs @@ -1,4 +1,42 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + + +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -47,8 +85,5 @@ namespace Pithos.Core.Agents return Signature.CalculateTreeHash(info.FullName, blockSize, algorithm).TopHash.ToHashString(); } - - - } } diff --git a/trunk/Pithos.Core/Agents/NetworkAgent.cs b/trunk/Pithos.Core/Agents/NetworkAgent.cs index 1ea5ffe..940c9f4 100644 --- a/trunk/Pithos.Core/Agents/NetworkAgent.cs +++ b/trunk/Pithos.Core/Agents/NetworkAgent.cs @@ -1,4 +1,41 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -14,11 +51,15 @@ using log4net; namespace Pithos.Core.Agents { + //TODO: Ensure all network operations use exact casing. Pithos is case sensitive [Export] public class NetworkAgent { private Agent _agent; + //A separate agent is used to execute delete actions immediatelly; + private Agent _deleteAgent; + [Import] public IStatusKeeper StatusKeeper { get; set; } @@ -42,7 +83,20 @@ namespace Pithos.Core.Agents inbox.LoopAsync(process, loop); }; loop(); - }); + }); + + _deleteAgent = Agent.Start(inbox => + { + Action loop = null; + loop = () => + { + var message = inbox.Receive(); + var process = message.Then(ProcessDelete,inbox.CancellationToken); + inbox.LoopAsync(process, loop); + }; + loop(); + + }); } private async Task Process(CloudAction action) @@ -75,7 +129,8 @@ namespace Pithos.Core.Agents await DownloadCloudFile(accountInfo, cloudFile, downloadPath); break; case CloudActionType.DeleteCloud: - DeleteCloudFile(accountInfo, cloudFile); + //Redirect deletes to the delete agent + _deleteAgent.Post((CloudDeleteAction)action); break; case CloudActionType.RenameCloud: var moveAction = (CloudMoveAction)action; @@ -127,6 +182,82 @@ namespace Pithos.Core.Agents } } + /// + /// Processes cloud delete actions + /// + /// The delete action to execute + /// + /// + /// When a file/folder is deleted locally, we must delete it ASAP from the server and block any download + /// operations that may be in progress. + /// + /// A separate agent is used to process deletes because the main agent may be busy with a long operation. + /// + /// + private async Task ProcessDelete(CloudDeleteAction action) + { + if (action == null) + throw new ArgumentNullException("action"); + if (action.AccountInfo==null) + throw new ArgumentException("The action.AccountInfo is empty","action"); + Contract.EndContractBlock(); + + var accountInfo = action.AccountInfo; + + using (log4net.ThreadContext.Stacks["NETWORK"].Push("PROCESS")) + { + Log.InfoFormat("[ACTION] Start Processing {0}", action); + + var cloudFile = action.CloudFile; + + try + { + //Acquire a lock on the deleted file to prevent uploading/downloading operations from the normal + //agent + using (var gate = NetworkGate.Acquire(action.LocalFile.FullName, NetworkOperation.Deleting)) + { + // Remove any related actions from the normal agent + _agent.Remove(queuedAction => + queuedAction.CloudFile.Container == action.CloudFile.Container && + queuedAction.CloudFile.Name == action.CloudFile.Name); + // and then delete the file from the server + DeleteCloudFile(accountInfo, cloudFile); + Log.InfoFormat("[ACTION] End Delete {0}:{1}->{2}", action.Action, action.LocalFile, + action.CloudFile.Name); + } + } + catch (WebException exc) + { + Log.ErrorFormat("[WEB ERROR] {0} : {1} -> {2} due to exception\r\n{3}", action.Action, action.LocalFile, action.CloudFile, exc); + } + catch (OperationCanceledException) + { + throw; + } + catch (DirectoryNotFoundException) + { + Log.ErrorFormat("{0} : {1} -> {2} failed because the directory was not found.\n Rescheduling a delete", + action.Action, action.LocalFile, action.CloudFile); + //Repost a delete action for the missing file + _deleteAgent.Post(action); + } + catch (FileNotFoundException) + { + Log.ErrorFormat("{0} : {1} -> {2} failed because the file was not found.\n Rescheduling a delete", + action.Action, action.LocalFile, action.CloudFile); + //Post a delete action for the missing file + _deleteAgent.Post(action); + } + catch (Exception exc) + { + Log.ErrorFormat("[REQUEUE] {0} : {1} -> {2} due to exception\r\n{3}", + action.Action, action.LocalFile, action.CloudFile, exc); + + _deleteAgent.Post(action); + } + } + } + private async Task SyncFiles(AccountInfo accountInfo,CloudAction action) { if (accountInfo == null) @@ -143,7 +274,7 @@ namespace Pithos.Core.Agents var localFile = action.LocalFile; var cloudFile = action.CloudFile; - var downloadPath=action.LocalFile.FullName.ToLower(); + var downloadPath=action.LocalFile.GetProperCapitalization(); var cloudHash = cloudFile.Hash.ToLower(); var localHash = action.LocalHash.Value.ToLower(); @@ -219,7 +350,7 @@ namespace Pithos.Core.Agents if (cloudAction.AccountInfo==null) throw new ArgumentException("The CloudAction.AccountInfo is empty","cloudAction"); Contract.EndContractBlock(); - + //If the action targets a local file, add a treehash calculation if (cloudAction.LocalFile as FileInfo != null) { @@ -241,7 +372,11 @@ namespace Pithos.Core.Agents //The hash for a directory is the empty string cloudAction.TopHash = new Lazy(() => String.Empty); } - _agent.Post(cloudAction); + + if (cloudAction is CloudDeleteAction) + _deleteAgent.Post((CloudDeleteAction)cloudAction); + else + _agent.Post(cloudAction); } /* class ObjectInfoByNameComparer:IEqualityComparer @@ -410,7 +545,7 @@ namespace Pithos.Core.Agents if (fileAgent.Exists(relativePath)) { //If a directory object already exists, we don't need to perform any other action - var localFile = fileAgent.GetFileInfo(relativePath); + var localFile = fileAgent.GetFileSystemInfo(relativePath); if (objectInfo.Content_Type == @"application/directory" && localFile is DirectoryInfo) continue; var state = FileState.FindByFilePath(localFile.FullName); @@ -470,7 +605,21 @@ namespace Pithos.Core.Agents throw new ArgumentException("OldCloudFile","action"); Contract.EndContractBlock(); - var newFilePath = action.LocalFile.FullName; + + var newFilePath = action.LocalFile.FullName; + + //How do we handle concurrent renames and deletes/uploads/downloads? + //* A conflicting upload means that a file was renamed before it had a chance to finish uploading + // This should never happen as the network agent executes only one action at a time + //* A conflicting download means that the file was modified on the cloud. While we can go on and complete + // the rename, there may be a problem if the file is downloaded in blocks, as subsequent block requests for the + // same name will fail. + // This should never happen as the network agent executes only one action at a time. + //* A conflicting delete can happen if the rename was followed by a delete action that didn't have the chance + // to remove the rename from the queue. + // We can probably ignore this case. It will result in an error which should be ignored + + //The local file is already renamed StatusKeeper.SetFileOverlayStatus(newFilePath, FileOverlayStatus.Modified); @@ -479,6 +628,7 @@ namespace Pithos.Core.Agents var container = action.CloudFile.Container; var client = new CloudFilesClient(accountInfo); + //TODO: What code is returned when the source file doesn't exist? client.MoveObject(account, container, action.OldCloudFile.Name, container, action.CloudFile.Name); StatusKeeper.SetFileStatus(newFilePath, FileStatus.Unchanged); @@ -502,7 +652,7 @@ namespace Pithos.Core.Agents using ( log4net.ThreadContext.Stacks["DeleteCloudFile"].Push("Delete")) { var fileName= cloudFile.RelativeUrlToFilePath(accountInfo.UserName); - var info = fileAgent.GetFileInfo(fileName); + var info = fileAgent.GetFileSystemInfo(fileName); var fullPath = info.FullName.ToLower(); StatusKeeper.SetFileOverlayStatus(fullPath, FileOverlayStatus.Modified); @@ -518,7 +668,7 @@ namespace Pithos.Core.Agents } //Download a file. - private async Task DownloadCloudFile(AccountInfo accountInfo, ObjectInfo cloudFile , string localPath) + private async Task DownloadCloudFile(AccountInfo accountInfo, ObjectInfo cloudFile , string filePath) { if (accountInfo == null) throw new ArgumentNullException("accountInfo"); @@ -528,12 +678,13 @@ namespace Pithos.Core.Agents throw new ArgumentNullException("cloudFile"); if (String.IsNullOrWhiteSpace(cloudFile.Container)) throw new ArgumentNullException("cloudFile"); - if (String.IsNullOrWhiteSpace(localPath)) - throw new ArgumentNullException("localPath"); - if (!Path.IsPathRooted(localPath)) - throw new ArgumentException("The localPath must be rooted", "localPath"); + if (String.IsNullOrWhiteSpace(filePath)) + throw new ArgumentNullException("filePath"); + if (!Path.IsPathRooted(filePath)) + throw new ArgumentException("The filePath must be rooted", "filePath"); Contract.EndContractBlock(); - + + var localPath = Interfaces.FileInfoExtensions.GetProperFilePathCapitalization(filePath); var relativeUrl = new Uri(cloudFile.Name, UriKind.Relative); var url = relativeUrl.ToString(); @@ -584,7 +735,7 @@ namespace Pithos.Core.Agents } //Download a small file with a single GET operation - private async Task DownloadEntireFileAsync(AccountInfo accountInfo, CloudFilesClient client, ObjectInfo cloudFile, Uri relativeUrl, string localPath,TreeHash serverHash) + private async Task DownloadEntireFileAsync(AccountInfo accountInfo, CloudFilesClient client, ObjectInfo cloudFile, Uri relativeUrl, string filePath,TreeHash serverHash) { if (client == null) throw new ArgumentNullException("client"); @@ -592,12 +743,13 @@ namespace Pithos.Core.Agents throw new ArgumentNullException("cloudFile"); if (relativeUrl == null) throw new ArgumentNullException("relativeUrl"); - if (String.IsNullOrWhiteSpace(localPath)) - throw new ArgumentNullException("localPath"); - if (!Path.IsPathRooted(localPath)) - throw new ArgumentException("The localPath must be rooted", "localPath"); + if (String.IsNullOrWhiteSpace(filePath)) + throw new ArgumentNullException("filePath"); + if (!Path.IsPathRooted(filePath)) + throw new ArgumentException("The localPath must be rooted", "filePath"); Contract.EndContractBlock(); + var localPath = Pithos.Interfaces.FileInfoExtensions.GetProperFilePathCapitalization(filePath); //If the file already exists if (File.Exists(localPath)) { @@ -624,26 +776,25 @@ namespace Pithos.Core.Agents Directory.CreateDirectory(tempFolder); //Download the object to the temporary location - await client.GetObject(cloudFile.Account, cloudFile.Container, relativeUrl.ToString(), tempPath).ContinueWith(t => - { - t.PropagateExceptions(); - //Create the local folder if it doesn't exist (necessary for shared objects) - var localFolder = Path.GetDirectoryName(localPath); - if (!Directory.Exists(localFolder)) - Directory.CreateDirectory(localFolder); - //And move it to its actual location once downloading is finished - if (File.Exists(localPath)) - File.Replace(tempPath,localPath,null,true); - else - File.Move(tempPath,localPath); - //Notify listeners that a local file has changed - StatusNotification.NotifyChangedFile(localPath); + await client.GetObject(cloudFile.Account, cloudFile.Container, relativeUrl.ToString(), tempPath); - }); + //Create the local folder if it doesn't exist (necessary for shared objects) + var localFolder = Path.GetDirectoryName(localPath); + if (!Directory.Exists(localFolder)) + Directory.CreateDirectory(localFolder); + //And move it to its actual location once downloading is finished + if (File.Exists(localPath)) + File.Replace(tempPath,localPath,null,true); + else + File.Move(tempPath,localPath); + //Notify listeners that a local file has changed + StatusNotification.NotifyChangedFile(localPath); + + } //Download a file asynchronously using blocks - public async Task DownloadWithBlocks(AccountInfo accountInfo, CloudFilesClient client, ObjectInfo cloudFile, Uri relativeUrl, string localPath, TreeHash serverHash) + public async Task DownloadWithBlocks(AccountInfo accountInfo, CloudFilesClient client, ObjectInfo cloudFile, Uri relativeUrl, string filePath, TreeHash serverHash) { if (client == null) throw new ArgumentNullException("client"); @@ -651,15 +802,16 @@ namespace Pithos.Core.Agents throw new ArgumentNullException("cloudFile"); if (relativeUrl == null) throw new ArgumentNullException("relativeUrl"); - if (String.IsNullOrWhiteSpace(localPath)) - throw new ArgumentNullException("localPath"); - if (!Path.IsPathRooted(localPath)) - throw new ArgumentException("The localPath must be rooted", "localPath"); + if (String.IsNullOrWhiteSpace(filePath)) + throw new ArgumentNullException("filePath"); + if (!Path.IsPathRooted(filePath)) + throw new ArgumentException("The filePath must be rooted", "filePath"); if (serverHash == null) throw new ArgumentNullException("serverHash"); Contract.EndContractBlock(); var fileAgent = GetFileAgent(accountInfo); + var localPath = Interfaces.FileInfoExtensions.GetProperFilePathCapitalization(filePath); //Calculate the relative file path for the new file var relativePath = relativeUrl.RelativeUriToFilePath(); @@ -751,7 +903,7 @@ namespace Pithos.Core.Agents } - var fullFileName = fileInfo.FullName; + var fullFileName = fileInfo.GetProperCapitalization(); using (var gate = NetworkGate.Acquire(fullFileName, NetworkOperation.Uploading)) { //Abort if the file is already being uploaded or downloaded @@ -768,15 +920,14 @@ namespace Pithos.Core.Agents //If this is a read-only file, do not upload changes if (info.AllowedTo == "read") return; - - //WRONG: If this is a directory, there is no hash to check. ???? - //TODO: Check how a directory hash is calculated + + //TODO: Check how a directory hash is calculated -> All dirs seem to have the same hash if (fileInfo is DirectoryInfo) { //If the directory doesn't exist the Hash property will be empty if (String.IsNullOrWhiteSpace(info.Hash)) //Go on and create the directory - client.PutObject(account, cloudFile.Container, cloudFile.Name, fileInfo.FullName, String.Empty, "application/directory"); + client.PutObject(account, cloudFile.Container, cloudFile.Name, fullFileName, String.Empty, "application/directory"); } else { @@ -804,7 +955,7 @@ namespace Pithos.Core.Agents //the relevant block //First, calculate the tree hash - var treeHash = await Signature.CalculateTreeHashAsync(fileInfo.FullName, accountInfo.BlockSize, + var treeHash = await Signature.CalculateTreeHashAsync(fullFileName, accountInfo.BlockSize, accountInfo.BlockHash); await UploadWithHashMap(accountInfo, cloudFile, fileInfo as FileInfo, cloudFile.Name, treeHash); @@ -871,7 +1022,7 @@ namespace Pithos.Core.Agents throw new ArgumentException("Invalid container","cloudFile"); Contract.EndContractBlock(); - var fullFileName = fileInfo.FullName; + var fullFileName = fileInfo.GetProperCapitalization(); var account = cloudFile.Account ?? accountInfo.UserName; var container = cloudFile.Container ; diff --git a/trunk/Pithos.Core/Agents/WorkflowAgent.cs b/trunk/Pithos.Core/Agents/WorkflowAgent.cs index 2ffcb32..81a52f5 100644 --- a/trunk/Pithos.Core/Agents/WorkflowAgent.cs +++ b/trunk/Pithos.Core/Agents/WorkflowAgent.cs @@ -1,4 +1,41 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; diff --git a/trunk/Pithos.Core/FileState.cs b/trunk/Pithos.Core/FileState.cs index 59d5e70..df43910 100644 --- a/trunk/Pithos.Core/FileState.cs +++ b/trunk/Pithos.Core/FileState.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- @@ -125,7 +156,7 @@ namespace Pithos.Core .ExecuteUpdate(); if (updatedEntities == 0) { - var newState = new FileState { FilePath = absolutePath, Id = Guid.NewGuid(), FileStatus = newStatus }; + var newState = new FileState { FilePath = absolutePath.ToLower(), Id = Guid.NewGuid(), FileStatus = newStatus }; newState.CreateAndFlush(); } return null; @@ -288,7 +319,7 @@ namespace Pithos.Core var fileState = new FileState { - FilePath = filePath, + FilePath = filePath.ToLower(), OverlayStatus = FileOverlayStatus.Unversioned, FileStatus = FileStatus.Created, Id=Guid.NewGuid() @@ -298,7 +329,7 @@ namespace Pithos.Core return fileState.UpdateHashesAsync(blockSize,algorithm); } - public Task UpdateHashesAsync(int blockSize,string algorithm) + public async Task UpdateHashesAsync(int blockSize,string algorithm) { if (blockSize<=0) throw new ArgumentOutOfRangeException("blockSize"); @@ -308,21 +339,17 @@ namespace Pithos.Core //Skip updating the hash for folders if (Directory.Exists(FilePath)) - return Task.Factory.FromResult(this); + return this; - var results = Task.Factory.StartNew(() => + var hash = await TaskEx.Run(() => { var info = new FileInfo(FilePath); return info.CalculateHash(blockSize, algorithm); }); - var state=results.Then(hash => - { - Checksum = hash; - return Task.Factory.FromResult(this); - }); + Checksum = hash; - return state; + return this; } } diff --git a/trunk/Pithos.Core/IStatusService.cs b/trunk/Pithos.Core/IStatusService.cs index 6c75695..82957f6 100644 --- a/trunk/Pithos.Core/IStatusService.cs +++ b/trunk/Pithos.Core/IStatusService.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- @@ -35,5 +66,8 @@ namespace Pithos.Core { [OperationContract(IsOneWay=true)] void ShowProperties(string fileName); + [OperationContract(IsOneWay=true)] + void GotoSite(string fileName); + } } diff --git a/trunk/Pithos.Core/JobQueue.cs b/trunk/Pithos.Core/JobQueue.cs index cca4a07..233c157 100644 --- a/trunk/Pithos.Core/JobQueue.cs +++ b/trunk/Pithos.Core/JobQueue.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Core/NetworkGate.cs b/trunk/Pithos.Core/NetworkGate.cs index 5fd4c18..2815be6 100644 --- a/trunk/Pithos.Core/NetworkGate.cs +++ b/trunk/Pithos.Core/NetworkGate.cs @@ -1,3 +1,40 @@ +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -10,7 +47,9 @@ namespace Pithos.Core { None, Uploading, - Downloading + Downloading, + Deleting, + Renaming } //The NetworkGate prevents starting download/uploads for files that are already in the process of downloading, @@ -39,7 +78,8 @@ namespace Pithos.Core Contract.EndContractBlock(); NetworkOperation operation; - if (NetworkState.TryGetValue(path.ToLower(), out operation)) + var lower = path.ToLower(); + if (NetworkState.TryGetValue(lower, out operation)) return operation; return NetworkOperation.None; } @@ -74,12 +114,13 @@ namespace Pithos.Core throw new ArgumentException("path must be a rooted path", "path"); Contract.EndContractBlock(); - var state = GetNetworkState(path); + var lower = path.ToLower(); + var state = GetNetworkState(lower); //If no operation is in progress, return a NetworkGate return (state == NetworkOperation.None) - ? new NetworkGate(path, operation) + ? new NetworkGate(lower, operation) //otherwise return a gate with Fail flagged - : new NetworkGate(path, NetworkOperation.None); + : new NetworkGate(lower, NetworkOperation.None); } diff --git a/trunk/Pithos.Core/Pithos.Core.csproj b/trunk/Pithos.Core/Pithos.Core.csproj index 7520ed1..114c56d 100644 --- a/trunk/Pithos.Core/Pithos.Core.csproj +++ b/trunk/Pithos.Core/Pithos.Core.csproj @@ -365,6 +365,7 @@ + diff --git a/trunk/Pithos.Core/Properties/AssemblyInfo.cs b/trunk/Pithos.Core/Properties/AssemblyInfo.cs index 2467066..50e096b 100644 --- a/trunk/Pithos.Core/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Core/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.Core")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Core")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Interfaces/AccountSettings.cs b/trunk/Pithos.Interfaces/AccountSettings.cs index c6e9096..bac36f0 100644 --- a/trunk/Pithos.Interfaces/AccountSettings.cs +++ b/trunk/Pithos.Interfaces/AccountSettings.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Interfaces/FileInfoExtensions.cs b/trunk/Pithos.Interfaces/FileInfoExtensions.cs index 56e0ca2..65f5703 100644 --- a/trunk/Pithos.Interfaces/FileInfoExtensions.cs +++ b/trunk/Pithos.Interfaces/FileInfoExtensions.cs @@ -23,7 +23,7 @@ namespace Pithos.Interfaces path=path.ToLower() + "\\"; int pathLength = path.Length; - var filePath = fileInfo.FullName; + var filePath = fileInfo.GetProperCapitalization(); if (!filePath.StartsWith(path,StringComparison.InvariantCultureIgnoreCase)) throw new ArgumentException(String.Format("The path {0} doesn't contain the file {1}",path,filePath)); @@ -53,6 +53,102 @@ namespace Pithos.Interfaces } + public static string GetProperDirectoryCapitalization(string fileName) + { + if (String.IsNullOrWhiteSpace(fileName)) + throw new ArgumentNullException("fileName"); + if (!Path.IsPathRooted(fileName)) + throw new ArgumentException("fileName must be an absolute path", "fileName"); + Contract.EndContractBlock(); + + var dirInfo = new DirectoryInfo(fileName); + return dirInfo.GetProperCapitalization(); + } + + public static string GetProperCapitalization(this DirectoryInfo dirInfo) + { + if (dirInfo == null) + throw new ArgumentNullException("dirInfo"); + Contract.EndContractBlock(); + + var parentDirInfo = dirInfo.Parent; + if (null == parentDirInfo) + return dirInfo.Name; + return Path.Combine(GetProperDirectoryCapitalization(parentDirInfo.FullName), + parentDirInfo.GetDirectories(dirInfo.Name)[0].Name); + } + + + public static string GetProperFilePathCapitalization(string fileName) + { + if (String.IsNullOrWhiteSpace(fileName)) + throw new ArgumentNullException("fileName"); + if (!Path.IsPathRooted(fileName)) + throw new ArgumentException("fileName must be an absolute path", "fileName"); + Contract.EndContractBlock(); + + + var fileInfo = new FileInfo(fileName); + return fileInfo.GetProperCapitalization(); + } + + public static string GetProperCapitalization(this FileInfo fileInfo) + { + if (fileInfo == null) + throw new ArgumentNullException("fileInfo"); + Contract.EndContractBlock(); + + + var dirInfo = fileInfo.Directory; + //Directory will not be null for an absolute path + Contract.Assume(dirInfo != null); + + return Path.Combine(GetProperDirectoryCapitalization(dirInfo.FullName), + dirInfo.GetFiles(fileInfo.Name)[0].Name); + } + + public static string GetProperCapitalization(this FileSystemInfo info) + { + if (info is FileInfo) + return (info as FileInfo).GetProperCapitalization(); + if (info is DirectoryInfo) + return (info as DirectoryInfo).GetProperCapitalization(); + throw new NotSupportedException("Unexpected parameter type"); + } + + public static DirectoryInfo WithProperCapitalization(this DirectoryInfo dirInfo) + { + if (dirInfo==null) + throw new ArgumentNullException("dirInfo"); + Contract.EndContractBlock(); + + var path = dirInfo.GetProperCapitalization(); + return new DirectoryInfo(path); + } + + public static FileInfo WithProperCapitalization(this FileInfo fileInfo) + { + if (fileInfo==null) + throw new ArgumentNullException("fileInfo"); + Contract.EndContractBlock(); + + var path = fileInfo.GetProperCapitalization(); + return new FileInfo(path); + } + + public static FileSystemInfo WithProperCapitalization(this FileSystemInfo info) + { + if (info==null) + throw new ArgumentNullException("info"); + Contract.EndContractBlock(); + + if (info is FileInfo) + return (info as FileInfo).WithProperCapitalization(); + if (info is DirectoryInfo) + return (info as DirectoryInfo).WithProperCapitalization(); + + throw new NotSupportedException("Unexpected parameter type"); + } } } diff --git a/trunk/Pithos.Interfaces/PithosSettingsData.cs b/trunk/Pithos.Interfaces/PithosSettingsData.cs index fa56260..da44083 100644 --- a/trunk/Pithos.Interfaces/PithosSettingsData.cs +++ b/trunk/Pithos.Interfaces/PithosSettingsData.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.Interfaces/Properties/AssemblyInfo.cs b/trunk/Pithos.Interfaces/Properties/AssemblyInfo.cs index 90bdcf7..05ba029 100644 --- a/trunk/Pithos.Interfaces/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Interfaces/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.Interfaces")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Interfaces")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Network.Test/Properties/AssemblyInfo.cs b/trunk/Pithos.Network.Test/Properties/AssemblyInfo.cs index 1ac5f19..a0636cb 100644 --- a/trunk/Pithos.Network.Test/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Network.Test/Properties/AssemblyInfo.cs @@ -10,9 +10,9 @@ using Pithos.Network; [assembly: AssemblyTitle("Pithos.Network.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Network.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Network/CloudFilesClient.cs b/trunk/Pithos.Network/CloudFilesClient.cs index dbfda81..0cb2355 100644 --- a/trunk/Pithos.Network/CloudFilesClient.cs +++ b/trunk/Pithos.Network/CloudFilesClient.cs @@ -1,4 +1,42 @@ -// **CloudFilesClient** provides a simple client interface to CloudFiles and Pithos +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + + +// **CloudFilesClient** provides a simple client interface to CloudFiles and Pithos // // The class provides methods to upload/download files, delete files, manage containers diff --git a/trunk/Pithos.Network/Properties/AssemblyInfo.cs b/trunk/Pithos.Network/Properties/AssemblyInfo.cs index 49eb5f4..790cd91 100644 --- a/trunk/Pithos.Network/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.Network/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.Network")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.Network")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.Network/RestClient.cs b/trunk/Pithos.Network/RestClient.cs index 5b9403f..42aee54 100644 --- a/trunk/Pithos.Network/RestClient.cs +++ b/trunk/Pithos.Network/RestClient.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.ShellExtensions.Test/Properties/AssemblyInfo.cs b/trunk/Pithos.ShellExtensions.Test/Properties/AssemblyInfo.cs index 108732d..78fd4b1 100644 --- a/trunk/Pithos.ShellExtensions.Test/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.ShellExtensions.Test/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.ShellExtensions.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.ShellExtensions.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.ShellExtensions/FileContext.cs b/trunk/Pithos.ShellExtensions/FileContext.cs index 9330936..fcd7536 100644 --- a/trunk/Pithos.ShellExtensions/FileContext.cs +++ b/trunk/Pithos.ShellExtensions/FileContext.cs @@ -1,6 +1,40 @@ -// -// This project is open source. Released under the XYZ license +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // +// ----------------------------------------------------------------------- + using System.Linq; using Microsoft.Win32; diff --git a/trunk/Pithos.ShellExtensions/IoC.cs b/trunk/Pithos.ShellExtensions/IoC.cs index 4eab378..bb87493 100644 --- a/trunk/Pithos.ShellExtensions/IoC.cs +++ b/trunk/Pithos.ShellExtensions/IoC.cs @@ -1,6 +1,40 @@ -// -// This project is open source. Released under the XYZ license +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // +// ----------------------------------------------------------------------- + namespace Pithos.ShellExtensions { diff --git a/trunk/Pithos.ShellExtensions/LogCategories.cs b/trunk/Pithos.ShellExtensions/LogCategories.cs index b3db92d..e76eead 100644 --- a/trunk/Pithos.ShellExtensions/LogCategories.cs +++ b/trunk/Pithos.ShellExtensions/LogCategories.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.ShellExtensions/Menus/DisplayFlags.cs b/trunk/Pithos.ShellExtensions/Menus/DisplayFlags.cs index ab879e2..4131c41 100644 --- a/trunk/Pithos.ShellExtensions/Menus/DisplayFlags.cs +++ b/trunk/Pithos.ShellExtensions/Menus/DisplayFlags.cs @@ -1,6 +1,40 @@ -// -// This project is open source. Released under the XYZ license +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // +// ----------------------------------------------------------------------- + namespace Pithos.ShellExtensions.Menus { diff --git a/trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs b/trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs index ca2740f..977e035 100644 --- a/trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs +++ b/trunk/Pithos.ShellExtensions/Menus/FileContextMenu.cs @@ -1,4 +1,41 @@ -using System; +// ----------------------------------------------------------------------- +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. +// +// ----------------------------------------------------------------------- + +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; @@ -8,6 +45,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; +using System.Threading.Tasks; using Pithos.ShellExtensions.Properties; namespace Pithos.ShellExtensions.Menus @@ -149,6 +187,24 @@ namespace Pithos.ShellExtensions.Menus void OnGotoPithos(IntPtr hWnd) { + var client = PithosHost.GetCommandsClient(); + + client.BeginGotoSite(Context.CurrentFile, c => + { + try + { + c.AsyncWaitHandle.WaitOne(); + client.Close(); + } + catch (Exception exc) + { + Trace.WriteLine(exc.ToString()); + } + }, null); + + + //TODO: Move this operation to the application. This is a slow process that freeze Windows Explorer +/* var settings = Context.Settings; var activeAccount = settings.Accounts.FirstOrDefault(acc => Context.CurrentFile.StartsWith(acc.RootPath,StringComparison.InvariantCultureIgnoreCase)); var address = String.Format("{0}/ui/?token={1}&user={2}", @@ -158,6 +214,7 @@ namespace Pithos.ShellExtensions.Menus settings.Reload(); Process.Start(address); +*/ } diff --git a/trunk/Pithos.ShellExtensions/Overlays/AddedIcodOverlay.cs b/trunk/Pithos.ShellExtensions/Overlays/AddedIcodOverlay.cs index 09f4167..f1eae6e 100644 --- a/trunk/Pithos.ShellExtensions/Overlays/AddedIcodOverlay.cs +++ b/trunk/Pithos.ShellExtensions/Overlays/AddedIcodOverlay.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.ShellExtensions/Overlays/UnversionedIconOverlay.cs b/trunk/Pithos.ShellExtensions/Overlays/UnversionedIconOverlay.cs index 1053e09..a131499 100644 --- a/trunk/Pithos.ShellExtensions/Overlays/UnversionedIconOverlay.cs +++ b/trunk/Pithos.ShellExtensions/Overlays/UnversionedIconOverlay.cs @@ -1,9 +1,41 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- + using System.Runtime.InteropServices; namespace Pithos.ShellExtensions.Overlays diff --git a/trunk/Pithos.ShellExtensions/Pithos.ShellExtensions.csproj b/trunk/Pithos.ShellExtensions/Pithos.ShellExtensions.csproj index 9c11c97..dbdddd0 100644 --- a/trunk/Pithos.ShellExtensions/Pithos.ShellExtensions.csproj +++ b/trunk/Pithos.ShellExtensions/Pithos.ShellExtensions.csproj @@ -118,6 +118,9 @@ x64 + + ..\Libraries\AsyncCtpLibrary.dll + ..\Libraries\log4net.dll diff --git a/trunk/Pithos.ShellExtensions/PithosHost.cs b/trunk/Pithos.ShellExtensions/PithosHost.cs index 71370e8..1807cf5 100644 --- a/trunk/Pithos.ShellExtensions/PithosHost.cs +++ b/trunk/Pithos.ShellExtensions/PithosHost.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.ShellExtensions/Properties/AssemblyInfo.cs b/trunk/Pithos.ShellExtensions/Properties/AssemblyInfo.cs index e78ae0d..ab53631 100644 --- a/trunk/Pithos.ShellExtensions/Properties/AssemblyInfo.cs +++ b/trunk/Pithos.ShellExtensions/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Pithos.ShellExtensions")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("GRNet")] [assembly: AssemblyProduct("Pithos.ShellExtensions")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyCopyright("Copyright © GRNet 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/Reference.cs b/trunk/Pithos.ShellExtensions/Service References/PithosService/Reference.cs index cd5d786..80506c2 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/Reference.cs +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/Reference.cs @@ -249,13 +249,21 @@ namespace Pithos.ShellExtensions.PithosService { [System.ServiceModel.ServiceContractAttribute(Namespace="http://PITHOS.Client.Commands", ConfigurationName="PithosService.ICommandsService")] public interface ICommandsService { - [System.ServiceModel.OperationContractAttribute(Action="http://PITHOS.Client.Commands/ICommandsService/ShowProperties", ReplyAction="http://PITHOS.Client.Commands/ICommandsService/ShowPropertiesResponse")] + [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://PITHOS.Client.Commands/ICommandsService/ShowProperties")] void ShowProperties(string fileName); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://PITHOS.Client.Commands/ICommandsService/ShowProperties", ReplyAction="http://PITHOS.Client.Commands/ICommandsService/ShowPropertiesResponse")] + [System.ServiceModel.OperationContractAttribute(IsOneWay=true, AsyncPattern=true, Action="http://PITHOS.Client.Commands/ICommandsService/ShowProperties")] System.IAsyncResult BeginShowProperties(string fileName, System.AsyncCallback callback, object asyncState); void EndShowProperties(System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://PITHOS.Client.Commands/ICommandsService/GotoSite")] + void GotoSite(string fileName); + + [System.ServiceModel.OperationContractAttribute(IsOneWay=true, AsyncPattern=true, Action="http://PITHOS.Client.Commands/ICommandsService/GotoSite")] + System.IAsyncResult BeginGotoSite(string fileName, System.AsyncCallback callback, object asyncState); + + void EndGotoSite(System.IAsyncResult result); } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] @@ -272,6 +280,12 @@ namespace Pithos.ShellExtensions.PithosService { private System.Threading.SendOrPostCallback onShowPropertiesCompletedDelegate; + private BeginOperationDelegate onBeginGotoSiteDelegate; + + private EndOperationDelegate onEndGotoSiteDelegate; + + private System.Threading.SendOrPostCallback onGotoSiteCompletedDelegate; + public CommandsServiceClient() { } @@ -293,6 +307,8 @@ namespace Pithos.ShellExtensions.PithosService { public event System.EventHandler ShowPropertiesCompleted; + public event System.EventHandler GotoSiteCompleted; + public void ShowProperties(string fileName) { base.Channel.ShowProperties(fileName); } @@ -341,5 +357,54 @@ namespace Pithos.ShellExtensions.PithosService { base.InvokeAsync(this.onBeginShowPropertiesDelegate, new object[] { fileName}, this.onEndShowPropertiesDelegate, this.onShowPropertiesCompletedDelegate, userState); } + + public void GotoSite(string fileName) { + base.Channel.GotoSite(fileName); + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public System.IAsyncResult BeginGotoSite(string fileName, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGotoSite(fileName, callback, asyncState); + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public void EndGotoSite(System.IAsyncResult result) { + base.Channel.EndGotoSite(result); + } + + private System.IAsyncResult OnBeginGotoSite(object[] inValues, System.AsyncCallback callback, object asyncState) { + string fileName = ((string)(inValues[0])); + return this.BeginGotoSite(fileName, callback, asyncState); + } + + private object[] OnEndGotoSite(System.IAsyncResult result) { + this.EndGotoSite(result); + return null; + } + + private void OnGotoSiteCompleted(object state) { + if ((this.GotoSiteCompleted != null)) { + InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); + this.GotoSiteCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); + } + } + + public void GotoSiteAsync(string fileName) { + this.GotoSiteAsync(fileName, null); + } + + public void GotoSiteAsync(string fileName, object userState) { + if ((this.onBeginGotoSiteDelegate == null)) { + this.onBeginGotoSiteDelegate = new BeginOperationDelegate(this.OnBeginGotoSite); + } + if ((this.onEndGotoSiteDelegate == null)) { + this.onEndGotoSiteDelegate = new EndOperationDelegate(this.OnEndGotoSite); + } + if ((this.onGotoSiteCompletedDelegate == null)) { + this.onGotoSiteCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGotoSiteCompleted); + } + base.InvokeAsync(this.onBeginGotoSiteDelegate, new object[] { + fileName}, this.onEndGotoSiteDelegate, this.onGotoSiteCompletedDelegate, userState); + } } } diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/StatusService.wsdl b/trunk/Pithos.ShellExtensions/Service References/PithosService/StatusService.wsdl index 342cb64..5887cbf 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/StatusService.wsdl +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/StatusService.wsdl @@ -1,5 +1,5 @@ - + @@ -62,9 +62,12 @@ - + + + + - + diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex.wsdl b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex.wsdl index 5fe7bb4..0d30957 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex.wsdl +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex.wsdl @@ -1,5 +1,5 @@ - + diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex1.wsdl b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex1.wsdl index 12c0fc4..7c18b5f 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex1.wsdl +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex1.wsdl @@ -1,5 +1,5 @@ - + diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.wsdl b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.wsdl index 5db3a49..6dff636 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.wsdl +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.wsdl @@ -1,5 +1,5 @@ - + @@ -13,13 +13,15 @@ - - + + - + + + \ No newline at end of file diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.xsd b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.xsd index cf51df4..c174d46 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.xsd +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex2.xsd @@ -75,7 +75,7 @@ - + diff --git a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex5.xsd b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex5.xsd index a66c246..429824d 100644 --- a/trunk/Pithos.ShellExtensions/Service References/PithosService/mex5.xsd +++ b/trunk/Pithos.ShellExtensions/Service References/PithosService/mex5.xsd @@ -7,9 +7,11 @@ - + - + + + \ No newline at end of file diff --git a/trunk/Pithos.ShellExtensions/ShellSettings.cs b/trunk/Pithos.ShellExtensions/ShellSettings.cs index 5d315d8..259982d 100644 --- a/trunk/Pithos.ShellExtensions/ShellSettings.cs +++ b/trunk/Pithos.ShellExtensions/ShellSettings.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // ----------------------------------------------------------------------- diff --git a/trunk/Pithos.ShellExtensions/ShellStatusChecker.cs b/trunk/Pithos.ShellExtensions/ShellStatusChecker.cs index f3f6b46..d65ea10 100644 --- a/trunk/Pithos.ShellExtensions/ShellStatusChecker.cs +++ b/trunk/Pithos.ShellExtensions/ShellStatusChecker.cs @@ -1,6 +1,37 @@ // ----------------------------------------------------------------------- -// -// TODO: Update copyright text. +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. // // -----------------------------------------------------------------------