private GridFSInputFile createGFSInputFile ( GridFS gfs , Object entity , Field f ) { Object obj = PropertyAccessorHelper . getObject ( entity , f ) ; GridFSInputFile gridFSInputFile = null ; if ( f . getType ( ) . isAssignableFrom ( byte [ ] . class ) ) gridFSInputFile = gfs . createFile ( ( byte [ ] ) obj ) ; else if ( f . getType ( ) . isAssignableFrom ( File . class ) ) { try { gridFSInputFile = gfs . createFile ( ( File ) obj ) ; } catch ( IOException e ) { log . error ( "Error while creating GridFS file for \"" + f . getName ( ) + "\". Caused by: " , e ) ; throw new KunderaException ( "Error while creating GridFS file for \"" + f . getName ( ) + "\". Caused by: " , e ) ; } } else new UnsupportedOperationException ( f . getType ( ) . getSimpleName ( ) + " is unsupported Lob object" ) ; return gridFSInputFile ; }
Creates the GFS Input file .