@Test public void isValidWorkspaceRoot() { assertThat(ServerConfiguration.isValidWorkspaceRoot(getCWD().getAbsolutePath()), is(true)); assertThat("file URI deemed invalid", ServerConfiguration.isValidWorkspaceRoot(URI.createFileURI(getCWD().getAbsolutePath()).toString()), is(true)); assertThat("relative path deemed invalid", ServerConfiguration.isValidWorkspaceRoot("."), is(true)); String bogusPath = new File(getCWD(), "$this$/cannot/likely/exist").getAbsolutePath(); assertThat("non-existent path deemed valid", ServerConfiguration.isValidWorkspaceRoot(bogusPath), is(false)); }
public static boolean isValidWorkspaceRoot(final String fileUrl) { return toFilePath(fileUrl).map(uri -> new File(uri.toFileString()).exists()).orElse(false); }
ServerConfiguration { public static boolean isValidWorkspaceRoot(final String fileUrl) { return toFilePath(fileUrl).map(uri -> new File(uri.toFileString()).exists()).orElse(false); } }
ServerConfiguration { public static boolean isValidWorkspaceRoot(final String fileUrl) { return toFilePath(fileUrl).map(uri -> new File(uri.toFileString()).exists()).orElse(false); }  }
ServerConfiguration { public static boolean isValidWorkspaceRoot(final String fileUrl) { return toFilePath(fileUrl).map(uri -> new File(uri.toFileString()).exists()).orElse(false); }  URI getWorkspaceRootURI(); void setWorkspaceRootURI(final URI uri); String getWorkspaceRoot(); void setWorkspaceRoot(final String workspaceRoot); Set<String> getWorkspaceEntries(); int getServerPort(); void setServerPort(final int serverPort); static boolean isValidWorkspaceRoot(final String fileUrl); static boolean isValidPort(final Integer port); }
ServerConfiguration { public static boolean isValidWorkspaceRoot(final String fileUrl) { return toFilePath(fileUrl).map(uri -> new File(uri.toFileString()).exists()).orElse(false); }  URI getWorkspaceRootURI(); void setWorkspaceRootURI(final URI uri); String getWorkspaceRoot(); void setWorkspaceRoot(final String workspaceRoot); Set<String> getWorkspaceEntries(); int getServerPort(); void setServerPort(final int serverPort); static boolean isValidWorkspaceRoot(final String fileUrl); static boolean isValidPort(final Integer port);  }