public IFileSystem Create(string sUser, string sPassword)
        {
            if ((sUser == null) || (sPassword == null))
            {
                return(null);
            }

            FtpAccount account;

            if (!m_accountManager.CheckAccount(sUser, sPassword, out account))
            {
                return(null);
            }

            if (!account.WriteAccess && !account.ReadAccess)
            {
                FtpServer.LogWrite($"user {sUser} has neither read nor write permissions");
                return(null);
            }

            IFileSystem system = new AzureFileSystem(account.RootFolder ?? sUser);

            if (!account.WriteAccess)
            {
                system = new ReadOnlyFileSystem(system);
            }

            return(system);
        }
Esempio n. 2
0
        public IFileSystem Create(string sUser, string sPassword)
        {
            if ((sUser == null) || (sPassword == null))
                return null;

            if (!m_accountManager.CheckAccount(sUser, sPassword))
                return null;

            string containerName = sUser;
            var system = new AzureFileSystem(containerName);

            return system;
        }
Esempio n. 3
0
        public IFileSystem Create(string sUser, string sPassword)
        {
            if ((sUser == null) || (sPassword == null))
                return null;

            if (!m_accountManager.CheckAccount(sUser, sPassword))
                return null;
            
            string containerName = sUser;
            var system = new AzureFileSystem(
                storageAccount: m_storageAccount, 
                containerName: containerName, 
                sendQueueNotificationsOnUpload: m_sendQueueNotificationsOnUpload);
            
            return system;
        }
Esempio n. 4
0
        public IFileSystem Create(string sUser, string sPassword)
        {
            if ((sUser == null) || (sPassword == null))
            {
                return(null);
            }

            if (!m_accountManager.CheckAccount(sUser, sPassword))
            {
                return(null);
            }

            string containerName = sUser;
            var    system        = new AzureFileSystem(containerName);

            return(system);
        }
Esempio n. 5
0
        public IFileSystem Create(string sUser, string sPassword)
        {
            string containerName = "";

            // TODO: Put your authentication call here. Return NULL if authentication fails. Return an initialised AzureFileSystem() object if authentication is successful.
            // In the example below, to demonstrate, any username will work so long as the password == "test".
            // Remember: you can plug in your own authentication & authorisation API to fetch the correct container name for the specified user.

            #region "REPLACE THIS WITH CODE TO YOUR OWN AUTHENTICATION API"
            if (sPassword == "test")
            {
                containerName = sUser;
            }
            else
            {
                return(null);
            }
            #endregion

            var system = new AzureFileSystem(sUser, sPassword, containerName, Modes.Development);
            return(system);
        }