plugins/transforms/dropbox/src/main/java/org/apache/hop/pipeline/transforms/dropbox/output/DropboxOutput.java
private boolean uploadFile( DbxClientV2 dbxClient, File localFile, String dropboxPath ) {
        try ( InputStream in = new FileInputStream( localFile ) ) {
            IOUtil.ProgressListener progressListener = l -> printProgress( l, localFile.length() );

            FileMetadata metadata = dbxClient.files().uploadBuilder( dropboxPath )
                    .withMode( WriteMode.ADD )
                    .withClientModified( new Date( localFile.lastModified() ) )
                    .uploadAndFinish( in, progressListener );

            log.logDetailed( metadata.toStringMultiline() );
        } catch ( UploadErrorException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.UploadError", ex.getMessage() ) );
            return false;
        } catch ( DbxException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.UploadError", ex.getMessage() ) );
            return false;
        } catch ( IOException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.ErrorReadingFile", localFile.getName(), ex.getMessage() ) );
            return false;
        }
        return true;
    }
/**
     * Uploads a file in a single request. This approach is preferred for small files since it
     * eliminates unnecessary round-trips to the servers.
     *
     * @param dbxClient Dropbox user authenticated client
     * @param localFile local file to upload
     * @param dropboxPath Where to upload the file to within Dropbox
     */
Uploads a file in a single request. This approach is preferred for small files since it
eliminates unnecessary round-trips to the servers.

@param dbxClient Dropbox user authenticated client
@param localFile local file to upload
@param dropboxPath Where to upload the file to within Dropbox
Uploads a file in a single request . This approach is preferred for small files since it eliminates unnecessary round - trips to the servers . @param dbxClient Dropbox user authenticated client @param localFile local file to upload @param dropboxPath Where to upload the file to within Dropbox
private boolean uploadFile( DbxClientV2 dbxClient, File localFile, String dropboxPath ) {
        try ( InputStream in = new FileInputStream( localFile ) ) {
            IOUtil.ProgressListener progressListener = l -> printProgress( l, localFile.length() );
            FileMetadata metadata = dbxClient.files().uploadBuilder( dropboxPath )
                    .withMode( WriteMode.ADD )
                    .withClientModified( new Date( localFile.lastModified() ) )
                    .uploadAndFinish( in, progressListener );
            log.logDetailed( metadata.toStringMultiline() );
        } catch ( UploadErrorException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.UploadError", ex.getMessage() ) );
            return false;
        } catch ( DbxException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.UploadError", ex.getMessage() ) );
            return false;
        } catch ( IOException ex ) {
            logError( BaseMessages.getString( PKG, "DropboxOutput.Log.ErrorReadingFile", localFile.getName(), ex.getMessage() ) );
            return false;
        }
        return true;
    }
private boolean uploadFile ( DbxClientV2 dbxClient , File localFile , String dropboxPath ) { try ( InputStream in = new FileInputStream ( localFile ) ) { IOUtil . ProgressListener progressListener = l -> printProgress ( l , localFile . length ( ) ) ; FileMetadata metadata = dbxClient . files ( ) . uploadBuilder ( dropboxPath ) . withMode ( WriteMode . ADD ) . withClientModified ( new Date ( localFile . lastModified ( ) ) ) . uploadAndFinish ( in , progressListener ) ; log . logDetailed ( metadata . toStringMultiline ( ) ) ; } catch ( UploadErrorException ex ) { logError ( BaseMessages . getString ( PKG , "DropboxOutput.Log.UploadError" , ex . getMessage ( ) ) ) ; return false ; } catch ( DbxException ex ) { logError ( BaseMessages . getString ( PKG , "DropboxOutput.Log.UploadError" , ex . getMessage ( ) ) ) ; return false ; } catch ( IOException ex ) { logError ( BaseMessages . getString ( PKG , "DropboxOutput.Log.ErrorReadingFile" , localFile . getName ( ) , ex . getMessage ( ) ) ) ; return false ; } return true ; }
Uploads a file in a single request.
Uploads a file in a single request .