axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adhamh Findlay <>
Subject JavaWriter patch question...
Date Thu, 24 Jul 2003 17:35:36 GMT

I'm about to patch my first bit of code and would like to run it by the list
first for comments and such.  Its not a big patch, but it my have a big

I was running an example from the user guide that demonstrates WSDL2Java.
The command issues was:

"java org.apache.axis.wsdl.WSDL2Java AddressBook.wsdl"

I didn't have write access to the samples/addr directory so I got: AddressFetcher2/ (No such file or

Really this isn't the full story.  AddressFetcher2 was not only missing, but
could not be created which is what caused it to be missing....

So I propose a patch to JavaWrite.getPrintWriter to make it the following:

    protected PrintWriter getPrintWriter(String filename) throws IOException
        System.out.println("filename with are trying to write " + filename);
        SecurityManager sm = new SecurityManager();
        try {
        catch (SecurityException e) {
                System.out.println("The following exception has occured: " +
e + "\n It is likely that you do not have permission to write to the current
        File file = new File(filename);
        File parent = new File(file.getParent());
        return new PrintWriter(new FileWriter(file));
    } // getPrintWriter

My main questions are if this code should use the JCL instead of System.out,
and if this exception should be caught somewhere else.



View raw message