public static boolean share ( String filePath , Class < ? extends WingsEndpoint > endpointClazz ) throws IllegalStateException { if ( ! sIsInitialized ) { throw new IllegalStateException ( "Wings must be initialized. See Wings#init()." ) ; } WingsEndpoint endpoint = Wings . getEndpoint ( endpointClazz ) ; if ( endpoint != null ) { WingsEndpoint . LinkInfo linkInfo = endpoint . getLinkInfo ( ) ; if ( linkInfo != null && WingsInjector . getDatabase ( ) . createShareRequest ( filePath , new Destination ( linkInfo . mDestinationId , endpoint . getEndpointId ( ) ) ) ) { WingsService . startWakefulService ( WingsInjector . getApplicationContext ( ) ) ; return true ; } } return false ; }
Shares an image to the specified endpoint . The client is responsible for ensuring that the file exists and the endpoint is linked .