DavPropertySet properties = new DavPropertySet();
// set (or reset) fundamental properties
if ( getDisplayName() != null )
{
properties.add( new DefaultDavProperty( DavPropertyName.DISPLAYNAME, getDisplayName() ) );
}
if ( isCollection() )
{
properties.add( new ResourceType( ResourceType.COLLECTION ) );
// Windows XP support
properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "1" ) );
}
else
{
properties.add( new ResourceType( ResourceType.DEFAULT_RESOURCE ) );
// Windows XP support
properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "0" ) );
}
// Need to get the ISO8601 date for properties
DateTime dt = new DateTime( localResource.lastModified() );
DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
String modifiedDate = fmt.print( dt );
properties.add( new DefaultDavProperty( DavPropertyName.GETLASTMODIFIED, modifiedDate ) );
properties.add( new DefaultDavProperty( DavPropertyName.CREATIONDATE, modifiedDate ) );
properties.add( new DefaultDavProperty( DavPropertyName.GETCONTENTLENGTH, localResource.length() ) );
this.properties = properties;
return properties;
}