示例#1
0
        private void ArchiveDirectory_Click(object sender, System.EventArgs e)
        {
            if (textBoxAWSVaultName.Text == String.Empty || textBoxAWSDynamoTableName.Text == String.Empty)
            {
                throw new Exception("textBoxAWSVaultName.Text ==String.Empty || textBoxAWSDynamoTableName.Text==String.Empty");
            }

            //AWS Requiers more than three charaters for a table name
            if (textBoxAWSDynamoTableName.Text.Length < 3)
            {
                throw new Exception("AWS Dynamo Requiers more than three charaters for a table name");
            }

            bool vaultExists = GalicierHelper.checkVault(textBoxAWSVaultName.Text);

            if (!vaultExists)
            {
                GalicierHelper.createVault(textBoxAWSVaultName.Text);
            }

            bool tableOK = DynamoDBHelper.DynamoTableCheck(textBoxAWSDynamoTableName.Text);

            if (!tableOK)
            {
                throw new Exception("AWS  Dynamo Table is not OK.  Check AWS credentials.");
            }

            folderBrowserDialog1.ShowDialog();
            String directory = folderBrowserDialog1.SelectedPath;

            DirectoryInfo di = new System.IO.DirectoryInfo(directory);

            string[] files = Directory.GetFiles(directory, "*.*", SearchOption.AllDirectories);

            DateTime dt = new DateTime();

            dt = DateTime.Now;
            String dtString = dt.ToString();

            dtString = dtString.Replace("/", "_").Replace(":", "").Replace(" ", "");

            String fileList = "fileList" + dtString + ".csv";

            StreamWriter sr = new System.IO.StreamWriter(fileList);

            for (int i = 0; i < files.Length; i++)
            {
                FileInfo fio = new System.IO.FileInfo(files[i]);
                sr.WriteLine("," + fio.Directory + "," + fio.Name);
            }
            sr.Flush();
            sr.Close();

            BulkTransfer(fileList);
        }
示例#2
0
        private void Copy_Click(object sender, EventArgs e)
        {
            if (textBoxAWSVaultName.Text == String.Empty || textBoxAWSDynamoTableName.Text == String.Empty)
            {
                throw new Exception("textBoxAWSVaultName.Text ==String.Empty || textBoxAWSDynamoTableName.Text==String.Empty");
            }

            //AWS Requiers more than three charaters for a table name
            if (textBoxAWSDynamoTableName.Text.Length < 3)
            {
                throw new Exception("AWS Dynamo Requiers more than three charaters for a table name");
            }

            bool vaultExists = GalicierHelper.checkVault(textBoxAWSVaultName.Text);

            if (!vaultExists)
            {
                GalicierHelper.createVault(textBoxAWSVaultName.Text);
            }

            DynamoDBHelper.DynamoTableCheck(textBoxAWSDynamoTableName.Text);

            BulkTransfer(fileLogFileDialog.FileName);
        }