Here you can find the source of okayToOverwrite(Path file)
Parameter | Description |
---|---|
file | a parameter |
public static boolean okayToOverwrite(Path file)
//package com.java2s; import java.nio.file.*; public class Main { /**/* ww w. ja va 2 s.c om*/ * Returns {@code true} if okay to overwrite a file ("cp -i") * @param file * @return */ public static boolean okayToOverwrite(Path file) { String answer = System.console().readLine("overwrite %s (yes/no)? ", file); return (answer.equalsIgnoreCase("y") || answer.equalsIgnoreCase("yes")); } }