public synchronized static BindUploader newInstance ( SFSession session , String stageDir ) throws BindException { try { Path bindDir = Files . createTempDirectory ( PREFIX ) ; return new BindUploader ( session , stageDir , bindDir ) ; } catch ( IOException ex ) { throw new BindException ( String . format ( "Failed to create temporary directory: %s" , ex . getMessage ( ) ) , BindException . Type . OTHER ) ; } }
Create a new BindUploader which will upload to the given stage path Ensure temporary directory for file writing exists