You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2016/03/12 14:53:45 UTC
[Issue 126870] Bug: FTP UCP: getPropertyValues command for
non-directory files for Size, DateCreated etc not set for files hosted on
Windows server
https://bz.apache.org/ooo/show_bug.cgi?id=126870
--- Comment #1 from John Dougrez-Lewis <jl...@lightblue.com> ---
// 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());
}
--
You are receiving this mail because:
You are the assignee for the issue.