Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Bug: FTP UCP: getPropertyValues command for non-directory files for Size, DateCreated etc not set for files hosted on Windows server | ||
---|---|---|---|
Product: | General | Reporter: | John Dougrez-Lewis <jlewis> |
Component: | code | Assignee: | AOO issues mailing list <issues> |
Status: | UNCONFIRMED --- | QA Contact: | |
Severity: | Normal | ||
Priority: | P5 (lowest) | CC: | oooforum |
Version: | 4.1.2 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows, all | ||
Issue Type: | DEFECT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
John Dougrez-Lewis
2016-03-12 13:01:09 UTC
// e.g. something along these lines: // file: .\ucb\source\ucp\ftp\ftpcontent.cxx static bool isValidFile(const FTPDirentry& aDirEntry) { if (aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) return(true); if (aDirEntry.m_nSize>0) return(true); if (aDirEntry.m_aDate.Year!=0) return(true); return(false); } Reference< XRow > FTPContent::getPropertyValues( const Sequence< Property >& seqProp, const Reference<XCommandEnvironment>& /*environment*/ ) { rtl::Reference<ucbhelper::PropertyValueSet> xRow = new ucbhelper::PropertyValueSet(m_xSMgr); FTPDirentry aDirEntry = m_aFTPURL.direntry(); for(sal_Int32 i = 0; i < seqProp.getLength(); ++i) { const rtl::OUString& Name = seqProp[i].Name; if(Name.compareToAscii("Title") == 0) xRow->appendString(seqProp[i],aDirEntry.m_aName); else if(Name.compareToAscii("CreatableContentsInfo") == 0) xRow->appendObject(seqProp[i], makeAny(queryCreatableContentsInfo())); //!!!! // else if (aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) { else if (isValidFile(aDirEntry)) { //!!!! 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 xRow->appendVoid(seqProp[i]); } return Reference<XRow>(xRow.get()); } Here is another bug in the same category: Deleting non-Folder simple file on Windows FTP Server: File: ./ucb/source/ucp/ftp/ftpurl.cxx function: void FTPURL::del() const Replace exist code: else if (aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) dele = rtl::OString("DELE ") + dele; else return; with: else dele = rtl::OString("DELE ") + dele; Otherwise a [Windows] file that is not a directory and has no other [aDirentry.m_nMode] attributes set fails to be deleted. Maybe you could propose a patch? Dev team will be happy :-) |