/// </summary>
public partial class App : Application
{
- private log4net.ILog Log = log4net.LogManager.GetLogger(typeof (App));
+ private readonly log4net.ILog _log = log4net.LogManager.GetLogger(typeof (App));
+
public App()
{
- //var extensionController = new ShellExtensionController();
- //extensionController.RegisterExtensions();
log4net.Config.XmlConfigurator.Configure();
-
+
this.DispatcherUnhandledException += OnUnhandledException;
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
TaskScheduler.UnobservedTaskException += OnUnobservedException;
-/*
- var appPatth = Assembly.GetExecutingAssembly().Location;
- Registry.LocalMachine.SetValue(@"Software\Pithos\AppPath",appPatth );
-*/
InitializeComponent();
- //Application.Current.ApplyTheme("BureauBlue");
}
private void OnUnobservedException(object sender, UnobservedTaskExceptionEventArgs e)
{
var logMessage = CreateMessage(messages);
- Log.Error(logMessage);
- }
-
- private async void SendMessages(IEnumerable<UserMessage> messages )
- {
- var logMessage = CreateMessage(messages);
-
- var mailer = new SmtpClient();
- await mailer.SendTaskAsync("pithos@grnet.gr", "support@pithos.grnet.gr", "Errors", logMessage);
+ _log.Error(logMessage);
}
private static string CreateMessage(IEnumerable<UserMessage> messages)
[Export]
public class PithosSettings : IPithosSettings
{
+ private readonly Settings _settings = Settings.Default;
+
public bool UseDefaultProxy
{
- get { return Settings.Default.UseDefaultProxy; }
- set { Settings.Default.UseDefaultProxy = value; }
+ get { return _settings.UseDefaultProxy; }
+ set { _settings.UseDefaultProxy = value; }
}
public bool UseManualProxy
{
- get { return Settings.Default.UseManualProxy; }
- set { Settings.Default.UseManualProxy = value; }
+ get { return _settings.UseManualProxy; }
+ set { _settings.UseManualProxy = value; }
}
public bool UseNoProxy
{
- get { return Settings.Default.UseNoProxy; }
- set { Settings.Default.UseNoProxy = value; }
+ get { return _settings.UseNoProxy; }
+ set { _settings.UseNoProxy = value; }
}
public string PithosPath
{
- get { return Settings.Default.PithosPath; }
- set { Settings.Default.PithosPath = value; }
+ get { return _settings.PithosPath; }
+ set { _settings.PithosPath = value; }
}
- public string PithosSite
+ /* public string PithosSite
{
- get { return Settings.Default.PithosSite; }
- }
+ get { return _settings.PithosSite; }
+ }*/
public string PithosLoginUrl
{
- get { return Settings.Default.PithosLoginUrl; }
+ get { return _settings.PithosLoginUrl; }
}
public string IconsPath
{
- get { return Settings.Default.IconPath; }
- set { Settings.Default.IconPath = value; }
+ get { return _settings.IconPath; }
+ set { _settings.IconPath = value; }
}
public string UserName
{
- get { return Settings.Default.UserName; }
- set { Settings.Default.UserName = value; }
+ get { return _settings.UserName; }
+ set { _settings.UserName = value; }
}
public string ApiKey
{
- get { return Settings.Default.ApiKey; }
- set { Settings.Default.ApiKey = value; }
+ get { return _settings.ApiKey; }
+ set { _settings.ApiKey = value; }
}
public AccountsCollection Accounts
{
- get { return Settings.Default.Accounts; }
- set { Settings.Default.Accounts = value; }
+ get
+ {
+ if (_settings.Accounts==null)
+ _settings.Accounts=new AccountsCollection();
+ return _settings.Accounts;
+ }
+ set { _settings.Accounts = value; }
}
public string ProxyServer
{
- get { return Settings.Default.ProxyServer; }
- set { Settings.Default.ProxyServer = value; }
+ get { return _settings.ProxyServer; }
+ set { _settings.ProxyServer = value; }
}
public int ProxyPort
{
- get { return Settings.Default.ProxyPort; }
- set { Settings.Default.ProxyPort = value; }
+ get { return _settings.ProxyPort; }
+ set { _settings.ProxyPort = value; }
}
public string ProxyUsername
{
- get { return Settings.Default.ProxyUsername; }
- set { Settings.Default.ProxyUsername = value; }
+ get { return _settings.ProxyUsername; }
+ set { _settings.ProxyUsername = value; }
}
public string ProxyPassword
{
- get { return Settings.Default.ProxyPassword; }
- set { Settings.Default.ProxyPassword = value; }
+ get { return _settings.ProxyPassword; }
+ set { _settings.ProxyPassword = value; }
}
public bool ProxyAuthentication
{
- get { return Settings.Default.ProxyAuthentication; }
- set { Settings.Default.ProxyAuthentication = value; }
+ get { return _settings.ProxyAuthentication; }
+ set { _settings.ProxyAuthentication = value; }
}
public bool ExtensionsActivated
{
- get { return Settings.Default.ExtensionsActivated; }
- set { Settings.Default.ExtensionsActivated = value; }
+ get { return _settings.ExtensionsActivated; }
+ set { _settings.ExtensionsActivated = value; }
}
public bool ShowDesktopNotifications
{
- get { return Settings.Default.ShowDesktopNotifications; }
- set { Settings.Default.ShowDesktopNotifications = value; }
+ get { return _settings.ShowDesktopNotifications; }
+ set { _settings.ShowDesktopNotifications = value; }
}
/*
public override IEnumerable<string> GetDynamicMemberNames()
{
- return (from SettingsProperty property in Settings.Default.Properties
+ return (from SettingsProperty property in _settings.Properties
select property.Name);
}
private Lazy<ILookup<string, SettingsProperty>> _propertyNames = new Lazy<ILookup<string, SettingsProperty>>(
() => (from SettingsProperty property in
- Settings.Default.Properties
+ _settings.Properties
select property).ToLookup(property => property.Name));
public override bool TryGetMember(GetMemberBinder binder, out object result)
result = null;
if (!_propertyNames.Value.Contains(binder.Name))
return false;
- result=Settings.Default.Properties[binder.Name];
+ result=_settings.Properties[binder.Name];
return true;
}
*/
public void Save()
{
- Settings.Default.Save();
+ _settings.Save();
}
public void Reload()
{
- Settings.Default.Reload();
+ _settings.Reload();
}
}
}
Manifest = value.Manifest;
IsPublic = value.IsPublic;
if (IsPublic)
- PublicUrl = String.Format("{0}/v1{1}", Settings.Default.PithosSite ,value.PublicUrl);
+ PublicUrl = String.Format("{0}/v1{1}", Shell.Accounts.First(account=>account.UserName==PithosFile.Account).SiteUri,value.PublicUrl);
using (var icon = Icon.ExtractAssociatedIcon(LocalFileName))
{
<extToolkit:WizardPage x:Name="IntroPage"
Title="Add new Pithos Account"
Description="This Wizard will walk you through adding a new Pithos account and retrieving an authentication token" />
+ <extToolkit:WizardPage x:Name="ChooseServer" PageType="Interior"
+ Title="Where do you want to connect?"
+ Description="You can connect to the production or development server, or enter your own server URL"
+ CanSelectNextPage="{Binding IsValidServer}"
+ >
+ <StackPanel >
+ <Label Content="Pithos Server" Target="{Binding ElementName=Servers}" />
+ <ComboBox x:Name="Servers" IsEditable="True" ItemsSource="{Binding Servers}"
+ Text="{Binding CurrentServer,ValidatesOnExceptions=True, Mode=TwoWay}" >
+ <Validation.ErrorTemplate>
+ <ControlTemplate>
+ <StackPanel>
+ <AdornedElementPlaceholder />
+ <TextBlock Foreground="Red" >Invalid Path</TextBlock>
+ </StackPanel>
+ </ControlTemplate>
+ </Validation.ErrorTemplate>
+ </ComboBox>
+ </StackPanel>
+ </extToolkit:WizardPage>
<extToolkit:WizardPage x:Name="ChooseMethodPage" PageType="Interior"
Title="How do you want to add the account?"
Description="You can add an account either by logging in the Pithos Web Site or by entering your username and password manually"
</extToolkit:WizardPage>
<extToolkit:WizardPage x:Name="ManualAccountPage" PageType="Interior"
Title="Add an account manually"
- Description="This is the second page in the process"
+ Description="Please enter the account credentials and press "Validate Credentials""
NextPage="{Binding ElementName=AccountPathPage}"
- CanSelectNextPage="{Binding HasCredentials}"
+ CanSelectNextPage="{Binding HasValidCredentials}"
>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="91*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition />
- </Grid.RowDefinitions>
- <Label Content="Account" Grid.Column="0" Grid.Row="0" Margin="0,5" HorizontalAlignment="Left"/>
- <TextBox Name="AccountName" Grid.Column="1" Grid.Row="0" Margin="5"/>
- <Label Content="API Key" Grid.Column="0" Grid.Row="1" Margin="0,5" HorizontalAlignment="Left"/>
- <TextBox Name="Token" Grid.Column="1" Grid.Row="1" Margin="5"/>
- </Grid>
+ <extToolkit:BusyIndicator x:Name="ManualBusyIndicator" IsBusy="{Binding IsValidating,NotifyOnSourceUpdated=true}" DisplayAfter="0" >
+ <extToolkit:BusyIndicator.BusyContent>
+ <TextBlock x:Name="ManualBusyMessage" Text="Validating credentials" />
+ </extToolkit:BusyIndicator.BusyContent>
+ <extToolkit:BusyIndicator.Content>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="91*"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition />
+ </Grid.RowDefinitions>
+ <Label Content="Account" Grid.Column="0" Grid.Row="0" Margin="0,5" HorizontalAlignment="Left"/>
+ <TextBox Name="AccountName" Grid.Column="1" Grid.Row="0" Margin="5"/>
+ <Label Content="API Key" Grid.Column="0" Grid.Row="1" Margin="0,5" HorizontalAlignment="Left"/>
+ <TextBox Name="Token" Grid.Column="1" Grid.Row="1" Margin="5"/>
+ <Button x:Name="TestManualAccount" Content="Validate Credentials" IsEnabled="{Binding HasCredentials}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" cal:Message.Attach="TestAccount" Margin="5"/>
+ </Grid>
+ </extToolkit:BusyIndicator.Content>
+ </extToolkit:BusyIndicator>
</extToolkit:WizardPage>
<extToolkit:WizardPage x:Name="AutoAccountPage" PageType="Interior"
Title="Add an account automatically"
Description="By clicking on the button below you will be taken to the Pithos web site where you can login with your username and password."
NextPage="{Binding ElementName=AutoConfirmedPage}"
- CanSelectNextPage="{Binding IsConfirmed}"
+ CanSelectNextPage="{Binding HasValidCredentials}"
cal:Message.Attach="[Event GotFocus] = [Action RetrieveCredentials()]"
>
<extToolkit:BusyIndicator IsBusy="{Binding IsRetrieving}">
<Button Margin="5" Name="RetrieveCredentials" Content="Retrieve Credentials" Width="150"/>
<TextBlock Text="Credentials Retrieved Succesfully" Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=HasCredentials}" Margin="10" HorizontalAlignment="Center"/>
+ <Button x:Name="TestAutoAccount" Content="Validate Credentials" IsEnabled="{Binding HasCredentials}" HorizontalAlignment="Center" cal:Message.Attach="TestAccount" Margin="5"/>
</StackPanel>
</extToolkit:BusyIndicator.Content>
</extToolkit:BusyIndicator>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<TextBlock Text="{Binding Token}" Grid.Column="1" Grid.Row="1" Margin="5,2"/>
<TextBlock Text="Account Path:" Grid.Column="0" Grid.Row="2" Margin="5,2"/>
<TextBlock Text="{Binding AccountPath}" Grid.Column="1" Grid.Row="2" Margin="5,2"/>
-
- <CheckBox x:Name="IsAccountActive" Content="Start using the account immediatelly" Grid.ColumnSpan="2" Grid.Row="3" Margin="5"/>
+
+ <CheckBox x:Name="IsAccountActive" Content="Start using the account immediatelly" Grid.ColumnSpan="2" Grid.Row="4" Margin="5"/>
</Grid>
</extToolkit:WizardPage>
</extToolkit:Wizard>
{
public AddAccountView()
{
- InitializeComponent();
+ InitializeComponent();
+
+ //When the busy indicator changes, force a focus change. Workaround for delayed change of the Next button's visibility
+ ManualBusyMessage.IsVisibleChanged += (sender, evt) => Token.Focus(); ;
}
+
private void Automatic_Checked(object sender, RoutedEventArgs e)
{
ChooseMethodPage.NextPage = AutoAccountPage;
using System.IO;
using System.Linq;
using System.Text;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
+using Caliburn.Micro;
using Pithos.Client.WPF.Properties;
using Pithos.Core;
+using Pithos.Network;
using MessageBox = System.Windows.MessageBox;
using Screen = Caliburn.Micro.Screen;
[Export(typeof(AddAccountViewModel))]
public class AddAccountViewModel:Screen
{
+
+ private readonly List<string> _servers;
+
+ public List<string> Servers
+ {
+ get { return _servers; }
+ }
+
+ private bool _isValidServer;
+ public bool IsValidServer
+ {
+ get { return _isValidServer; }
+ set
+ {
+ _isValidServer = value;
+ NotifyOfPropertyChange(()=>IsValidServer);
+ }
+ }
+
+
+ private string _currentServer;
+ public string CurrentServer
+ {
+ get { return _currentServer; }
+ set
+ {
+ if (!Uri.IsWellFormedUriString(value, UriKind.Absolute))
+ {
+ IsValidServer = false;
+ throw new UriFormatException();
+ }
+ _currentServer = value;
+ IsValidServer = true;
+ HasValidCredentials = false;
+ IsConfirmed = false;
+ NotifyOfPropertyChange(()=>CurrentServer);
+ }
+ }
+
private string _accountName;
public string AccountName
{
set
{
_isConfirmed = value;
+ HasValidCredentials = false;
NotifyOfPropertyChange(() => IsConfirmed);
}
}
IsRetrieving = false;
}
-
+
+ public AddAccountViewModel()
+ {
+ _servers=new List<string>
+ {
+ Settings.Default.ProductionServer,
+ Settings.Default.DevelopmentServer
+ };
+ CurrentServer = _servers[0];
+ }
+
+ private bool _hasValidCredentials;
+ public bool HasValidCredentials
+ {
+ get { return _hasValidCredentials; }
+ set
+ {
+ _hasValidCredentials = value;
+ NotifyOfPropertyChange(()=>HasValidCredentials);
+ }
+ }
+
+
+ private bool _isValidating;
+ public bool IsValidating
+ {
+ get { return _isValidating; }
+ set
+ {
+ _isValidating = value;
+ NotifyOfPropertyChange(()=>IsValidating);
+ }
+ }
+
+ public async void TestAccount()
+ {
+ try
+ {
+ IsValidating = true;
+ var client = new CloudFilesClient(AccountName, Token) {AuthenticationUrl = CurrentServer};
+ var containers = await TaskEx.Run(()=>
+ {
+ client.Authenticate();
+ return client.ListContainers(AccountName);
+ });
+ HasValidCredentials = true;
+ }
+ catch (Exception ex)
+ {
+ HasValidCredentials = false;
+ MessageBox.Show("The account is not valid", "Account Error", MessageBoxButton.OK, MessageBoxImage.Stop);
+ throw;
+ }
+ finally
+ {
+ IsValidating = false;
+ }
+ }
}
}
Settings=settings;
Accounts = new ObservableConcurrentCollection<AccountSettings>();
+ if (settings.Accounts == null)
+ {
+ settings.Accounts=new AccountsCollection();
+ settings.Save();
+ }
Accounts.AddFromEnumerable(settings.Accounts);
var startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
var newAccount = new AccountSettings
{
AccountName = wizard.AccountName,
+ ServerUrl=new Uri(wizard.CurrentServer),
ApiKey=wizard.Token,
RootPath=wizard.AccountPath,
IsActive=wizard.IsAccountActive,
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("http://pithos.dev.grnet.gr")]
- public string PithosSite {
- get {
- return ((string)(this["PithosSite"]));
- }
- }
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("https://pithos.dev.grnet.gr")]
- public string PithosAuthenticationUrl {
- get {
- return ((string)(this["PithosAuthenticationUrl"]));
- }
- }
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://auth.api.rackspacecloud.com")]
public string CloudfilesAuthenticationUrl {
get {
}
}
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("http://plus.pithos.grnet.gr")]
+ public string ProductionServer {
+ get {
+ return ((string)(this["ProductionServer"]));
+ }
+ }
+
+ [global::System.Configuration.ApplicationScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("http://pithos.dev.grnet.gr")]
+ public string DevelopmentServer {
+ get {
+ return ((string)(this["DevelopmentServer"]));
+ }
+ }
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("\r\n <ArrayOfAccountSettings xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-i" +
- "nstance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />\r\n ")]
public global::Pithos.Interfaces.AccountsCollection Accounts {
get {
return ((global::Pithos.Interfaces.AccountsCollection)(this["Accounts"]));
<Setting Name="UseManualProxy" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
- <Setting Name="PithosSite" Type="System.String" Scope="Application">
- <Value Profile="(Default)">http://pithos.dev.grnet.gr</Value>
- </Setting>
- <Setting Name="PithosAuthenticationUrl" Type="System.String" Scope="Application">
- <Value Profile="(Default)">https://pithos.dev.grnet.gr</Value>
- </Setting>
<Setting Name="CloudfilesAuthenticationUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://auth.api.rackspacecloud.com</Value>
</Setting>
<Setting Name="FeedbackUri" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://pithos.dev.grnet.gr/tools/feedback</Value>
</Setting>
- <Setting Name="Accounts" Type="Pithos.Interfaces.AccountsCollection" Scope="User">
- <Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
-<ArrayOfAccountSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /></Value>
- </Setting>
<Setting Name="MustUpgrade" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
+ <Setting Name="ProductionServer" Type="System.String" Scope="Application">
+ <Value Profile="(Default)">http://plus.pithos.grnet.gr</Value>
+ </Setting>
+ <Setting Name="DevelopmentServer" Type="System.String" Scope="Application">
+ <Value Profile="(Default)">http://pithos.dev.grnet.gr</Value>
+ </Setting>
+ <Setting Name="Accounts" Type="Pithos.Interfaces.AccountsCollection" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
private async Task StartMonitoring()
{
try
- {
+ {
+ if (Settings.Accounts == null)
+ {
+ Settings.Accounts=new AccountsCollection();
+ Settings.Save();
+ return;
+ }
+
foreach (var account in Settings.Accounts)
{
await MonitorAccount(account);
var appSettings = Properties.Settings.Default;
monitor.AuthenticationUrl = account.UsePithos
- ? appSettings.PithosAuthenticationUrl
+ ? account.ServerUrl.ToString()
: appSettings.CloudfilesAuthenticationUrl;
_monitors[accountName] = monitor;
}
+/*
public void GoToSite()
{
var site = Properties.Settings.Default.PithosSite;
Process.Start(site);
}
+*/
public void GoToSite(AccountInfo account)
{
var site = String.Format("{0}/ui/?token={1}&user={2}",
- Properties.Settings.Default.PithosSite,account.Token,
+ account.SiteUri,account.Token,
account.UserName);
Process.Start(site);
}
return;
account.SiteUri= String.Format("{0}/ui/?token={1}&user={2}",
- Properties.Settings.Default.PithosSite, account.Token,
+ account.SiteUri, account.Token,
account.UserName);
IProducerConsumerCollection<AccountInfo> accounts = Accounts;
<setting name="UseManualProxy" serializeAs="String">
<value>False</value>
</setting>
- <setting name="Accounts" serializeAs="Xml">
- <value>
- <ArrayOfAccountSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
- </value>
- </setting>
<setting name="MustUpgrade" serializeAs="String">
<value>True</value>
</setting>
</startup>
<applicationSettings>
<Pithos.Client.WPF.Properties.Settings>
- <setting name="PithosSite" serializeAs="String">
- <value>http://pithos.dev.grnet.gr</value>
- </setting>
- <setting name="PithosAuthenticationUrl" serializeAs="String">
- <value>https://pithos.dev.grnet.gr</value>
- </setting>
<setting name="CloudfilesAuthenticationUrl" serializeAs="String">
<value>https://auth.api.rackspacecloud.com</value>
</setting>
<setting name="FeedbackUri" serializeAs="String">
<value>http://pithos.dev.grnet.gr/tools/feedback</value>
</setting>
+ <setting name="ProductionServer" serializeAs="String">
+ <value>http://plus.pithos.grnet.gr</value>
+ </setting>
+ <setting name="DevelopmentServer" serializeAs="String">
+ <value>http://pithos.dev.grnet.gr</value>
+ </setting>
</Pithos.Client.WPF.Properties.Settings>
</applicationSettings>
<log4net>
public string RootPath { get; set; }
+ public Uri ServerUrl { get; set; }
+
private StringCollection _selectiveFolders = new StringCollection();
public interface IPithosSettings
{
string PithosPath { get; set; }
- string PithosSite { get; }
string IconsPath { get; set; }
string UserName { get; set; }
string ApiKey { get; set; }
Contract.EndContractBlock();
PithosPath = other.PithosPath;
- PithosSite = other.PithosSite;
IconsPath = other.IconsPath;
UserName = other.UserName;
ApiKey = other.ApiKey;
Assert.AreEqual(0,result.Count);
}
+
+ [Test]
+ public void TestAuthentication()
+ {
+ var account = "ikons@cslab.ece.ntua.gr";
+ var apiKey = "fKzKaRd7Uhov+xca4B4rOQ==";
+ var client = new CloudFilesClient(account, apiKey)
+ {
+ AuthenticationUrl = @"https://plus.pithos.grnet.gr",
+ UsePithos = true
+ };
+ var accountInfo=client.Authenticate();
+ var containers=client.ListContainers(accountInfo.UserName);
+ Assert.IsNotNull(containers);
+ var result=client.GetAccountPolicies(accountInfo);
+
+ Assert.IsNotNull(accountInfo);
+ Assert.IsNotNull(result);
+ }
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.PithosSite,
+ activeAccount.ServerUrl,
activeAccount.ApiKey,
Uri.EscapeUriString(activeAccount.AccountName));
set { _settings.Value.PithosPath = value; }
}
+/*
public string PithosSite
{
get { return _settings.Value.PithosSite; }
}
+*/
public string IconsPath
{
{C6251981-3C49-404B-BB5B-9732887388D2}.Debug|Any CPU.ActiveCfg = Debug
{C6251981-3C49-404B-BB5B-9732887388D2}.Debug|Mixed Platforms.ActiveCfg = Debug
{C6251981-3C49-404B-BB5B-9732887388D2}.Debug|x64.ActiveCfg = Debug
- {C6251981-3C49-404B-BB5B-9732887388D2}.Debug|x64.Build.0 = Debug
{C6251981-3C49-404B-BB5B-9732887388D2}.Debug|x86.ActiveCfg = Debug
{C6251981-3C49-404B-BB5B-9732887388D2}.Premium Debug|Any CPU.ActiveCfg = Premium Debug
{C6251981-3C49-404B-BB5B-9732887388D2}.Premium Debug|Mixed Platforms.ActiveCfg = Premium Debug