| 
What this is
 Other links
 The source code
/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */
package org.netbeans.modules.cvsclient;
/**
 * this fs is added just to make the deserialization from 3.2 possible
 * @author  Milos Kleint
 */
import java.io.*;
import org.openide.util.SharedClassObject;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
import org.openide.ErrorManager;
public class JavaCvsFileSystem extends NbJavaCvsFileSystem {
   static final long serialVersionUID = -5990750897426301780L;
    /** Creates new JavaCvsFileSystem */
    public JavaCvsFileSystem() {
        super();
    }
    private void readObject(ObjectInputStream in) throws
    ClassNotFoundException, IOException, NotActiveException {
        // cache is transient
        //        cache = new CvsFsCache(this);
        ObjectInputStream.GetField field = in.readFields();
        ObjectStreamField[] fields = field.getObjectStreamClass().getFields();
/*        for (int i = 0; i < fields.length; i++) {
            System.out.println("field=" + fields[i].getName());
        }
 */
        NbJavaCvsFileSystem.JavaCvsAttributes defAttr = null;
        if (fields.length > 0) {
            String systemName = getSystemName();
            this.setAutoRefresh(field.get("autoRefresh", 0)); // NOI18N
//            System.out.println("1=" + field.get("autoRefresh", 0));
            this.setDisplayType(field.get("displayType", 0)); // NOI18N
//            System.out.println("2="+field.get("displayType", 0));
            this.setOffLine(field.get("offLine", false)); // NOI18N
//            System.out.println("3="+field.get("offLine", false));
            this.setReadOnly(field.get("readOnly", false)); // NOI18N
//            System.out.println("4="+field.get("readOnly", false));
            setRefreshTimeToSet();
            this.setCvsServerType(field.get("serverType", 1)); // NOI18N
//            System.out.println("5="+field.get("serverType", 1));
            this.setUiMode(field.get("uiMode", 0)); // NOI18N
  //          System.out.println("6="+field.get("uiMode", 0));
            this.setZippedTransfer(field.get("zippedTransfer", false)); // NOI18N
//            System.out.println("7="+field.get("zippedTransfer", false));
            this.setWorkingDir(((File)field.get("workingDir", new File(System.getProperty("user.home"))))); // NOI18N
//            System.out.println("8="+field.get("workingDir", new File(System.getProperty("user.home"))));
            this.setRelMount((String)field.get("relMount", new String(""))); // NOI18N
//            System.out.println("9="+field.get("relMount", new String("")));
            this.setCvsRepository((String)field.get("repository", new String("/cvs"))); // NOI18N
//            System.out.println("10="+field.get("repository", new String("/cvs")));
            this.setCvsServerName((String)field.get("serverName", new String("localhost"))); // NOI18N
//            System.out.println("11="+field.get("serverName", new String("localhost")));
            status = new MyStatus();
//            System.out.println("12="+ status);
            this.setCvsUserName((String)field.get("userName", System.getProperty("user.name"))); // NOI18N
//            System.out.println("13="+field.get("userName", System.getProperty("user.name")));
//            System.out.println("rootFile=" + getRootDirectory());
            this.setCvsPort(org.netbeans.modules.javacvs.JavaCvsFileSystem.STANDARD_PORT);
            //        in.defaultReadObject();
            JavaCvsSettings settings = (JavaCvsSettings)SharedClassObject.findObject(
                                                JavaCvsSettings.class, true);             
            setHomeDirectory(settings.getHome());  
            initImpls();
            info = new NbInfoImpl();
            list = new NbListImpl();
            defAttr = new NbJavaCvsFileSystem.JavaCvsAttributes(info, change, list, FsCommandFactory.getFsInstance().getSupporter());
            
            attr = defAttr;
            list = defAttr;
            fsIgnoredFiles = "~$|^\\.#"; //NOI18N
            try {
                ignoredRE = new RE(fsIgnoredFiles);
            } catch (RESyntaxException rese) {
                ignoredRE = null;
            }            
            setCreateBackups(true);
//could be possible to place here in case it's needed            this.setFsIgnoredFiles("");
            if (systemName.endsWith("]")) {
                overrideSystemName(systemName);
            }
        }
        initCache();
        dependantInit();
        if (defAttr != null) {
            defAttr.setRuntimeProvider(new JavaCvsRuntimeCommandsProvider(this));
        }
    }
    
    private void overrideSystemName(String systemName) {
        try {
            setSystemName(systemName);
        } catch (java.beans.PropertyVetoException exc) {
            ErrorManager.getDefault().notify(exc);
        }
    }
    //-------------------------------------------
    private void writeObject(ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
    }
    
    public class ChangeImpl extends org.netbeans.modules.javacvs.JavaCvsFileSystem.ChangeImpl {
       static final long serialVersionUID = 1647280700071658302L;
    }
    
    public class ListImpl extends NbJavaCvsFileSystem.NbListImpl {
       static final long serialVersionUID = -102893327017356802L;
    }
    
    public class InfoImpl extends NbJavaCvsFileSystem.NbInfoImpl {
       static final long serialVersionUID = -627867218820299311L;
    }
}
 | 
| ... this post is sponsored by my books ... | |
         
           #1 New Release!  | 
      
         
           FP Best Seller  | 
  
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse 
URI on this website is
paid back to open source projects.