cloudinary/cloudinary_java

URL suffix and root path exception

djmj opened this issue · 3 comments

djmj commented

SEO suffix are enabled for all plans and do not require private CDN.

Suffix

cloudinaryUrl.suffix(fileName)

Exception

java.lang.IllegalArgumentException: URL Suffix only supported in private CDN
	at com.cloudinary.Url.generate(Url.java:333)

RootPath

cloudinaryUrl.useRootPath(true)

Exception

java.lang.IllegalArgumentException: Root path only supported in private CDN
	at com.cloudinary.Url.generate(Url.java:333)

https://cloudinary.com/blog/how_to_dynamically_create_seo_friendly_urls_for_your_site_s_images

Hi @djmj. We couldn't reproduce the issue. Could you please make sure you're running the latest version of the package, and if not, update and try again? let us know if that helps?

Sharing the code from the ticket for future readers:

String url=cloudinary.url().suffix("inline").format("pdf").imageTag("sample");
System.out.println(url);
Response: <img src='http://res.cloudinary.com/***/images/sample/inline.pdf'/>

djmj commented

@roeeba I tested it with latest 1.19 version and the issue is resolved with great help of your support team.

I dont know why i got this exception, maybe the old library was still in the cache of the server.