1 22 package org.netbeans.lib.cvsclient.response; 23 24 import java.io.*; 25 import java.util.*; 26 import java.text.*; 27 28 import org.netbeans.lib.cvsclient.admin.*; 29 import org.netbeans.lib.cvsclient.util.*; 30 31 36 class CheckedInResponse implements Response { 37 38 42 private DateFormat dateFormatter; 43 44 51 public void process(LoggedDataInputStream dis, ResponseServices services) 52 throws ResponseException { 53 try { 54 String localPath = dis.readLine(); 55 String repositoryPath = dis.readLine(); 57 String entriesLine = dis.readLine(); 59 final File theFile = new File(services.convertPathname(localPath, 64 repositoryPath)); 65 final Date date = new Date(theFile.lastModified()); 66 final Entry entry = new Entry(entriesLine); 67 entry.setConflict(getDateFormatter().format(date)); 68 69 if (entry.isNewUserFile() || 71 entry.isUserFileToBeRemoved()) { 72 entry.setConflict(Entry.DUMMY_TIMESTAMP); 73 } 74 75 services.setEntry(theFile, entry); 76 } 77 catch (IOException e) { 78 throw new ResponseException((Exception )e.fillInStackTrace(), e.getLocalizedMessage()); 79 } 80 } 81 82 87 public boolean isTerminalResponse() { 88 return false; 89 } 90 91 96 protected DateFormat getDateFormatter() { 97 if (dateFormatter == null) { 98 dateFormatter = new SimpleDateFormat(Entry.getLastModifiedDateFormatter().toPattern(), Locale.US); 99 dateFormatter.setTimeZone(Entry.getTimeZone()); 100 } 101 return dateFormatter; 102 } 103 104 } 105 | Popular Tags |