FoCorsFilter implements ContainerResponseFilter { List<String> parseCorsAllowedOrigins(String corsAllowedOriginsStr) { List<String> resultList = new ArrayList<>(); corsAllowedOriginsStr = StringUtils.trimToNull(corsAllowedOriginsStr); String[] originArray = StringUtils.split(corsAllowedOriginsStr, ";"); if(originArray == null || originArray.length == 0){ return resultList; } resultList = Arrays.asList(originArray).stream().map(o -> StringUtils.trimToNull(o)).filter(o -> o != null).collect(Collectors.toList()); return resultList; }  @Override void filter(ContainerRequestContext request,
			ContainerResponseContext response); @Value("${dollar}{corsAllowedOrigins}") void setCorsAllowedOrigins(String corsAllowedOriginsStr);  }
@Test public void testParseCorsAllowedOrigins() throws Exception { FoCorsFilter filter = new FoCorsFilter(); assertArrayEquals(new String[0], filter.parseCorsAllowedOrigins(" ").toArray()); assertArrayEquals(new String[]{"http: filter.parseCorsAllowedOrigins(" http: assertArrayEquals(new String[]{"*"}, filter.parseCorsAllowedOrigins(" * ").toArray()); }