コード例 #1
0
ファイル: FileOp.cs プロジェクト: LightFreak/ZbW.Testing.Dms
 public FileOp()
 {
     _target    = Settings.Default.DefaultRepo;
     Destiny    = new FileServices();
     XmlService = new XmlService();
     Guid       = new FileNameGenerator();
 }
コード例 #2
0
 public DocumentService()
 {
     _targetPath = ConfigurationManager.AppSettings["FileRepoPath"];
     Directory.CreateDirectory(_targetPath);
     _fileService = new FileService();
     _xmlService  = new XmlService();
 }
コード例 #3
0
 public FileSystemService()
 {
     XmlService = new XmlService();
     FilenameGeneratorService = new FilenameGeneratorServiceService();
     DirectoryService         = new DirectoryService();
     GuidGeneratorService     = new GuidGeneratorService();
 }
コード例 #4
0
        public IList <IMetadataItem> LoadMetadata()
        {
            var metadataFile = GetAllFiles();
            var metadataList = XmlService.XmlToMetadataItems(metadataFile);

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