@Test public void toStringOfResources() { Resource resource = new Resource(); resource.setDirectory("/foo"); String string = MavenUtils.toString(ImmutableList.of(resource)); String[] resources = string.split(","); assertThat(resources).hasSize(1); Pattern pattern = Pattern.compile("(.*);(.*);(.*);"); Matcher matcher = pattern.matcher(resources[0]); assertThat(matcher.matches()); assertThat(matcher.groupCount()).isEqualTo(3); assertThat(matcher.group(1)).isEqualTo("/foo"); assertThat(matcher.group(2)).isEmpty(); assertThat(matcher.group(3)).isEqualTo("true"); Resource resource2 = new Resource(); resource2.setDirectory("/foo2"); resource2.setTargetPath("/bar2"); resource2.setFiltering("true"); string = MavenUtils.toString(ImmutableList.of(resource, resource2)); resources = string.split(","); assertThat(resources).hasSize(2); matcher = pattern.matcher(resources[0]); assertThat(matcher.matches()); assertThat(matcher.groupCount()).isEqualTo(3); assertThat(matcher.group(1)).isEqualTo("/foo"); assertThat(matcher.group(2)).isEmpty(); assertThat(matcher.group(3)).isEqualTo("true"); matcher = pattern.matcher(resources[1]); assertThat(matcher.matches()); assertThat(matcher.groupCount()).isEqualTo(3); assertThat(matcher.group(1)).isEqualTo("/foo2"); assertThat(matcher.group(2)).isEqualTo("/bar2"); assertThat(matcher.group(3)).isEqualTo("true"); }
protected static String toString(List<Resource> resources) { StringBuilder builder = new StringBuilder(); for (Resource resource : resources) { if (builder.length() == 0) { builder.append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } else { builder.append(",") .append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } } return builder.toString(); }
MavenUtils { protected static String toString(List<Resource> resources) { StringBuilder builder = new StringBuilder(); for (Resource resource : resources) { if (builder.length() == 0) { builder.append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } else { builder.append(",") .append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } } return builder.toString(); } }
MavenUtils { protected static String toString(List<Resource> resources) { StringBuilder builder = new StringBuilder(); for (Resource resource : resources) { if (builder.length() == 0) { builder.append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } else { builder.append(",") .append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } } return builder.toString(); }  }
MavenUtils { protected static String toString(List<Resource> resources) { StringBuilder builder = new StringBuilder(); for (Resource resource : resources) { if (builder.length() == 0) { builder.append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } else { builder.append(",") .append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } } return builder.toString(); }  static Properties getDefaultProperties(MavenProject currentProject); }
MavenUtils { protected static String toString(List<Resource> resources) { StringBuilder builder = new StringBuilder(); for (Resource resource : resources) { if (builder.length() == 0) { builder.append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } else { builder.append(",") .append(resource.getDirectory()) .append(";") .append(resource.getTargetPath() != null ? resource.getTargetPath() : "") .append(";") .append(resource.getFiltering() != null ? resource.getFiltering() : "true") .append(";"); } } return builder.toString(); }  static Properties getDefaultProperties(MavenProject currentProject); static final String MAVEN_SYMBOLICNAME; }