Skip to content

Commit 6e6c274

Browse files
authored
Merge pull request #15 from KhushbooMer/update-read-me
updated PR for change og
2 parents e19d455 + 4cbb1bd commit 6e6c274

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,27 @@ This document presents a list of changes that break the existing functionality o
119119

120120
Changes from 1.0.3 -> 2.0.0 are listed below
121121

122-
1. Result raw object and getMap() properties:
122+
1. Result `raw` object and `getMap()` properties:
123123

124124
**What changed**
125-
- raw and getMap() has been deprecated.
125+
- `raw` and `getMap()` has been deprecated.
126126

127127
**Who is affected?**
128-
- This affects any development that uses the raw or getMap() from the response object of APIs and Result object.
128+
- This affects any development that uses the `raw` or `getMap()` from the response object of APIs and Result object.
129129

130130
**How should I update my code?**
131-
- If you still need to use raw and getMap(), do this `result.getResponseMetaData().getRaw()`.
131+
- If you still need to use `raw` and `getMap()`, do this `result.getResponseMetaData().getRaw()`.
132132

133-
2. Result object message and isSuccessful boolean properties:
133+
2. Result object `message` and `isSuccessful` boolean properties:
134134

135135
**What changed**
136-
- message and isSuccessful have been replaced with custom exceptions according to response code.
136+
- `message` and `isSuccessful` have been replaced with custom exceptions according to response code.
137137

138138
**Who is affected?**
139-
- This affects any development that uses the message or isSuccessful from response object of APIs that is Result object.
139+
- This affects any development that uses the `message` or `isSuccessful` from response object of APIs that is Result object.
140140

141141
**How should I update my code?**
142-
- If you still need to use message it will be there in the custom exception and could be raised isSuccessful properties in your own code from status code that is coming in the response or custom exception.
142+
- If you still need to use `message` it will be there in the custom exception and could be raised `isSuccessful` properties in your own code from status code with `httpStatusCode` that is coming in the responseMetaData with `getResponseMetaData()` of response object or custom exception.
143143

144144

145145
## URL generation
@@ -356,7 +356,7 @@ If you want to generate transformations in your application and add them to the
356356
The SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media library. It
357357
accepts an object of the `FileCreateRequest` class that contains all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).
358358

359-
The constructor `FileCreateRequest` class requires `file` as (URL/Base64/Byte Array) and `file_name`. If `file` is byte array then it's require another parameter named `mediaType` to upload a file. The method returns object of `Result` class. It contains method `isSuccessful()` (return boolean), `getMessage()` for error message and other file parameter responsed by server.
359+
The constructor `FileCreateRequest` class requires `file` as (URL/Base64/Byte Array) and `file_name`. The method returns object of `Result` in case of successful, or it will throw custom exception in case of failure.
360360

361361
Sample usage
362362

@@ -406,9 +406,9 @@ System.out.println("Map Response:");
406406
System.out.println(result.getResponseMetaData().getMap());
407407
```
408408

409-
If the upload is successful, `getMessage()` will be `None`, and the result will be an object of `Result` class that contains the same all the parameters received from ImageKit's servers, and `isSuccessful()` will return true.
409+
If the upload is successful, result will be there as an object of `Result` class that contains the same all the parameters received from ImageKit's servers.
410410

411-
If the upload fails, `getMessage()` will contain the same error message received from ImageKit's servers, and `isSuccessful()` will return false.
411+
If the upload fails, custom exception getting thrown and by doinf`getMessage()` will contain the same error message received from ImageKit's servers.
412412

413413

414414
## File Management

imagekit-sdk/src/test/java/io/imagekit/sdk/GetUrlTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void getUrl_with_transformation_parameters() {
199199

200200
String url = SUT.getUrl(options);
201201
assertThat(
202-
"https://ik.imagekit.io/your_imagekit_id/tr:cm-extract,ofo-top,n-any_name,md-true,ow-20,e-contrast-1,fo-left,bl-10,ar-4-3,oit-false,e-usm-,oa-,obg-00AAFF55,ots-18,t-5,oh-20,cp-true,r-20,ox-20,ot-Image%20Text,oy-10,otc-00FFFF,di-folder@@file.jpg,h-600,b-5-A94D34,orig-true,rt-90,dpr-3,f-png,raw-w-200,h-200,lo-true,e-grayscale-,q-40,ott-b,bg-A94D34,w-400,pr-true,e-sharpen,oi-folder@@file.jpg,c-force,otf-Open%20Sans/default-image.jpg",
202+
"https://ik.imagekit.io/your_imagekit_id/tr:cm-extract,ofo-top,n-any_name,md-true,ow-20,e-contrast-1,oiar-oiar,fo-left,bl-10,ar-4-3,oit-oit,e-usm-,oidpr-oidpr,oa-,obg-00AAFF55,ots-18,t-5,oh-20,oic-oic,cp-true,r-20,ox-20,ot-Image%20Text,oy-10,otc-00FFFF,di-folder@@file.jpg,h-600,b-5-A94D34,orig-true,rt-90,dpr-3,f-png,raw-w-200,h-200,lo-true,e-grayscale-,oibg-oibg,q-40,ott-b,oib-oib,oiq-oiq,bg-A94D34,w-400,pr-true,e-sharpen,oi-oi,oifo-oifo,c-force,otf-Open%20Sans/default-image.jpg",
203203
is(url));
204204
}
205205

@@ -453,7 +453,7 @@ public void getUrl_with_signature() {
453453

454454
String url = SUT.getUrl(options);
455455

456-
assertSignedUrl("https://ik.imagekit.io/zv3rkhsym/tr:w-100/test-signed-url.png", url);
456+
assertSignedUrl("https://ik.imagekit.io/imagekit_id/tr:w-100/test-signed-url.png", url);
457457
}
458458

459459
@Test

imagekit-sdk/src/test/java/io/imagekit/sdk/ImageKitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void withTokenAndExpire_getAuthenticationParameters_successExpected() {
4848
assertNotNull(auth);
4949
assertEquals("your_token", auth.get("token"));
5050
assertEquals("1582269249", auth.get("expire"));
51-
assertEquals("98598e12a8eec9fedc883df4ae598618aaf24d87", auth.get("signature"));
51+
assertEquals("e71bcd6031016b060d349d212e23e85c791decdd", auth.get("signature"));
5252
}
5353

5454
@Test
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copy this sample file add rename it to "config.properties"
22
# Put essential values of keys [UrlEndpoint, PrivateKey, PublicKey]
33

4-
UrlEndpoint=https://ik.imagekit.io/zv3rkhsym
5-
PrivateKey=private_kwTU4AR9Ei5hBoTIuxCW63Dg2jM=
6-
PublicKey=public_SSvmi6RknpNXj9x1cQnra1sYpJg=
4+
UrlEndpoint=https://ik.imagekit.io/imagekit_id
5+
PrivateKey=private_key_test
6+
PublicKey=public_key_test

0 commit comments

Comments
 (0)