@@ -31,7 +31,7 @@ public class Uploader {
3131 public Uploader (Cloudinary cloudinary ) {
3232 this .cloudinary = cloudinary ;
3333 }
34- static final String [] BOOLEAN_UPLOAD_OPTIONS = new String [] {"backup" , "exif" , "faces" , "colors" , "image_metadata" };
34+ static final String [] BOOLEAN_UPLOAD_OPTIONS = new String [] {"backup" , "exif" , "faces" , "colors" , "image_metadata" , "use_filename" , "eager_async" };
3535
3636 public Map <String , String > buildUploadParams (Map options ) {
3737 if (options == null ) options = Cloudinary .emptyMap ();
@@ -54,6 +54,8 @@ public Map<String, String> buildUploadParams(Map options) {
5454 }
5555 params .put ("eager" , buildEager ((List <Transformation >) options .get ("eager" )));
5656 params .put ("headers" , buildCustomHeaders (options .get ("headers" )));
57+ params .put ("notification_url" , (String ) options .get ("notification_url" ));
58+ params .put ("eager_notification_url" , (String ) options .get ("eager_notification_url" ));
5759 params .put ("tags" , StringUtils .join (Cloudinary .asArray (options .get ("tags" )), "," ));
5860 return params ;
5961 }
@@ -84,6 +86,62 @@ public Map explicit(String publicId, Map options) throws IOException {
8486 return callApi ("explicit" , params , options , null );
8587 }
8688
89+ public Map generate_sprite (String tag , Map options ) throws IOException {
90+ if (options == null ) options = Cloudinary .emptyMap ();
91+ Map <String , String > params = new HashMap <String , String >();
92+ Object transParam = options .get ("transformation" );
93+ Transformation transformation = null ;
94+ if (transParam instanceof Transformation ) {
95+ transformation = new Transformation ((Transformation ) transParam );
96+ } else if (transParam instanceof String ) {
97+ transformation = new Transformation ().rawTransformation ((String ) transParam );
98+ } else {
99+ transformation = new Transformation ();
100+ }
101+ String format = (String ) options .get ("format" );
102+ if (format != null ) {
103+ transformation .fetchFormat (format );
104+ }
105+ params .put ("transformation" , transformation .generate ());
106+ params .put ("tag" , tag );
107+ params .put ("notification_url" , (String ) options .get ("notification_url" ));
108+ params .put ("async" , Cloudinary .asBoolean (options .get ("async" ), false ).toString ());
109+ return callApi ("sprite" , params , options , null );
110+ }
111+
112+ public Map multi (String tag , Map options ) throws IOException {
113+ if (options == null ) options = Cloudinary .emptyMap ();
114+ Map <String , String > params = new HashMap <String , String >();
115+ Object transformation = options .get ("transformation" );
116+ if (transformation != null ) {
117+ if (transformation instanceof Transformation ) {
118+ transformation = ((Transformation ) transformation ).generate ();
119+ }
120+ params .put ("transformation" , transformation .toString ());
121+ }
122+ params .put ("tag" , tag );
123+ params .put ("notification_url" , (String ) options .get ("notification_url" ));
124+ params .put ("format" , (String ) options .get ("format" ));
125+ params .put ("async" , Cloudinary .asBoolean (options .get ("async" ), false ).toString ());
126+ return callApi ("multi" , params , options , null );
127+ }
128+
129+ public Map explode (String public_id , Map options ) throws IOException {
130+ if (options == null ) options = Cloudinary .emptyMap ();
131+ Map <String , String > params = new HashMap <String , String >();
132+ Object transformation = options .get ("transformation" );
133+ if (transformation != null ) {
134+ if (transformation instanceof Transformation ) {
135+ transformation = ((Transformation ) transformation ).generate ();
136+ }
137+ params .put ("transformation" , transformation .toString ());
138+ }
139+ params .put ("public_id" , public_id );
140+ params .put ("notification_url" , (String ) options .get ("notification_url" ));
141+ params .put ("format" , (String ) options .get ("format" ));
142+ return callApi ("explode" , params , options , null );
143+ }
144+
87145 // options may include 'exclusive' (boolean) which causes clearing this tag
88146 // from all other resources
89147 public Map addTag (String tag , String [] publicIds , Map options ) throws IOException {
0 commit comments