MCPcopy Create free account
hub / github.com/diffplug/goomph / readToken

Method readToken

src/main/java/com/diffplug/gradle/FileMisc.java:193–200  ·  view source on GitHub ↗

Returns the contents of a file with the given name, if it exists.

(File dir, String name)

Source from the content-addressed store, hash-verified

191
192 /** Returns the contents of a file with the given name, if it exists. */
193 public static Optional<String> readToken(File dir, String name) throws IOException {
194 File token = new File(dir, name);
195 if (!token.isFile()) {
196 return Optional.empty();
197 } else {
198 return Optional.of(FileUtils.readFileToString(token, StandardCharsets.UTF_8));
199 }
200 }
201
202 /** Writes an empty file with the given name in the given directory. */
203 public static void writeToken(File dir, String name) throws IOException {

Callers 3

hasTokenMethod · 0.95
isInstalledMethod · 0.95
WorkspaceRegistryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected