here's a simple layout of my structure -src - file A - directory A - file B - file C -build -WebContent - META-INF - WEB-INF
my question is how do i determine if "file A" is a file or a directory. if I do: File file = new File("file A"); a file will be created in a different directory on my local harddrive, I guess what I am trying to say is how can I get to a file under my src directory.
A File is just "An abstract representation of file and directory pathnames." Creating a new File object does not create a new file.
If you're trying to determine whether something under SRC is a directory, here's a basic approach: Create a File object to represent the SRC directory by passing the SRC path to the File constructor. Then call listFiles() on that File object to get a File array representing all of the files and directories in SRC. Then iterate through this array, calling getName() to get the names, and isDirectory() to determine whether these represent directories.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org