1 6 7 package net.sourceforge.cvsgrab; 8 9 import java.io.BufferedOutputStream ; 10 import java.io.File ; 11 import java.io.FileOutputStream ; 12 import java.io.IOException ; 13 import java.io.OutputStream ; 14 import java.util.Properties ; 15 16 import org.netbeans.lib.cvsclient.admin.Entry; 17 import org.netbeans.lib.cvsclient.admin.StandardAdminHandler; 18 import org.netbeans.lib.cvsclient.command.GlobalOptions; 19 20 27 public class CVSGrabAdminHandler extends StandardAdminHandler { 28 29 private CVSGrab _cvsGrab; 30 31 34 public CVSGrabAdminHandler(CVSGrab cvsGrab) { 35 super(); 36 _cvsGrab = cvsGrab; 37 } 38 39 47 public void updateAdminData(String localDirectory, String repositoryPath, Entry entry, 48 GlobalOptions globalOptions) throws IOException { 49 super.updateAdminData(localDirectory, repositoryPath, entry, globalOptions); 50 51 final File CVSdir = new File (localDirectory, "CVS"); 53 File repositoryFile = new File (CVSdir, "WebRepository"); if (!repositoryFile.exists()) { 56 final Properties properties = new Properties (); 57 final OutputStream w = new BufferedOutputStream (new FileOutputStream (repositoryFile)); 58 _cvsGrab.getWebOptions().writeProperties(properties); 59 properties.put(CVSGrab.PACKAGE_PATH_OPTION, repositoryPath + "/"); 60 properties.store(w, "CVSGrab settings"); 61 w.close(); 62 } 63 64 } 65 66 } 67 | Popular Tags |