[mashup-dev] [jira] Resolved: (MASHUP-53) File Object appends rather than rewrites

Jonathan Marsh jonathan at wso2.com
Mon Jun 4 09:29:09 PDT 2007


I like the three functions better than a parameter too - more self-explanatory.

To reduce the verbosity a bit, the word "File" could be eliminated.  In most cases this will be redundant with the rest of the code, since it's a method on the "File" object:

myFile = new File();
myFile.openForReading();

Jonathan Marsh - http://www.wso2.com - http://auburnmarshes.spaces.live.com
 

> -----Original Message-----
> From: mashup-dev-bounces at wso2.org [mailto:mashup-dev-bounces at wso2.org]
> On Behalf Of Thilina Gunarathne (JIRA)
> Sent: Monday, June 04, 2007 9:06 AM
> To: mashup-dev at wso2.org
> Subject: [mashup-dev] [jira] Resolved: (MASHUP-53) File Object appends
> rather than rewrites
> 
>      [ http://www.wso2.org/jira/browse/MASHUP-53?page=all ]
> 
> Thilina Gunarathne resolved MASHUP-53.
> --------------------------------------
> 
>     Resolution: Fixed
> 
> Added new functions as follows...
> 
> void openFileForReading();
> void openFileForWriting();
> void openFileForAppending();
> 
> We can also reduce the following 3 functions  to a single function by
> introducing a int parameter as follows, though I have a little
> preference to the above 3 functions...
> 
> void openFile(int value);
> value=1 for reading, 2 for writing, 3 for appending...
> 
> 
> 
> 
> > File Object appends rather than rewrites
> > ----------------------------------------
> >
> >                 Key: MASHUP-53
> >                 URL: http://www.wso2.org/jira/browse/MASHUP-53
> >             Project: WSO2 Mashup Server
> >          Issue Type: Bug
> >         Environment: Nightly-buidl 5/29; Vista
> >            Reporter: Jonathan Marsh
> >         Assigned To: Thilina Gunarathne
> >             Fix For: alpha_1
> >
> >
> >         var file = new File(storepath + name + ".xml");
> >         if (!file.exists)
> >             file.createFile();
> >         file.write(value.toXMLString());
> >         file.finishWriting();
> > First call works fine, subsequent calls append data to the existing
> file rather than overwriting it.
> > This is a new bug in this (or recent) build(s).
> 
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://www.wso2.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> 
> 
> 
> _______________________________________________
> Mashup-dev mailing list
> Mashup-dev at wso2.org
> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev





More information about the Mashup-dev mailing list