예제 #1
0
        /// <summary>
        /// Fetch the entries from the cvs file located in the subdirectory of
        ///     the path given.
        /// </summary>
        /// <param name="fullPath">The path of the files that are being managed, 
        ///     the cvs directory is derived from this.</param>
        /// <returns>A collection of entries from the cvs management file.</returns>
        public Entries FetchEntries (String fullPath) {
            DirectoryInfo cvsPath = new DirectoryInfo(fullPath);
            FileInfo cvsFile = new FileInfo(fullPath);

            if (cvsFile.Name != Entry.FILE_NAME) {
                LOGGER.Warn("Full path not passed in, search other directory.");
                cvsFile = new FileInfo(Path.Combine(cvsFile.FullName, Entry.FILE_NAME));
            }

            ICollection cvsFiles = 
                this.ReadFromFile(cvsFile);

            Entries entries = new Entries();
            foreach (DictionaryEntry entryEntry in cvsFiles) {
                Entry entry = (Entry)entryEntry.Value;
                if (!entries.Contains(entry.Key)) {
                    entries.Add(entry.Key, entry); 
                }
            }
            return entries;
        }
예제 #2
0
 /// <summary>
 /// Create a new instance of the folders object.  Initialize the entries 
 ///     collection.
 /// </summary>
 public Folder () {
     this.entries = new Entries();
 }
예제 #3
0
 /// <summary>
 /// Write the collection of entries to the file system.
 /// </summary>
 /// <param name="entries">A collection of entries that needs to be
 ///     persisted.</param>
 private void WriteToFile (Entries entries) {
     this.WriteToFile ((ICvsFile[])(
         new ArrayList(entries.Values)).ToArray(typeof(ICvsFile)));
 }