()
| 263 | } |
| 264 | |
| 265 | private boolean isRoot() { |
| 266 | try (Stream<String> lines = Files.lines(Paths.get("/proc/self/status"))) { |
| 267 | return lines.anyMatch(s -> s.startsWith("Uid:") && s.matches("Uid:\\s+0\\s+0.*")); |
| 268 | } catch (IOException e) { |
| 269 | return false; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | @Override |
| 274 | public void close() { |