Пример #1
0
        //files.upload(parameters.filename, parameters.filedata, providerAccount,parameters.bucket, parameters.path );

        public string upload(string fileName, string fileData, string providerAccount, string bucket, string path)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new Durados.DuradosException(Messages.MissingFileName);
            }

            if (string.IsNullOrEmpty(fileData))
            {
                throw new Durados.DuradosException(Messages.MissingFileData);
            }

            IFiles files = StorageFactoey.GetCloudStorage(providerAccount);

            if (files == null || files.Cloud == null)
            {
                return(files.upload(fileName, fileData, null, path));
            }

            if (string.IsNullOrEmpty(bucket))
            {
                throw new Durados.DuradosException(Messages.MissingBucket);
            }


            return(files.upload(fileName, fileData, bucket, path));
        }
Пример #2
0
        public void delete(string fileName, string providerAccount, string bucket, string path)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new Durados.DuradosException(Messages.MissingFileName);
            }

            if (string.IsNullOrEmpty(bucket))
            {
                throw new Durados.DuradosException(Messages.MissingBucket);
            }

            IFiles files = StorageFactoey.GetCloudStorage(providerAccount);

            files.delete(fileName, bucket, path);
        }