[mashup-dev] [jira] Created: (MASHUP-215) Few issues in the sample code available in http://www.wso2.org/wiki/display/mashup/File+Host+Object

Yumani Ranaweera (JIRA) jira at wso2.org
Thu Jul 5 02:46:41 PDT 2007


Few issues in the sample code available in http://www.wso2.org/wiki/display/mashup/File+Host+Object
---------------------------------------------------------------------------------------------------

                 Key: MASHUP-215
                 URL: http://www.wso2.org/jira/browse/MASHUP-215
             Project: WSO2 Mashup Server
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 0.1-RC3
         Environment: WinXP, jdk15
            Reporter: Yumani Ranaweera
         Assigned To: Thilina Gunarathne
            Priority: Minor


Code is given below;

1    var text = "Hello World!";
2    var file = new File("hello.txt");
3    if (!file.exists)
4       file.createFile();
5    file.openForWriting();
6    file.write(text);
7    file.close(); file.move("backup/goodbye.txt"); var file2 = new File("backup/goodbye.txt");file2.openForReading();file2.openForReading();
8    print(file2.readAll());
9    file2.close();
10  if (!file2.delete())
11     print('Unable to delete file.');


Issues:
-----------
1.  Line 7  - Many statements in one line
2.  Line 7 - Redundant lines (file2.openForReading();)
3. Line10 - .delete is not supported. It should be'deleteFile'
4. Line 7 - .move is not returning true in windows.  First user could imply it as a code error. Ideal if we can catch it in the sample code itself

-- 
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

        




More information about the Mashup-dev mailing list