docs: @SuppressWarnings("squid:S3725")
  	public static boolean delete(Path fileOrDirectory) throws IOException {
  		boolean deleted = false;
  
  		if (Files.exists(fileOrDirectory, LinkOption.NOFOLLOW_LINKS)) {
  			deleted = true;
  			if (Files.isDirectory(fileOrDirectory, LinkOption.NOFOLLOW_LINKS)) {
  				Files.walkFileTree(fileOrDirectory, new SimpleFileVisitor<Path>() {
  
  					@Override
  					public FileVisitResult visitFile(@Nullable Path file, @Nullable BasicFileAttributes attrs)
  							throws IOException {
  						Files.delete(file);
  						return FileVisitResult.CONTINUE;
  					}
  
  					@Override
  					public FileVisitResult postVisitDirectory(@Nullable Path dir, @Nullable IOException exc)
  							throws IOException {
  						if (exc != null) {
  							throw exc;
  						}
  						Files.delete(dir);
  						return FileVisitResult.CONTINUE;
  					}
  				});
  			} else {
  				Files.delete(fileOrDirectory);
  			}
  		}
  		return deleted;
  	}