File file = null;
String directory = "/Users/Chris/Documents/Sites/gmustudent/WebContent/images/test/";
file = new File(directory + imageName);
file.createNewFile();
The code above does effectively create a new file in the directory I want with the name I want. And after I run it I can go to that path on my computer and the images will be there. But the images will not be visible in eclipse. After I run this code the directory looks like this

So I can view the images in the directory in my computer but eclipse does not see them yet. So then I right click my project and click refresh…

And then my directory is refreshed…

So when I try to access the images I just uploaded in my web app I can’t see them until I refresh my entire web app.
UPDATE
This is an issue b/c I need to access these files through their path online. like htttp://localhost:8086/gmustudent/images/test/image.png. I can’t do this until I refresh the web app which is the problem. So when I try and access the images after upload I can’t see them until I refresh the eclipse project.
In newer versions of Eclipse, there’s a Workspace preference called “Refresh using native hooks or polling.”
This has potential to slow Eclipse and/or your system down if it needs to read a slow (say, non-SSD) disk and/or many directories/files. This help doc hints that the native hooks only work on Windows versions of Eclipse, implying that Linux & Mac versions will use polling, which will likely be less efficient.
Give it a shot; YMMV.