question: public static void uploadNotes ( Context context , String host , String hash ) throws IOException , JSONException , AuthenticatorException { NoteDataSource dataSource = NoteDataSource . getInstance ( context ) ; List < Note > notSyncedNotes = dataSource . getNotes ( DatabaseContract . NoteEntry . NOTE_STATUS . not_synced ) ; for ( Note note : notSyncedNotes ) { Note newNote = createNote ( host , hash , note ) ; if ( newNote != null ) { dataSource . deleteNote ( note ) ; dataSource . insertNote ( newNote ) ; } else { Log . d ( LOG_TAG , "Creating note failed" ) ; } } }
target:  Uploads all new local notes