Here you can find the source of ensureExists(File file)
public static void ensureExists(File file)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**//from w w w .ja va 2s . co m * throws {@link RuntimeException} if file does not exist */ public static void ensureExists(File file) { if (!file.exists()) { throw new RuntimeException("File '" + file.getAbsolutePath() + "' does not exist."); } } }