resource = versionedFile.getVersionHistory().getVersion(version);
istream = ((VersionResource)resource).getContentAsStream();
}
else
{
resource = new FileResource(uri, node, nsContext);
istream = ((FileResource)resource).getContentAsStream();
}
HierarchicalProperty contentLengthProperty = resource.getProperty(FileResource.GETCONTENTLENGTH);
long contentLength = new Long(contentLengthProperty.getValue());
HierarchicalProperty mimeTypeProperty = resource.getProperty(FileResource.GETCONTENTTYPE);
String contentType = mimeTypeProperty.getValue();
FileResource fileResource = new FileResource(uri, node, nsContext);
HierarchicalProperty lastModifiedProperty = fileResource.getProperty(FileResource.GETLASTMODIFIED);
if((ifModifiedSince != null) && (ifModifiedSince.equals(lastModifiedProperty.getValue()))){
return Response.notModified().entity("Not Modified").build();
}