Exemple #1
0
 public FileOp()
 {
     _target    = Settings.Default.DefaultRepo;
     Destiny    = new FileServices();
     XmlService = new XmlService();
     Guid       = new FileNameGenerator();
 }
Exemple #2
0
 public DocumentService()
 {
     _targetPath = ConfigurationManager.AppSettings["FileRepoPath"];
     Directory.CreateDirectory(_targetPath);
     _fileService = new FileService();
     _xmlService  = new XmlService();
 }
Exemple #3
0
 public FileSystemService()
 {
     XmlService = new XmlService();
     FilenameGeneratorService = new FilenameGeneratorServiceService();
     DirectoryService         = new DirectoryService();
     GuidGeneratorService     = new GuidGeneratorService();
 }
Exemple #4
0
        public IList <IMetadataItem> LoadMetadata()
        {
            var metadataFile = GetAllFiles();
            var metadataList = XmlService.XmlToMetadataItems(metadataFile);

            return(metadataList);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 public DocumentService()
 {
     this._targePath   = ConfigurationManager.AppSettings["RepositoryDir"];
     this._fileService = new FileService();
     this._xmlService  = new XmlService();
 }
 public DocumentService()
 {
     _targetPath  = @"C:\Temp"; //System.Configuration.ConfigurationManager.AppSettings["RepositoryDir"]; (Wegen Unit Test)
     _fileService = new FileService();
     _xmlService  = new XmlService();
 }