org.netbeans.lib.cvsclient

Class CVSRoot

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String METHOD_EXT
      A constant representing the "ext" connection method.
      static java.lang.String METHOD_FORK
      A constant representing the "fork" connection method.
      static java.lang.String METHOD_LOCAL
      A constant representing the "local" connection method.
      static java.lang.String METHOD_PSERVER
      A constant representing the "pserver" connection method.
      static java.lang.String METHOD_SERVER
      A constant representing the "server" connection method.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o)
      CVSRoots are equal if their toString representations are equal.
      int getCompatibilityLevel(CVSRoot compared)
      With this method it is possible to compare how close two CVSRoots are to each other.
      java.lang.String getHostName()
      Get the host name.
      java.lang.String getMethod()
      Get the connection method.
      java.lang.String getPassword()
      Get the password.
      int getPort()
      Get the port number.
      java.lang.String getRepository()
      Get the repository.
      java.lang.String getUserName()
      Get the user name.
      int hashCode() 
      boolean isLocal()
      Test whether this cvsroot describes a local connection or remote connection.
      static CVSRoot parse(java.util.Properties props)
      Construct CVSRoot from Properties object.
      static CVSRoot parse(java.lang.String cvsroot)
      Parse the CVSROOT string into CVSRoot object.
      void setPort(int port)
      Set the port number.
      java.lang.String toString()
      LOCAL_FORMAT --> :method:/reposi/tory
      "no method" is always represented internally as null SERVER_FORMAT --> :method:user@hostname:[port]/reposi/tory
      Password is never included in cvsroot string representation.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • METHOD_LOCAL

        public static final java.lang.String METHOD_LOCAL
        A constant representing the "local" connection method.
        See Also:
        Constant Field Values
      • METHOD_FORK

        public static final java.lang.String METHOD_FORK
        A constant representing the "fork" connection method.
        See Also:
        Constant Field Values
      • METHOD_SERVER

        public static final java.lang.String METHOD_SERVER
        A constant representing the "server" connection method.
        See Also:
        Constant Field Values
      • METHOD_PSERVER

        public static final java.lang.String METHOD_PSERVER
        A constant representing the "pserver" connection method.
        See Also:
        Constant Field Values
      • METHOD_EXT

        public static final java.lang.String METHOD_EXT
        A constant representing the "ext" connection method.
        See Also:
        Constant Field Values
    • Method Detail

      • parse

        public static CVSRoot parse(java.lang.String cvsroot)
                             throws java.lang.IllegalArgumentException
        Parse the CVSROOT string into CVSRoot object. The CVSROOT string must be of the form [:method:][[user][:password]@][hostname:[port]]/path/to/repository
        Throws:
        java.lang.IllegalArgumentException
      • parse

        public static CVSRoot parse(java.util.Properties props)
                             throws java.lang.IllegalArgumentException
        Construct CVSRoot from Properties object. The names are exactly the same as the attribute names in this class.
        Throws:
        java.lang.IllegalArgumentException
      • isLocal

        public boolean isLocal()
        Test whether this cvsroot describes a local connection or remote connection. The connection is local if and only if the host name is null. E.g. for local or fork methods.
      • toString

        public java.lang.String toString()
        • LOCAL_FORMAT --> :method:/reposi/tory
          "no method" is always represented internally as null
        • SERVER_FORMAT --> :method:user@hostname:[port]/reposi/tory
          Password is never included in cvsroot string representation. Use getPassword to get it.
        Overrides:
        toString in class java.lang.Object
      • getCompatibilityLevel

        public int getCompatibilityLevel(CVSRoot compared)

        With this method it is possible to compare how close two CVSRoots are to each other. The possible values are:

        • -1 = not compatible - if none of the below match
        • 0 = when equals(..) returns true
        • 1 = refers to same repository on the same machine using same method on same port and same user
        • 2 = refers to same repository on the same machine using same method
        • 3 = refers to same repository on the same machine
      • equals

        public boolean equals(java.lang.Object o)
        CVSRoots are equal if their toString representations are equal. This puts some extra pressure on the toString method that should be defined very precisely.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getMethod

        public java.lang.String getMethod()
        Get the connection method.
        Returns:
        The connection method or null when no method is defined.
      • getUserName

        public java.lang.String getUserName()
        Get the user name.
        Returns:
        The user name or code>null when the user name is not defined.
      • getPassword

        public java.lang.String getPassword()
        Get the password.
        Returns:
        The password or null when the password is not defined.
      • getHostName

        public java.lang.String getHostName()
        Get the host name.
        Returns:
        The host name or null when the host name is not defined
      • getPort

        public int getPort()
        Get the port number.
        Returns:
        The port number or zero when the port is not defined.
      • setPort

        public void setPort(int port)
        Set the port number.
        Parameters:
        port - The port number or zero when the port is not defined.
      • getRepository

        public java.lang.String getRepository()
        Get the repository.
        Returns:
        The repository. This is never null.