MCPcopy Create free account
hub / github.com/apache/solr / sameUser

Method sameUser

solr/core/src/java/org/apache/solr/cli/AssertTool.java:347–358  ·  view source on GitHub ↗
(String directory)

Source from the content-addressed store, hash-verified

345 }
346
347 public static int sameUser(String directory) throws Exception {
348 Path path = Path.of(directory);
349 if (Files.exists(path)) {
350 String userForDir = userForDir(path);
351 if (!currentUser().equals(userForDir)) {
352 return exitOrException("Must run as user " + userForDir + ". We are " + currentUser());
353 }
354 } else {
355 return exitOrException("Directory " + directory + " does not exist.");
356 }
357 return 0;
358 }
359
360 public static int assertFileExists(String directory) throws Exception {
361 if (!Files.exists(Path.of(directory))) {

Callers 1

runAssertMethod · 0.95

Calls 6

userForDirMethod · 0.95
currentUserMethod · 0.95
exitOrExceptionMethod · 0.95
existsMethod · 0.65
ofMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected