Javadoc comments help

Hello, this code is one method in my application. Could someone please check that the Javadoc comments look right and the general comments are the right format i.e. should it be like // Text or /* Text */.

Ive looked at the Javadoc tutorial and have used it to write what I have so far. If there are mistakes or if there is anything missing please say.

Once I know the correct way I can use this on the rest of my methods.

Thanks anyone

/**

* This method takes all of the files in the files array and then checks to see if

* they are to be archived (if lastMod is before archive time) or copied (if lastMod

* is after copy time). Files to be archived or copied have their names written to

* a log (either archive.txt or copy.txt).

*

* @param filesThe array (of type File) of files with the specified (on command line)

*extensions.

* @param archive Getting the archive limit from the main method (Calendar type).

* @param copyGetting the copy limit from the main method (Calendar type).

* @throws FileNotFoundException if the file is not found.

* @throws IOException if there is an input/output exception.

*/

privatestaticvoid log(File[] files, Calendar archive, Calendar copy)

{

PrintStream archivePS =null;

PrintStream copyPS =null;

try

{

archivePS =new PrintStream("archive.txt");

copyPS =new PrintStream("copy.txt");

for(int j = 0; j < files.length; j++)

{

// get last modified time of file

long lastModified = files[j].lastModified();

// convert lastModified to a date

Date lastMod =new Date(lastModified);

// write file path to "archive.txt"

// if lastMod is before archive time

if(lastMod.before(archive.getTime()))

{

archivePS.println(files[j].getPath());

}

// write file path to "copy.txt"

// if lastMod is after copy time

if(lastMod.after(copy.getTime()))

{

copyPS.println(files[j].getPath());

}

}

// close print streams

archivePS.close();

copyPS.close();

}

catch(FileNotFoundException fnfe)

{

System.err.println("Log error: " + fnfe.getMessage());

}

catch(IOException ioe)

{

System.err.println("I/O exception: " + ioe.getMessage());

}

}

[3644 byte] By [John4938a] at [2007-10-2 16:10:20]
# 1
The Javadoc tool doesn't care too much about the way you format the comments. As to whether it's right: Run it through Javadoc & see if it gives you what you want!
Dick_Adamsa at 2007-7-13 16:54:16 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...