@@ -1363,11 +1363,61 @@ public IODbxException(DbxException underlying)
13631363 */
13641364 public DbxDelta <DbxEntry > getDelta (String cursor )
13651365 throws DbxException
1366+ {
1367+ return _getDelta (cursor , null );
1368+ }
1369+
1370+ /**
1371+ * A more generic version of {@link #getDelta}. You provide a <em>collector</em>,
1372+ * which lets you process the delta entries as they arrive over the network.
1373+ */
1374+ public <C > DbxDeltaC <C > getDeltaC (Collector <DbxDeltaC .Entry <DbxEntry >, C > collector , String cursor )
1375+ throws DbxException
1376+ {
1377+ return _getDeltaC (collector , cursor , null );
1378+ }
1379+
1380+ /**
1381+ * Same as {@link #getDelta}, except results are limited to files and folders whose
1382+ * paths are equal to or under the specified {@code pathPrefix}.
1383+ *
1384+ * <p>
1385+ * The {@code pathPrefix} is fixed for a given cursor. Whatever {@code pathPrefix}
1386+ * you use on the first call to {@code getDelta()} must also be passed in on
1387+ * subsequent calls that use the returned cursor.
1388+ * </p>
1389+ *
1390+ * @param pathPrefix
1391+ * A path on Dropbox to limit results to.
1392+ */
1393+ public DbxDelta <DbxEntry > getDeltaWithPathPrefix (String cursor , String pathPrefix )
1394+ throws DbxException
1395+ {
1396+ DbxPath .checkArg ("path" , pathPrefix );
1397+ return _getDelta (cursor , pathPrefix );
1398+ }
1399+
1400+ /**
1401+ * A more generic version of {@link #getDeltaWithPathPrefix}. You provide a <em>collector</em>,
1402+ * which lets you process the delta entries as they arrive over the network.
1403+ */
1404+ public <C > DbxDeltaC <C > getDeltaCWithPathPrefix (Collector <DbxDeltaC .Entry <DbxEntry >, C > collector , String cursor , String pathPrefix )
1405+ throws DbxException
1406+ {
1407+ DbxPath .checkArg ("path" , pathPrefix );
1408+ return _getDeltaC (collector , cursor , pathPrefix );
1409+ }
1410+
1411+ private DbxDelta <DbxEntry > _getDelta (String cursor , String pathPrefix )
1412+ throws DbxException
13661413 {
13671414 String host = this .host .api ;
13681415 String apiPath = "1/delta" ;
13691416
1370- String [] params = {"cursor" , cursor };
1417+ String [] params = {
1418+ "cursor" , cursor ,
1419+ "path_prefix" , pathPrefix ,
1420+ };
13711421
13721422 return doPost (host , apiPath , params , null , new DbxRequestUtil .ResponseHandler <DbxDelta <DbxEntry >>() {
13731423 @ Override
@@ -1379,18 +1429,18 @@ public DbxDelta<DbxEntry> handle(HttpRequestor.Response response) throws DbxExce
13791429 });
13801430 }
13811431
1382- /**
1383- * This is a more generic version of {@link #getDelta}. It allows you to specify
1384- * a <em>collector</em>, which lets you process the delta entries as they arrive over
1385- * the network, and aggregate them however you want.
1386- */
1387- public <C > DbxDeltaC <C > getDeltaC (String cursor , final Collector <DbxDeltaC .Entry <DbxEntry >, C > collector )
1432+ private <C > DbxDeltaC <C > _getDeltaC (final Collector <DbxDeltaC .Entry <DbxEntry >, C > collector , String cursor , String pathPrefix )
13881433 throws DbxException
13891434 {
13901435 String host = this .host .api ;
13911436 String apiPath = "1/delta" ;
13921437
1393- return doPost (host , apiPath , new String []{"cursor" , cursor }, null , new DbxRequestUtil .ResponseHandler <DbxDeltaC <C >>() {
1438+ String [] params = {
1439+ "cursor" , cursor ,
1440+ "path_prefix" , pathPrefix ,
1441+ };
1442+
1443+ return doPost (host , apiPath , params , null , new DbxRequestUtil .ResponseHandler <DbxDeltaC <C >>() {
13941444 @ Override
13951445 public DbxDeltaC <C > handle (HttpRequestor .Response response ) throws DbxException {
13961446 if (response .statusCode != 200 ) throw DbxRequestUtil .unexpectedStatus (response );
0 commit comments