[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("")]
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="DebugLogger.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System;
using System.Diagnostics;
namespace Caliburn.Micro.Logging
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="log4netLogger.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// -----------------------------------------------------------------------
-// <copyright file="PithosSettings.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="PithosSettings.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="FilePropertiesViewModel.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="FilePropertiesViewModel.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="PithosAccount.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="PithosAccount.cs" company="GRNet">
+// 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.
+
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="PreferencesViewModel.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="PreferencesViewModel.cs" company="GRNet">
+// 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.
+
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="StatusService.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="StatusService.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
using System;
+using System.Diagnostics;
+using System.Linq;
+using System.ServiceModel.Description;
using Caliburn.Micro;
using System.ServiceModel;
using System.ComponentModel.Composition;
//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);
//// Add a mex endpoint
/*
+
var smb = new ServiceMetadataBehavior
{
HttpGetEnabled = true,
service.Description.Behaviors.Add(smb);
*/
+
service.Faulted+=OnError;
service.Open();
return service;
// -----------------------------------------------------------------------
-// <copyright file="AboutViewModel.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="AboutViewModel.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="FeedbackViewModel.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="FeedbackViewModel.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
+
using System.Collections.Specialized;
using System.ComponentModel.Composition;
using System.Diagnostics;
//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
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);
- }
}
}
<CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
<CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly>
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</ItemGroup>
<ItemGroup>
<Compile Include="EnumerableExtensionsTest.cs" />
+ <Compile Include="ExtensionTests.cs" />
<Compile Include="NetworkAgentTest.cs" />
<Compile Include="PithosWorkflowTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
[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("")]
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Pithos.Core.Agents;
namespace Pithos.Core
{
public class Agent<TMessage> : IDisposable
- {
- private readonly BlockingCollection<TMessage> _messages = new BlockingCollection<TMessage>();
+ {
+ private readonly ConcurrentQueue<TMessage> _queue;
+ private readonly BlockingCollection<TMessage> _messages;
private readonly CancellationTokenSource _cancelSource = new CancellationTokenSource();
public CancellationToken CancellationToken;
public Agent(Action<Agent<TMessage>> action)
{
+ _queue=new ConcurrentQueue<TMessage>();
+ _messages = new BlockingCollection<TMessage>(_queue);
_process = action;
CancellationToken = _cancelSource.Token;
}
return _messages;
}
+ /// <summary>
+ /// Remove the first message that matches the predicate
+ /// </summary>
+ /// <param name="predicate">The condition to match</param>
+ /// <remarks>Removes the first message that matches the predicate by dequeing all
+ /// messages and re-enqueing all except the first matching message</remarks>
+ public void Remove(Func<TMessage,bool> 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<Exception> onError=null)
{
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)
return false;
}
- public FileSystemInfo GetFileInfo(string relativePath)
+ public FileSystemInfo GetFileSystemInfo(string relativePath)
{
if (String.IsNullOrWhiteSpace(relativePath))
throw new ArgumentNullException("relativePath");
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();
}
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="FileInfoExtensions.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+
+using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
return Signature.CalculateTreeHash(info.FullName, blockSize, algorithm).TopHash.ToHashString();
}
-
-
-
}
}
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="NetworkAgent.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel.Composition;
namespace Pithos.Core.Agents
{
+ //TODO: Ensure all network operations use exact casing. Pithos is case sensitive
[Export]
public class NetworkAgent
{
private Agent<CloudAction> _agent;
+ //A separate agent is used to execute delete actions immediatelly;
+ private Agent<CloudDeleteAction> _deleteAgent;
+
[Import]
public IStatusKeeper StatusKeeper { get; set; }
inbox.LoopAsync(process, loop);
};
loop();
- });
+ });
+
+ _deleteAgent = Agent<CloudDeleteAction>.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)
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;
}
}
+ /// <summary>
+ /// Processes cloud delete actions
+ /// </summary>
+ /// <param name="action">The delete action to execute</param>
+ /// <returns></returns>
+ /// <remarks>
+ /// 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.
+ /// <para>
+ /// A separate agent is used to process deletes because the main agent may be busy with a long operation.
+ /// </para>
+ /// </remarks>
+ 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)
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();
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)
{
//The hash for a directory is the empty string
cloudAction.TopHash = new Lazy<string>(() => String.Empty);
}
- _agent.Post(cloudAction);
+
+ if (cloudAction is CloudDeleteAction)
+ _deleteAgent.Post((CloudDeleteAction)cloudAction);
+ else
+ _agent.Post(cloudAction);
}
/* class ObjectInfoByNameComparer:IEqualityComparer<ObjectInfo>
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);
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);
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);
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);
}
//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");
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();
}
//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");
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))
{
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");
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();
}
- 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
//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
{
//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);
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 ;
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="WorkflowAgent.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
// -----------------------------------------------------------------------
-// <copyright file="FileState.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="FileState.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
.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;
var fileState = new FileState
{
- FilePath = filePath,
+ FilePath = filePath.ToLower(),
OverlayStatus = FileOverlayStatus.Unversioned,
FileStatus = FileStatus.Created,
Id=Guid.NewGuid()
return fileState.UpdateHashesAsync(blockSize,algorithm);
}
- public Task<FileState> UpdateHashesAsync(int blockSize,string algorithm)
+ public async Task<FileState> UpdateHashesAsync(int blockSize,string algorithm)
{
if (blockSize<=0)
throw new ArgumentOutOfRangeException("blockSize");
//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;
}
}
// -----------------------------------------------------------------------
-// <copyright file="IStatusService.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="IStatusService.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
{
[OperationContract(IsOneWay=true)]
void ShowProperties(string fileName);
+ [OperationContract(IsOneWay=true)]
+ void GotoSite(string fileName);
+
}
}
// -----------------------------------------------------------------------
-// <copyright file="JobQueue.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="JobQueue.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+// <copyright file="NetworkGate.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
{
None,
Uploading,
- Downloading
+ Downloading,
+ Deleting,
+ Renaming
}
//The NetworkGate prevents starting download/uploads for files that are already in the process of downloading,
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;
}
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);
}
<Compile Include="Agents\AgentLocator.cs" />
<Compile Include="Agents\BlockUpdater.cs" />
<Compile Include="Agents\CloudTransferAction.cs" />
+ <Compile Include="Agents\CollectionExtensions.cs" />
<Compile Include="Agents\FileAgent.cs" />
<Compile Include="Agents\FileInfoExtensions.cs" />
<Compile Include="Agents\NetworkAgent.cs" />
[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("")]
// -----------------------------------------------------------------------
-// <copyright file="AccountSettings.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="AccountSettings.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
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));
}
+ 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");
+ }
}
}
// -----------------------------------------------------------------------
-// <copyright file="PithosSettingsData.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="PithosSettingsData.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
[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("")]
[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("")]
-// **CloudFilesClient** provides a simple client interface to CloudFiles and Pithos
+// -----------------------------------------------------------------------
+// <copyright file="CloudFilesClient.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+
+// **CloudFilesClient** provides a simple client interface to CloudFiles and Pithos
//
// The class provides methods to upload/download files, delete files, manage containers
[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("")]
// -----------------------------------------------------------------------
-// <copyright file="RestClient.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="RestClient.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
[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("")]
-// <copyright file="IoC.cs" company="GRNet">
-// This project is open source. Released under the XYZ license
+// -----------------------------------------------------------------------
+// <copyright file="FileContext.cs" company="GRNET">
+// 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.
// </copyright>
+// -----------------------------------------------------------------------
+
using System.Linq;
using Microsoft.Win32;
-// <copyright file="IoC.cs" company="GRNet">
-// This project is open source. Released under the XYZ license
+// -----------------------------------------------------------------------
+// <copyright file="IoC.cs" company="GRNET">
+// 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.
// </copyright>
+// -----------------------------------------------------------------------
+
namespace Pithos.ShellExtensions
{
// -----------------------------------------------------------------------
-// <copyright file="LogCategories.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="LogCategories.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
-// <copyright file="DisplayFlags.cs" company="GRNet">
-// This project is open source. Released under the XYZ license
+// -----------------------------------------------------------------------
+// <copyright file="DisplayFlags.cs" company="GRNET">
+// 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.
// </copyright>
+// -----------------------------------------------------------------------
+
namespace Pithos.ShellExtensions.Menus
{
-using System;
+// -----------------------------------------------------------------------
+// <copyright file="FileContextMenu.cs" company="GRNET">
+// 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.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
+using System.Threading.Tasks;
using Pithos.ShellExtensions.Properties;
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}",
settings.Reload();
Process.Start(address);
+*/
}
// -----------------------------------------------------------------------
-// <copyright file="AddedIcodOverlay.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="AddedIcodOverlay.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="UnversionedIconOverlay.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="UnversionedIconOverlay.cs" company="GRNET">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
+
using System.Runtime.InteropServices;
namespace Pithos.ShellExtensions.Overlays
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="AsyncCtpLibrary">
+ <HintPath>..\Libraries\AsyncCtpLibrary.dll</HintPath>
+ </Reference>
<Reference Include="log4net">
<HintPath>..\Libraries\log4net.dll</HintPath>
</Reference>
// -----------------------------------------------------------------------
-// <copyright file="PithosHost.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="PithosHost.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
[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("")]
[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")]
private System.Threading.SendOrPostCallback onShowPropertiesCompletedDelegate;
+ private BeginOperationDelegate onBeginGotoSiteDelegate;
+
+ private EndOperationDelegate onEndGotoSiteDelegate;
+
+ private System.Threading.SendOrPostCallback onGotoSiteCompletedDelegate;
+
public CommandsServiceClient() {
}
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> ShowPropertiesCompleted;
+ public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> GotoSiteCompleted;
+
public void ShowProperties(string fileName) {
base.Channel.ShowProperties(fileName);
}
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);
+ }
}
}
<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://PITHOS.Client.Status" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:i1="http://PITHOS.Client.Settings" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:i2="http://PITHOS.Client.Commands" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StatusService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:i0="http://PITHOS.Client.Status" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:i1="http://PITHOS.Client.Settings" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:i2="http://PITHOS.Client.Commands" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StatusService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsp:Policy wsu:Id="NetNamedPipeBinding_IStatusService_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GotoSite">
+ <soap12:operation soapAction="http://PITHOS.Client.Commands/ICommandsService/GotoSite" style="document" />
+ <wsdl:input>
<soap12:body use="literal" />
- </wsdl:output>
+ </wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StatusService">
<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Status" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Status" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Status" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Status" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema targetNamespace="http://PITHOS.Client.Status/Imports">
<xsd:import schemaLocation="http://localhost:30000/pithos/mex?xsd=xsd0" namespace="http://PITHOS.Client.Status" />
<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Settings" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Settings" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Settings" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Settings" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema targetNamespace="http://PITHOS.Client.Settings/Imports">
<xsd:import schemaLocation="http://localhost:30000/pithos/mex?xsd=xsd3" namespace="http://PITHOS.Client.Settings" />
<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Commands" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Commands" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://PITHOS.Client.Commands" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://PITHOS.Client.Commands" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema targetNamespace="http://PITHOS.Client.Commands/Imports">
<xsd:import schemaLocation="http://localhost:30000/pithos/mex?xsd=xsd5" namespace="http://PITHOS.Client.Commands" />
<wsdl:message name="ICommandsService_ShowProperties_InputMessage">
<wsdl:part name="parameters" element="tns:ShowProperties" />
</wsdl:message>
- <wsdl:message name="ICommandsService_ShowProperties_OutputMessage">
- <wsdl:part name="parameters" element="tns:ShowPropertiesResponse" />
+ <wsdl:message name="ICommandsService_GotoSite_InputMessage">
+ <wsdl:part name="parameters" element="tns:GotoSite" />
</wsdl:message>
<wsdl:portType name="ICommandsService">
<wsdl:operation name="ShowProperties">
<wsdl:input wsaw:Action="http://PITHOS.Client.Commands/ICommandsService/ShowProperties" message="tns:ICommandsService_ShowProperties_InputMessage" />
- <wsdl:output wsaw:Action="http://PITHOS.Client.Commands/ICommandsService/ShowPropertiesResponse" message="tns:ICommandsService_ShowProperties_OutputMessage" />
+ </wsdl:operation>
+ <wsdl:operation name="GotoSite">
+ <wsdl:input wsaw:Action="http://PITHOS.Client.Commands/ICommandsService/GotoSite" message="tns:ICommandsService_GotoSite_InputMessage" />
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
\ No newline at end of file
<xs:element minOccurs="0" name="IsActive" type="xs:boolean" />
<xs:element minOccurs="0" name="RootPath" nillable="true" type="xs:string" />
<xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="SelectiveFolders" nillable="true" type="q1:ArrayOfanyType" />
- <xs:element minOccurs="0" name="UsePithos" type="xs:boolean" />
+ <xs:element minOccurs="0" name="ServerUrl" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="AccountSettings" nillable="true" type="tns:AccountSettings" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="ShowPropertiesResponse">
+ <xs:element name="GotoSite">
<xs:complexType>
- <xs:sequence />
+ <xs:sequence>
+ <xs:element minOccurs="0" name="fileName" nillable="true" type="xs:string" />
+ </xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
\ No newline at end of file
// -----------------------------------------------------------------------
-// <copyright file="ShellSettings.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="ShellSettings.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// <copyright file="ShellStatusChecker.cs" company="Microsoft">
-// TODO: Update copyright text.
+// <copyright file="ShellStatusChecker.cs" company="GRNet">
+// 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.
// </copyright>
// -----------------------------------------------------------------------