Using java.io.File
:
File f = new File(filePathString);
if(f.exists() && !f.isDirectory()) {
// do something
}
More Related Contents:
- How to append text to an existing file in Java?
- How do I create a Java string from the contents of a file?
- How can I read a large text file line by line using Java?
- Modify the content of a file using Java
- Getting “java.nio.file.AccessDeniedException” when trying to write to a folder
- java IO to copy one File to another
- In Java, what is the default location for newly created files?
- Writing object in text file
- How to move elements of Java ArrayList to file in java [closed]
- How do I create a file and write to it?
- How to read a specific line using the specific line number from a file in Java?
- How to read a file from jar in Java?
- Reliable File.renameTo() alternative on Windows?
- Loading a text file into a textarea
- Check if file exists on remote server using its URL [duplicate]
- Writing a file to sdcard
- Java: CSV File Easy Read/Write
- Forward slash or backslash?
- Writing to console and text file
- Java scanner not going through entire file
- Why is using BufferedInputStream to read a file byte by byte faster than using FileInputStream?
- Read CSV file column by column
- What is InputStream & Output Stream? Why and when do we use them?
- Listing files in a directory matching a pattern in Java [duplicate]
- Java read file and store text in an array
- Whole text file to a String in Java
- Java OutOfMemoryError in reading a large text file
- Resetting Standard output Stream
- Read an Image/file from External storage Android
- Read large CSV in java