Bug 37266 - SimpleFileStore - files showing as directory (as <collection/>) - one line fix
Summary: SimpleFileStore - files showing as directory (as <collection/>) - one line fix
Status: NEW
Alias: None
Product: Slide
Classification: Unclassified
Component: Core (show other bugs)
Version: Nightly
Hardware: Other other
: P2 major (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-27 14:46 UTC by Darren Hartford
Modified: 2005-10-27 06:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hartford 2005-10-27 14:46:08 UTC
> 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);
> /***************  end fix */
>       descriptor.setContentLength(file.length());
>     }
>     return descriptor;
>   }
> ==============