using System;
using AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox.Logic;
namespace AppLimit.CloudComputing.SharpBox.StorageProvider.DropBox
{
///
/// This enum defines possible API versions DropBox offers to
/// their customers
///
public enum DropBoxAPIVersion
{
///
/// Version 0 of the DropBox API
///
V0 = 0,
///
/// Version 1 of the DropBox API
///
V1 = 1,
///
/// The current stable version which will be used by SharpBox by default
///
Stable = 1
};
///
/// DropBoxConfiguration conains the default access information for the DropBox
/// storage and synchronization services. This class implements from the
/// ICloudStorageConfiguration interface and can be used with an instance of CloudStorage
///
public class DropBoxConfiguration : ICloudStorageConfiguration
{
///
/// This method creates and returns the url which has to be used to get a access token
/// during the OAuth based authorization process
///
public Uri RequestTokenUrl
{
get { return new Uri(DropBoxStorageProviderService.GetUrlString(DropBoxStorageProviderService.DropBoxOAuthRequestToken, this)); }
}
///
/// This method creates and returns the url which has to be used to get a access token
/// during the OAuth based authorization process
///
public Uri AccessTokenUrl
{
get { return new Uri(DropBoxStorageProviderService.GetUrlString(DropBoxStorageProviderService.DropBoxOAuthAccessToken, this)); }
}
///
/// This method creates and returns the url which can be used in the browser
/// to authorize the end user
///
public Uri AuthorizationTokenUrl
{
get { return new Uri(DropBoxStorageProviderService.GetUrlString(DropBoxStorageProviderService.DropBoxOAuthAuthToken, null)); }
}
///
/// This field contains the callback URL which will be used in the oAuth
/// request. Default will be sharpbox.codeplex.com
///
public Uri AuthorizationCallBack = new Uri("http://sharpox.codeplex.com");
///
/// The APIVersion which will be used for communication with dropbox. As default
/// the stable version is set!
///
public DropBoxAPIVersion APIVersion { get; set; }
///
/// Constructor of a dropbox configuration
///
public DropBoxConfiguration()
: this(new Uri(DropBoxStorageProviderService.DropBoxBaseUrl))
{
APIVersion = DropBoxAPIVersion.Stable;
}
///
/// Allows to create the dopbox configuration with a special
/// service provider location
///
///
public DropBoxConfiguration(Uri serviceLocator)
{
ServiceLocator = serviceLocator;
}
///
/// This method generates an instance of the default dropbox configuration
///
/// Instance of the DropBoxConfiguration-Class with default settings
public static DropBoxConfiguration GetStandardConfiguration()
{
return new DropBoxConfiguration();
}
///
/// If true this value indicates the all ssl connection are valid. This means also ssl connection
/// with an invalid certificate will be accepted.
///
public bool TrustUnsecureSSLConnections
{
get { return false; }
}
///
/// The limits of dropbox
///
public CloudStorageLimits Limits
{
get { return new CloudStorageLimits(150*1024*1024, -1) { MaxChunkedUploadFileSize = -1 }; }
}
///
/// Gets the currently used dropbox url
///
public Uri ServiceLocator { get; private set; }
}
}