public static < T extends File > T transformFile ( final SecurityContext securityContext , final String uuid , final Class < T > fileType ) throws FrameworkException , IOException { AbstractFile existingFile = getFileByUuid ( securityContext , uuid ) ; if ( existingFile != null ) { existingFile . unlockSystemPropertiesOnce ( ) ; existingFile . setProperties ( securityContext , new PropertyMap ( AbstractNode . type , fileType == null ? File . class . getSimpleName ( ) : fileType . getSimpleName ( ) ) ) ; existingFile = getFileByUuid ( securityContext , uuid ) ; return ( T ) ( fileType != null ? fileType . cast ( existingFile ) : ( File ) existingFile ) ; } return null ; }
Transform an existing file into the target class .