[Building Sakai] How to get the content of ResourceType.TYPE_URL
swwangl at tsmc.com
swwangl at tsmc.com
Thu Aug 25 00:05:00 PDT 2011
I use the following code to achieve..
if (lItem.getResourceType().equals(ResourceType.TYPE_URL)){
ContentResource resource= contentService.getResource(lItem.getId());
try{
long len=resource.getContentLength();
int lenInt = (int)len;
if ((long)lenInt == len) {
byte[] tmpUrl=new byte[lenInt];
tmpUrl=resource.getContent();
String srcLoc=new String(tmpUrl);
}
}catch (ServerOverloadException ex){
}
}
Best Regards,
Joan
---------------------------------------------------------------------------
TSMC PROPERTY
This email communication (and any attachments) is proprietary information
for the sole use of its
intended recipient. Any unauthorized review, use or distribution by anyone
other than the intended
recipient is strictly prohibited. If you are not the intended recipient,
please notify the sender by
replying to this email, and then delete this email and any copies of it
immediately. Thank you.
---------------------------------------------------------------------------
More information about the sakai-dev
mailing list