I have a basic program that deletes a file. The problem I'm having is passing
the file name to the class. I've tried putting the file in the same directory
as the program, adding the full path to the file and putting it in the root
directory but neither worked. The class is able to read in the file name
but when it gets to the Delete method an exception is thrown when it tries
to create a new file object. I assume I'm not passing the parameter correctly.
Any help would be greatly appreciated.
Regards
Andrew

import java.io.*;

public class Delete {
public static void main(String[] args){
if(args.length != 1){
System.err.print("Usage: java Delete <file or directory>");
System.exit(0);
}

try{ Delete(args[0]); }
catch(IllegalArgumentException e){
System.err.print(e.getMessage());
}
}//end main

public static void Delete(String filename){
//create a file object to represent the file name
File f = new File(filename); /**ERROR HERE**/