Confirmed SimpleFileStore problem and verify Michael's find regarding
the resourcetype being the identified problem.

SimpleFileStore.java
=============================
  /**
   * Set resourceType to "<collection/>" for folders and set the
contentLength for files.
   * Also set created and modified dates.
   */
  public NodeRevisionDescriptor retrieveRevisionDescriptor(Uri uri,
 
NodeRevisionNumber revisionNumber)
    throws ServiceAccessException, RevisionDescriptorNotFoundException
  {
    log("retrieveRevisionDescriptor(" + uri + ")");
    File file = getFile(uri);
    if (!file.exists()) throw new
RevisionDescriptorNotFoundException(uri.toString());

    NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor(new
NodeRevisionNumber(1, 0),
 
NodeRevisionDescriptors.MAIN_BRANCH);
    descriptor.setCreationDate(new Date(file.lastModified()));
    descriptor.setLastModified(descriptor.getCreationDateAsDate());
    descriptor.setModificationDate(descriptor.getCreationDateAsDate());
    if (file.isDirectory())
    {
      descriptor.setResourceType(COLLECTION_TYPE);
    }
    else
    {
/* 10/26/2006 DRH  setResourceType null if not directory */
      descriptor.setResourceType(null);
      descriptor.setContentLength(file.length());
    }
    return descriptor;
  }
==============

This seems to be working fine and as expected now, Thanks Michael!

-D

> -----Original Message-----
> From: Michael Perkonigg [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 31, 2005 12:48 PM
> To: Slide Users Mailing List
> Subject: Re: Problem with SimpleFileStore
> 
> Michael Perkonigg wrote:
> 
> >Hello,
> >
> >I am using a SimpleFileStore for my logs but if I create a file and 
> >have a look at it with i.e. DAV Explorer it seems that slide 
> thinks it 
> >is a directory (or collection, spoken in slide terms).
> >It shows some size on it though, but if I try to read it like a file 
> >slide hiccups with some error.
> >'Item License.txt found. But it is not a file.'
> >This happens if I try to read a file but get a directory instead.
> >
> >If anyone has a suggestion what to try, I would be very happy.
> >
> >Thanks,
> >Mike
> >  
> >
> And I found the problem to this also.
> It seems that the SimpleFileStore sets the resourcetype 
> property to "<collection/>" if it is a directory but does 
> nothing if it is a file.
> This should be correct if the resourcetype is null initially, 
> but it don't work this way.
> I created my own SimpleFileStore which sets the resourcetype 
> to null if it is a file and now it works.
> 
> Regards,
> Mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to