com.microsoft.tfs.core.util
Class ServerURIComparator

java.lang.Object
  extended by com.microsoft.tfs.core.util.ServerURIComparator
All Implemented Interfaces:
java.util.Comparator<java.net.URI>

public class ServerURIComparator
extends java.lang.Object
implements java.util.Comparator<java.net.URI>

Compares URIs for TFS servers. The comparison is a case-insensitive string match on partially normalized URI strings for consistency with TFS connection behavior in other clients (Visual Studio).

The following normalization actions are done (in the specified order) to each URI before comparison:

  1. if the path part is null or empty, the path part is treated as "/". "http://server:8080" turns into "http://server:8080/"
  2. if the path part is longer than one character and ends in a slash, the trailing slash is removed. "http://server:8080/tfs/" turns into "http://server:8080/tfs"


Field Summary
static ServerURIComparator INSTANCE
           
 
Constructor Summary
ServerURIComparator()
           
 
Method Summary
 int compare(java.net.URI uri1, java.net.URI uri2)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

INSTANCE

public static final ServerURIComparator INSTANCE
Constructor Detail

ServerURIComparator

public ServerURIComparator()
Method Detail

compare

public int compare(java.net.URI uri1,
                   java.net.URI uri2)

Specified by:
compare in interface java.util.Comparator<java.net.URI>


© 2015 Microsoft. All rights reserved.