1 19 20 27 package org.netbeans.nbbuild.utils.cvsutils; 28 29 import java.io.*; 30 import java.util.*; 31 32 40 41 public class CvsEntries { 42 43 private java.util.HashMap <String , Entry> hash = new java.util.HashMap <String , Entry>(); 44 private static final String DEFAULT_CVS_ENTRIES_FILENAME = "CVS/Entries"; 45 46 public CvsEntries(String directoryPath) { 48 this(directoryPath, DEFAULT_CVS_ENTRIES_FILENAME); 49 } 50 51 52 public CvsEntries(String directoryPath, String fileName) { 53 try { 54 String entriesFile = directoryPath + "/" + fileName; 55 BufferedReader inBuff = new BufferedReader(new FileReader(new File(entriesFile))); 56 Entry e; 57 58 String line; 59 60 while ((line = inBuff.readLine()) != null) { 61 e = new Entry(line); 62 if ( ! e.getFiletype().equals("D") ) { 63 hash.put(e.getFilename(), e); 64 } 65 } 66 67 } catch(IOException e) { 68 System.out.println("Error: " + e.toString()); 69 } 70 } 71 72 public String getRevnoByFileName(String fileName) { 73 Entry e = hash.get(fileName); 74 if (e == null ) { 75 return null; 76 } else { 77 return e.getRevno(); 78 } 79 } 80 } 81 | Popular Tags |