@ Override public void deleteAssetAndAttachments ( final String assetId ) throws IOException , RequestFailureException { Asset ass = getUnverifiedAsset ( assetId ) ; List < Attachment > attachments = ass . getAttachments ( ) ; if ( attachments != null ) { for ( Attachment attachment : attachments ) { deleteAttachment ( assetId , attachment . get_id ( ) ) ; } } // Now delete the asset deleteAsset ( assetId ) ; }
This will delete an asset and all its attachments