public FileSystemService()
 {
     XmlService = new XmlService();
     FilenameGeneratorService = new FilenameGeneratorService();
     DirectoryService         = new DirectoryService();
     GuidGeneratorService     = new GuidGeneratorService();
 }
        public void AddFile(IMetadataItem metadataItem, bool isRemoveFileEnabled, string sourcePath)
        {
            MetaDataIteam = metadataItem;

            var documentId = GuidGeneratorService.GetNewGuid();
            var extension  = DirectoryService.GetExtension(sourcePath);

            MetaDataIteam.ContentFilename  = FilenameGeneratorService.GetContentFilename(documentId, extension);
            MetaDataIteam.MetadataFilename = FilenameGeneratorService.GetMetadataFilename(documentId);

            var targetDir = DirectoryService.Combine(TargetPath, MetaDataIteam.ValutaYear);

            MetaDataIteam.OrginalPath          = sourcePath;
            MetaDataIteam.PathInRepo           = targetDir + @"\" + MetaDataIteam.ContentFilename;
            MetaDataIteam.ContentFileExtension = extension;
            MetaDataIteam.ContentFilename      = MetaDataIteam.ContentFilename;
            MetaDataIteam.DocumentId           = documentId;

            DirectoryService.CreateDirectoryFolder(targetDir);

            XmlService.MetadataItemToXml(MetaDataIteam, targetDir);
            DirectoryService.DeleteFile(MetaDataIteam, isRemoveFileEnabled);
        }