nl_tokens: Checks for the path in _revCache and decides based on that if file has changed .
pl_tokens: function ( path , body , contentType , options ) { var self = this ; if ( ! this . connected ) { throw new Error ( "not connected (path: " + path + ")" ) ; } //check if file has changed and return 412 var savedRev = this . _revCache . get ( path ) ; if ( options && options . ifMatch && savedRev && ( savedRev !== options . ifMatch ) ) { return Promise . resolve ( { statusCode : 412 , revision : savedRev } ) ; } if ( options && ( options . ifNoneMatch === '*' ) && savedRev && ( savedRev !== 'rev' ) ) { return Promise . resolve ( { statusCode : 412 , revision : savedRev } ) ; } if ( ( ! contentType . match ( / charset= / ) ) && isBinaryData ( body ) ) { contentType += '; charset=binary' ; } if ( body . length > 150 * 1024 * 1024 ) { //https://www.dropbox.com/developers/core/docs#chunked-upload return Promise . reject ( new Error ( "Cannot upload file larger than 150MB" ) ) ; } var result ; var needsMetadata = options && ( options . ifMatch || ( options . ifNoneMatch === '*' ) ) ; var uploadParams = { body : body , contentType : contentType , path : path } ; if ( needsMetadata ) { result = this . _getMetadata ( path ) . then ( function ( metadata ) { if ( options && ( options . ifNoneMatch === '*' ) && metadata ) { // if !!metadata === true, the file exists return Promise . resolve ( { statusCode : 412 , revision : metadata . rev } ) ; } if ( options && <mask> . ifMatch && metadata && ( metadata . rev !== options . ifMatch ) ) { return Promise . resolve ( { statusCode : 412 , revision : metadata . rev } ) ; } return self . _uploadSimple ( uploadParams ) ; } ) ; } else { result = self . _uploadSimple ( uploadParams ) ; } return result . then ( function ( ret ) { self . _shareIfNeeded ( path ) ; return ret ; } ) ; }