Here you can find the source of fileExists(String path)
Parameter | Description |
---|---|
path | a parameter |
public static boolean fileExists(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*from www . j av a 2s . c o m*/ * Checks to see if the file or directory specified in the path actually * exists * * @param path * @return true if it does */ public static boolean fileExists(String path) { if (path.length() > 0) { if ((new File(path)).exists()) { return true; } else { return false; } } else { return false; } } }