Click to See Complete Forum and Search --> : manipulating directories


champion
11-14-2001, 05:49 PM
I have a java servlet which is supposed to go into a certain directory called year which has a subdirectory dayOfYear. The dayOfyear directory has data files which are named from the first day of the year to 365 or 366 depending on if it is a leap year. This servlet is supposed to get all the years from the year directory and get all the dayOfYears from the dayOfYear directory and print out a certain year and all of its days. How would I be able to access these directories and files, manipulate there names as strings, and output a year and all of its days as a string.

TheLinuxDuck
11-14-2001, 06:15 PM
I don't know about servets, but applets don't allow access to the file system.

nanode
11-14-2001, 06:23 PM
I'm a servlet newbie, but will reply anyway. Since servlets run server side, they behave pretty much like any other java class.

As long as the server is being executed by a user (nobody in the case of tomcat/apache) who has read access to the directories you want, there should be no issue with reading those files.