using System;
using System.IO;
using System.Reflection;

namespace uri_import.FClasses
{
    public class FileActions
    {
        public static string ExecFile
        {
            get
            {
                string execFile = Assembly.GetExecutingAssembly().Location;
                if (execFile.Contains("\\"))
                    execFile = execFile.Substring(0, execFile.LastIndexOf("\\"));
                else
                    execFile = execFile.Substring(0, execFile.LastIndexOf("/"));
                return execFile;
            }
        }
        public static string Attachments { get; set; }
        public static string Logs { get; set; }
        public static string Successes { get; set; }
        public static string Failures { get; set; }
        public static void MakeDirectories()
        {

            Attachments = Path.Combine(ExecFile, "attachments");
            Logs = Path.Combine(ExecFile, "logs");
            Successes = Path.Combine(ExecFile, "successes");
            Failures = Path.Combine(ExecFile, "failures");
            if (!Directory.Exists(Attachments)) Directory.CreateDirectory(Attachments);
            if (!Directory.Exists(Logs)) Directory.CreateDirectory(Logs);
            if (!Directory.Exists(Successes)) Directory.CreateDirectory(Successes);
            if (!Directory.Exists(Failures)) Directory.CreateDirectory(Failures);
        }
    }
}