@Test public void shouldReturnExternalPathForHttpReference() { String ref = "http: Optional<String> externalPath = RefUtils.getExternalPath(ref); assertThat(externalPath.isPresent(), is(true)); assertThat(externalPath.get(), equalTo("http: }
public static Optional<String> getExternalPath(String ref) { if (ref == null) { return Optional.empty(); } return Optional.of(ref.split(REFERENCE_SEPARATOR)) .filter(it -> it.length == 2) .map(it -> it[0]) .filter(it -> !it.isEmpty()); }
RefUtils { public static Optional<String> getExternalPath(String ref) { if (ref == null) { return Optional.empty(); } return Optional.of(ref.split(REFERENCE_SEPARATOR)) .filter(it -> it.length == 2) .map(it -> it[0]) .filter(it -> !it.isEmpty()); } }
RefUtils { public static Optional<String> getExternalPath(String ref) { if (ref == null) { return Optional.empty(); } return Optional.of(ref.split(REFERENCE_SEPARATOR)) .filter(it -> it.length == 2) .map(it -> it[0]) .filter(it -> !it.isEmpty()); } private  RefUtils(); }
RefUtils { public static Optional<String> getExternalPath(String ref) { if (ref == null) { return Optional.empty(); } return Optional.of(ref.split(REFERENCE_SEPARATOR)) .filter(it -> it.length == 2) .map(it -> it[0]) .filter(it -> !it.isEmpty()); } private  RefUtils(); static String computeDefinitionName(String ref); static Optional<String> getExternalPath(String ref); static boolean isAnExternalRefFormat(RefFormat refFormat); static RefFormat computeRefFormat(String ref); static String mungedRef(String refString); static String readExternalUrlRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                            String rootPath); static String readExternalClasspathRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                                  String rootPath); static String buildUrl(String rootPath, String relativePath); static String readExternalRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                         Path parentDirectory); }
RefUtils { public static Optional<String> getExternalPath(String ref) { if (ref == null) { return Optional.empty(); } return Optional.of(ref.split(REFERENCE_SEPARATOR)) .filter(it -> it.length == 2) .map(it -> it[0]) .filter(it -> !it.isEmpty()); } private  RefUtils(); static String computeDefinitionName(String ref); static Optional<String> getExternalPath(String ref); static boolean isAnExternalRefFormat(RefFormat refFormat); static RefFormat computeRefFormat(String ref); static String mungedRef(String refString); static String readExternalUrlRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                            String rootPath); static String readExternalClasspathRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                                  String rootPath); static String buildUrl(String rootPath, String relativePath); static String readExternalRef(String file, RefFormat refFormat, List<AuthorizationValue> auths,
                                         Path parentDirectory);  }