Merge changes from patch branch back to main.

This commit is contained in:
Michael Jumper committed 2025-05-29 16:34:26 -07:00
commit 511ef7c6b5
8 files changed
+60 -9

No files matched your search

@@ -23,6 +23,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
/**
@@ -30,6 +31,14 @@ import org.apache.guacamole.GuacamoleException;
*/
public abstract class FileGuacamoleProperty implements GuacamoleProperty<File> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
@Override
public File parseValue(String value) throws GuacamoleException {
@@ -21,7 +21,6 @@ package org.apache.guacamole.properties;
import java.util.Collection;
import java.util.Collections;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
/**
@@ -33,14 +32,6 @@ import org.apache.guacamole.GuacamoleException;
*/
public interface GuacamoleProperty<Type> {
/**
* A pattern which matches against the delimiters between values. This is
* currently simply a semicolon and any following whitespace. Parts of the
* input string which match this pattern will not be included in the parsed
* result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile(";\\s*");
/**
* Returns the name of the property in guacamole.properties that this
* GuacamoleProperty will parse.
@@ -22,6 +22,7 @@ package org.apache.guacamole.properties;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
@@ -30,6 +31,14 @@ import org.apache.guacamole.GuacamoleServerException;
*/
public abstract class IntegerGuacamoleProperty implements GuacamoleProperty<Integer> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
@Override
public Integer parseValue(String value) throws GuacamoleException {
@@ -22,6 +22,7 @@ package org.apache.guacamole.properties;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
@@ -30,6 +31,14 @@ import org.apache.guacamole.GuacamoleServerException;
*/
public abstract class LongGuacamoleProperty implements GuacamoleProperty<Long> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
@Override
public Long parseValue(String value) throws GuacamoleException {
@@ -21,6 +21,7 @@ package org.apache.guacamole.properties;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
/**
@@ -28,6 +29,14 @@ import org.apache.guacamole.GuacamoleException;
*/
public abstract class StringGuacamoleProperty implements GuacamoleProperty<String> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
@Override
public String parseValue(String value) throws GuacamoleException {
return value;
@@ -39,6 +39,14 @@ import org.apache.guacamole.GuacamoleException;
@Deprecated
public abstract class StringListProperty implements GuacamoleProperty<List<String>> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
@Override
public List<String> parseValue(String values) throws GuacamoleException {
@@ -33,6 +33,14 @@ import org.apache.guacamole.GuacamoleServerException;
public abstract class TimeZoneGuacamoleProperty
implements GuacamoleProperty<TimeZone> {
/**
* A pattern which matches against the delimiters between values. This is
* currently either a comma or a semicolon and any following whitespace.
* Parts of the input string which match this pattern will not be included
* in the parsed result.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("[,;]\\s*");
/**
* A regex that matches valid variants of GMT timezones.
*/
@@ -24,6 +24,7 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
@@ -32,6 +33,13 @@ import org.apache.guacamole.GuacamoleServerException;
*/
public abstract class URIGuacamoleProperty implements GuacamoleProperty<URI> {
/**
* A pattern which matches against the delimiters between values. For the
* URIGuacamoleProperty, this is set to one or more spaces, as commas and
* semicolons are valid in URIs while white space is not.
*/
static final Pattern DELIMITER_PATTERN = Pattern.compile("\\s+");
@Override
public URI parseValue(String value) throws GuacamoleException {