Skip to content

Commit 3ff869b

Browse files
committed
add support for overwrite in taglib
1 parent 578295d commit 3ff869b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

cloudinary-taglib/src/main/java/com/cloudinary/taglib/CloudinaryUploadTag.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ public class CloudinaryUploadTag extends SimpleTagSupport {
4343
private boolean uniqueFilename = true;
4444
private boolean eagerAsync = false;
4545
private boolean invalidate = false;
46-
47-
public void doTag() throws JspException, IOException {
46+
private boolean overwrite = true;
47+
48+
public void doTag() throws JspException, IOException {
4849
Cloudinary cloudinary = Singleton.getCloudinary();
4950
if (cloudinary == null) {
5051
throw new JspException("Cloudinary config could not be located");
@@ -82,6 +83,7 @@ public void doTag() throws JspException, IOException {
8283
options.put("face_coordinates", faceCoordinates);
8384
options.put("allowed_formats", allowedFormats);
8485
options.put("context", context);
86+
options.put("overwrite", overwrite);
8587

8688
buildCallbackUrl(options);
8789

@@ -314,6 +316,14 @@ public String getContext() {
314316
public void setContext(String context) {
315317
this.context = context;
316318
}
319+
320+
public boolean isOverwrite() {
321+
return overwrite;
322+
}
323+
324+
public void setOverwrite(boolean overwrite) {
325+
this.overwrite = overwrite;
326+
}
317327

318328
private void buildCallbackUrl(Map options) {
319329
String callback = (String) options.get("callback");

cloudinary-taglib/src/main/resources/META-INF/cloudinary.tld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
<required>false</required>
151151
<rtexprvalue>true</rtexprvalue>
152152
</attribute>
153+
<attribute>
154+
<name>overwrite</name>
155+
<required>false</required>
156+
<rtexprvalue>true</rtexprvalue>
157+
</attribute>
153158
</tag>
154159
<tag>
155160
<name>transformation</name>

0 commit comments

Comments
 (0)