Long resourceableId = tempFr.getResourceableId();
// extract type
try {
if (DocFileResource.validate(fResource)) tempFr = new DocFileResource();
else if (XlsFileResource.validate(fResource)) tempFr = new XlsFileResource();
else if (PowerpointFileResource.validate(fResource)) tempFr = new PowerpointFileResource();
else if (PdfFileResource.validate(fResource)) tempFr = new PdfFileResource();
else if (ImageFileResource.validate(fResource)) tempFr = new ImageFileResource();
else if (MovieFileResource.validate(fResource)) tempFr = new MovieFileResource();
else if (SoundFileResource.validate(fResource)) tempFr = new SoundFileResource();
else if (AnimationFileResource.validate(fResource)) tempFr = new AnimationFileResource();