Hi all,
Maybe we should come back to an earlier proposal we discussed (and
dismissed at that time): Let us keep the Resource completely abstract,
taking out the getRawData and getObject methods and add new interfaces
for the mapped data and the JCR node:
public interface Resource {
String getURI();
String getResourceType();
ResourceMetadata getResourceMetadata();
InputStream getInputStream();
}
public interface JcrResource extends Resource {
Node getNode();
}
public interface MappedResource extends Resource {
Object getObject();
}
This would allow for other resources such as a FileResource or an
URLResource (hold on, there is an actual use case: We abstract Scripts
as being Resource based, having an URLResource would allow scripts to be
stored in OSGi Bundles for Sling)
For microsling, we can then safely assume, that the Resource is always a
JcrResource.
WDYT ?
Regards
Felix