1 19 20 package org.netbeans.lib.cvsclient.response; 21 22 import java.io.*; 23 24 import org.netbeans.lib.cvsclient.util.*; 25 26 30 31 class SetStickyResponse implements Response { 32 33 40 public void process(LoggedDataInputStream dis, ResponseServices services) 41 throws ResponseException { 42 PrintWriter w = null; 43 try { 44 String localPath = dis.readLine(); 45 46 String repositoryPath = dis.readLine(); 47 String tag = dis.readLine(); 48 String absPath = services.convertPathname(localPath, repositoryPath); 51 52 if (services.getGlobalOptions().isExcluded(new File(absPath))) { 53 return; 54 } 55 56 absPath = absPath + "/CVS"; File absFile = new File(absPath); 58 if (absFile.exists()) { 59 File tagFile = new File(absPath, "Tag"); if ("THEAD".equals(tag) | "NHEAD".equals(tag) ) { tagFile.delete(); 62 } else { 63 w = new PrintWriter( 64 new BufferedWriter(new FileWriter(tagFile))); 65 w.println(tag); 67 } 68 } 69 } 70 catch (IOException e) { 71 throw new ResponseException(e); 72 } finally { 73 if (w != null) { 74 w.close(); 75 } 76 } 77 } 78 79 84 public boolean isTerminalResponse() { 85 return false; 86 } 87 } 88 | Popular Tags |