File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
main/java/com/cloudinary/transformation
test/java/com/cloudinary/test Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ package com .cloudinary .transformation ;
2+
3+ import com .cloudinary .utils .Base64Coder ;
4+
5+ public class FetchLayer extends AbstractLayer <FetchLayer > {
6+
7+ public FetchLayer () {
8+ this .type = "fetch" ;
9+ }
10+
11+ public FetchLayer url (String remoteUrl ) {
12+ this .publicId = Base64Coder .encodeString (remoteUrl );
13+ return this ;
14+ }
15+
16+ @ Override
17+ public FetchLayer type (String type ) {
18+ throw new UnsupportedOperationException ("Cannot modify type for fetch layers" );
19+ }
20+
21+ @ Override
22+ FetchLayer getThis () {
23+ return this ;
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -988,7 +988,11 @@ public void testOverlayOptions() {
988988 "text:Arial_18_bold_italic_letter_spacing_4_line_spacing_3:Hello%20World%252C%20Nice%20to%20meet%20you%3F" ,
989989 new SubtitlesLayer ().publicId ("sample_sub_en.srt" ), "subtitles:sample_sub_en.srt" ,
990990 new SubtitlesLayer ().publicId ("sample_sub_he.srt" ).fontFamily ("Arial" ).fontSize (40 ),
991- "subtitles:Arial_40:sample_sub_he.srt" };
991+ "subtitles:Arial_40:sample_sub_he.srt" ,
992+ new FetchLayer ().url ("https://test" ).resourceType ("image" ),
993+ "fetch:aHR0cHM6Ly90ZXN0" ,
994+ new FetchLayer ().url ("https://test" ),
995+ "fetch:aHR0cHM6Ly90ZXN0" };
992996
993997 for (int i = 0 ; i < tests .length ; i += 2 ) {
994998 Object layer = tests [i ];
You can’t perform that action at this time.
0 commit comments