Java File Exist FileExists(String fileName)

Here you can find the source of FileExists(String fileName)

Description

File Exists

License

Open Source License

Declaration

public static boolean FileExists(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static boolean FileExists(String fileName) {
        return (new File(fileName).exists());
    }//from   w w w .  j a v a2 s .c o  m

    /**
     * Checks if an element exists in a given array.
     * @param array the array to search within
     * @param element the element we want to search for
     * @param <T> the generic type.
     * @return true if the given element exists in the array.
     */
    public static <T> boolean exists(List<T> array, T element) {
        for (T currentElement : array) {
            if (element.equals(currentElement))
                return true;
        }
        return false;
    }
}

Related

  1. fileExists(final String pathname)
  2. fileExists(String absolutePathAndFileName)
  3. fileExists(String aFilename)
  4. fileExists(String file)
  5. FileExists(String file)
  6. fileExists(String filename)
  7. fileExists(String filename)
  8. fileExists(String filename)
  9. FileExists(String filename)