Problem with Adding Files
saad tawwab <[email protected]> Sat, 6 Jul 2002 21:44:20 +0500
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Message-ID | <1116E95CE267D211929700C0F0313C3E20D94F@JOHNYQUEST> |
Hello!!
I want to Add files to a CVS Repository using the AddCommand. But the
method addRequests has protected context and cannot be accessed via an
instance of the class. I also tried to create a sub-class that inherited
from AddCommand class. But when I called the addRequests method I got a
StackOverflow error. I would be obliged if anybody could point out the
manner in which the AddCommand can be used correctly.
Regards,
Saad Tawwab
Code for my Wrapper Class.
public class TestAddCommand extends AddCommand {
public TestAddCommand() {
}
public void addRequests(File file){
this.addRequests(file);
}
}
Code invoking the AddCommand.
TestAddCommand command = new TestAddCommand();
command.setBuilder(null);
File tempFile = new File("c:\\sandbox\\buttx");
File[] files = new File[1];
files[0]=tempFile;
command.setFiles(files);
command.addRequests(new File("saad.html"));
try{
client.executeCommand(command, globalOptions);
}
catch(CommandAbortedException cae){
System.out.println("Inside CommandAbortedException");
}
catch(CommandException ce){
System.out.println("Inside CommandException");
ce.printStackTrace(System.out);
}