https://bz.apache.org/ooo/show_bug.cgi?id=126870

          Issue ID: 126870
        Issue Type: DEFECT
           Summary: Bug: FTP UCP: getPropertyValues command for
                    non-directory files for Size, DateCreated etc not set
                    for files hosted on Windows server
           Product: General
           Version: 4.1.2
          Hardware: PC
                OS: Windows, all
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P5 (lowest)
         Component: code
          Assignee: [email protected]
          Reporter: [email protected]

in file: ./ucp/ftp/ftpcontent.cxx
in function: getPropertyValues()

The FTPDirEntry::m_nmode value for a non-Directory (i.e. a plain ordinary file)
is left as INETCOREFTP_FILEMODE_UNKNOWN (0) when the FTPDirEntry structure is
populated from parsing a listing from a file on a Windowe FTP server.


The effect of this is as follows:

Any property queried in the getPropertyValues() function listed in the if()
{...} block below is left at a default value, meaning that the value retrieved
from parsing cannot be returned.

       else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) {
            if(Name.compareToAscii("ContentType") == 0)
                xRow->appendString(seqProp[i],
                                   aDirEntry.m_nMode&INETCOREFTP_FILEMODE_ISDIR
                                   ? FTP_FOLDER
                                   : FTP_FILE );
            else if(Name.compareToAscii("IsReadOnly") == 0)
                xRow->appendBoolean(seqProp[i],
                                    aDirEntry.m_nMode
                                    & INETCOREFTP_FILEMODE_WRITE
                                    ? 0
                                    : 1 );
            else if(Name.compareToAscii("IsDocument") == 0)
                xRow->appendBoolean(seqProp[i],
                                    ! sal_Bool(aDirEntry.m_nMode &
                                               INETCOREFTP_FILEMODE_ISDIR));
            else if(Name.compareToAscii("IsFolder") == 0)
                xRow->appendBoolean(seqProp[i],
                                    sal_Bool(aDirEntry.m_nMode &
                                             INETCOREFTP_FILEMODE_ISDIR));
            else if(Name.compareToAscii("Size") == 0)
                xRow->appendLong(seqProp[i],
                                 aDirEntry.m_nSize);
            else if(Name.compareToAscii("DateCreated") == 0)
                xRow->appendTimestamp(seqProp[i],
                                      aDirEntry.m_aDate);
            else
                xRow->appendVoid(seqProp[i]);
        } else

The code could do with something having a bit flag (e.g.
"INETCOREFTP_FILEMODE_ISDIR") to indicate teh file is valid in this case (or
some other test/indication that the file is valid) so as to avoid the failure
to return the valid values from the requested properties (Size, DateCreated
etc).

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to