1616
1717package io .minio ;
1818
19+ import java .time .ZonedDateTime ;
1920import java .util .Objects ;
2021
2122/**
2526public class DownloadObjectArgs extends ObjectReadArgs {
2627 private String filename ;
2728 private boolean overwrite ;
29+ protected String matchETag ;
30+ protected String notMatchETag ;
31+ protected ZonedDateTime modifiedSince ;
32+ protected ZonedDateTime unmodifiedSince ;
2833
2934 public String filename () {
3035 return filename ;
@@ -34,6 +39,22 @@ public boolean overwrite() {
3439 return overwrite ;
3540 }
3641
42+ public String matchETag () {
43+ return matchETag ;
44+ }
45+
46+ public String notMatchETag () {
47+ return notMatchETag ;
48+ }
49+
50+ public ZonedDateTime modifiedSince () {
51+ return modifiedSince ;
52+ }
53+
54+ public ZonedDateTime unmodifiedSince () {
55+ return unmodifiedSince ;
56+ }
57+
3758 public static Builder builder () {
3859 return new Builder ();
3960 }
@@ -54,6 +75,28 @@ public Builder overwrite(boolean flag) {
5475 operations .add (args -> args .overwrite = flag );
5576 return this ;
5677 }
78+
79+ public Builder matchETag (String etag ) {
80+ Utils .validateNullOrNotEmptyString (etag , "etag" );
81+ operations .add (args -> args .matchETag = etag );
82+ return this ;
83+ }
84+
85+ public Builder notMatchETag (String etag ) {
86+ Utils .validateNullOrNotEmptyString (etag , "etag" );
87+ operations .add (args -> args .notMatchETag = etag );
88+ return this ;
89+ }
90+
91+ public Builder modifiedSince (ZonedDateTime modifiedTime ) {
92+ operations .add (args -> args .modifiedSince = modifiedTime );
93+ return this ;
94+ }
95+
96+ public Builder unmodifiedSince (ZonedDateTime unmodifiedTime ) {
97+ operations .add (args -> args .unmodifiedSince = unmodifiedTime );
98+ return this ;
99+ }
57100 }
58101
59102 @ Override
@@ -62,12 +105,23 @@ public boolean equals(Object o) {
62105 if (!(o instanceof DownloadObjectArgs )) return false ;
63106 if (!super .equals (o )) return false ;
64107 DownloadObjectArgs that = (DownloadObjectArgs ) o ;
65- if (!Objects .equals (filename , that .filename )) return false ;
66- return overwrite == that .overwrite ;
108+ return Objects .equals (filename , that .filename )
109+ && overwrite == that .overwrite
110+ && Objects .equals (matchETag , that .matchETag )
111+ && Objects .equals (notMatchETag , that .notMatchETag )
112+ && Objects .equals (modifiedSince , that .modifiedSince )
113+ && Objects .equals (unmodifiedSince , that .unmodifiedSince );
67114 }
68115
69116 @ Override
70117 public int hashCode () {
71- return Objects .hash (super .hashCode (), filename , overwrite );
118+ return Objects .hash (
119+ super .hashCode (),
120+ filename ,
121+ overwrite ,
122+ matchETag ,
123+ notMatchETag ,
124+ modifiedSince ,
125+ unmodifiedSince );
72126 }
73127}
0 commit comments