Skip navigation links
org.netbeans.lib.cvsclient

Class CVSRoot

    • Field Summary

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

      Constructors 
      Modifier Constructor and Description
      protected CVSRoot(Properties props)
      This constructor allows to construct CVSRoot from Properties object.
      protected CVSRoot(String cvsroot)
      Breaks the string representation of cvsroot into it's components: The valid format (from the cederqvist) is: :method:[[user][:password]@]hostname[:[port]]/path/to/repository Also parse alternative format from WinCVS, which stores connection parameters such as username and hostname in method options: :method[;option=arg...]:other_connection_data e.g.
    • Field Detail

      • METHOD_LOCAL

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

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

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

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

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

      • CVSRoot

        protected CVSRoot(String cvsroot)
                   throws IllegalArgumentException
        Breaks the string representation of cvsroot into it's components: The valid format (from the cederqvist) is: :method:[[user][:password]@]hostname[:[port]]/path/to/repository Also parse alternative format from WinCVS, which stores connection parameters such as username and hostname in method options: :method[;option=arg...]:other_connection_data e.g. :pserver;username=anonymous;hostname=localhost:/path/to/repository For CVSNT compatability it also supports following local repository path format driveletter:path\\path\\path
        Throws:
        IllegalArgumentException
    • Method Detail

      • 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 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 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(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 Object
      • hashCode

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

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

        protected void setMethod(String method)
        setting the method has effects on other components. The method might change - urlFormat - username and password - hostname/port If urlFormat becomes LOCAL_FORMAT then username, password and hostname are set to null and port to 0. If urlFormat becomes SERVER_FORMAT then hostname must not be null.
      • getUserName

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

        protected void setUserName(String username)
        Set the user name.
        Parameters:
        username - The user name.
      • getPassword

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

        public void setPassword(String password)
        Set the password.
        Parameters:
        password - The password
      • getHostName

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

        protected void setHostName(String hostname)
        Set the host name.
        Parameters:
        hostname - 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 String getRepository()
        Get the repository.
        Returns:
        The repository. This is never null.
      • setRepository

        protected void setRepository(String repository)
        Set the repository.
        Parameters:
        repository - The repository. Must not be null.

Copyright © 2016. All rights reserved.