How to Check EPS Format in Java
If you have written a Java application that needs to validate the file extension of an uploaded file, you can do so by adding just a few lines of code to your application. The encapsulated postscript (.EPS) file extension is a graphical file format that's used to store image files such as logos, CAD draws and page layouts.
Instructions
-
-
1
Launch the code editing application you use to modify your Java code and load the code you need to modify.
-
2
Add the following two lines of code to initiate two different Java modules:
import java.io.*;
import javax.swing.*;
-
-
3
Instantiate Java's GetFileType class by using the following code:
class GetFileType {
public static void main(String[] args){
JFileChooser chooser = new JFileChooser();
File file = new File (".eps");
}
}
-
1