mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-422: Update comments and internals of protocol methods.
This commit is contained in:
		| @@ -152,7 +152,8 @@ public class GuacamoleClientInformation { | ||||
|      | ||||
|     /** | ||||
|      * Return the timezone as reported by the client, or null if the timezone | ||||
|      * is not set.  Valid timezones are specified in tz database format. | ||||
|      * is not set.  Valid timezones are specified in IANA zone key format, | ||||
|      * also known as Olson time zone database or TZ Database. | ||||
|      *  | ||||
|      * @return | ||||
|      *     A string value of the timezone reported by the client. | ||||
| @@ -163,8 +164,8 @@ public class GuacamoleClientInformation { | ||||
|      | ||||
|     /** | ||||
|      * Set the string value of the timezone, or null if the timezone will not | ||||
|      * be provided by the client.  Valid timezones are specified in tz | ||||
|      * database format. | ||||
|      * be provided by the client.  Valid timezones are specified in IANA zone | ||||
|      * key format (aka Olson time zone database or tz database). | ||||
|      *  | ||||
|      * @param timezone | ||||
|      *     The string value of the timezone reported by the client, in tz | ||||
|   | ||||
| @@ -120,36 +120,16 @@ public enum GuacamoleProtocolVersion { | ||||
|      */ | ||||
|     public boolean atLeast(GuacamoleProtocolVersion otherVersion) { | ||||
|          | ||||
|         // Major version is greater | ||||
|         if (major > otherVersion.getMajor()) | ||||
|             return true; | ||||
|         // If major is not the same, compare first | ||||
|         if (major != otherVersion.getMajor()) | ||||
|             return major > otherVersion.getMajor(); | ||||
|          | ||||
|         // Major version is less than or equal to. | ||||
|         else { | ||||
|              | ||||
|             // Major version is less than | ||||
|             if (major < otherVersion.getMajor()) | ||||
|                 return false; | ||||
|              | ||||
|             // Major version is equal, minor version is greater | ||||
|             if (minor > otherVersion.getMinor()) | ||||
|                 return true; | ||||
|              | ||||
|             // Minor version is less than or equal to. | ||||
|             else { | ||||
|                  | ||||
|                 // Minor version is less than | ||||
|                 if (minor < otherVersion.getMinor()) | ||||
|                     return false; | ||||
|                  | ||||
|                 // Patch version is greater or equal | ||||
|                 if (patch >= otherVersion.getPatch()) | ||||
|                     return true; | ||||
|             } | ||||
|         } | ||||
|         // Major is the same, but minor is not, so compare minor versions | ||||
|         if (minor != otherVersion.getMinor()) | ||||
|             return minor > otherVersion.getMinor(); | ||||
|          | ||||
|         // Version is either less than or equal to. | ||||
|         return false; | ||||
|         // Major and minor are identical, so compare and return patch | ||||
|         return patch >= otherVersion.getPatch(); | ||||
|          | ||||
|     } | ||||
|      | ||||
| @@ -162,14 +142,21 @@ public enum GuacamoleProtocolVersion { | ||||
|      *     The String format of the version to parse. | ||||
|      *  | ||||
|      * @return | ||||
|      *     The enum value that matches the specified version. | ||||
|      *     The enum value that matches the specified version, VERSION_1_0_0 | ||||
|      *     if no match is found, or null if no comparison version is provided. | ||||
|      */ | ||||
|     public static GuacamoleProtocolVersion getVersion(String version) { | ||||
|          | ||||
|         if (version == null || version.isEmpty()) | ||||
|             return null; | ||||
|          | ||||
|         return valueOf(version); | ||||
|         try { | ||||
|             return valueOf(version); | ||||
|         } | ||||
|         // If nothing matches, then return the most compatible version. | ||||
|         catch (IllegalArgumentException e) { | ||||
|             return GuacamoleProtocolVersion.VERSION_1_0_0; | ||||
|         } | ||||
|          | ||||
|     } | ||||
|      | ||||
|   | ||||
		Reference in New Issue
	
	Block a user