Skip to content

Commit 20390d3

Browse files
committed
doc: fixing indentation and updating initialization instructions
1 parent 0abfb43 commit 20390d3

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,21 @@ Step 2. Add the dependency in POM file:
5858

5959

6060
## Initialization
61+
62+
Step 1. Create a `config.properties` file inside `src/main/resources` of your project. And put essential values of keys [UrlEndpoint, PrivateKey, PublicKey], no need to use any quote(',") in values.
63+
64+
```editorconfig
65+
# Put essential values of keys [UrlEndpoint, PrivateKey, PublicKey]
66+
UrlEndpoint=<-YOUR-ENDPOINT-URL-HERE->
67+
PrivateKey=<-YOUR-PRIVATE-KEY-HERE->
68+
PublicKey=<-YOUR-PUBLIC-KEY-HERE->
69+
```
70+
Step 2. Then you need to initialize ImageKit with that configuration.
71+
6172
```java
6273
import io.imagekit.sdk.ImageKit;
6374
import io.imagekit.sdk.config.Configuration;
75+
import io.imagekit.sdk.utils.Utils;
6476
class App {
6577
public static void main(String[] args){
6678
ImageKit imageKit=ImageKit.getInstance();
@@ -134,14 +146,14 @@ The ```.getUrl()``` method accepts the following parameters
134146

135147
| Option | Description |
136148
| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
137-
| url_endpoint | Optional. `(Type: String)` The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/ |
149+
| urlEndpoint | Optional. `(Type: String)` The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/ |
138150
| path | Conditional. `(Type: String)` This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
139151
| src | Conditional. `(Type: String)` This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
140152
| transformation | Optional. `(Type: List<Map<String,String>>)` An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as different objects of the array. The complete list of supported transformations in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. |
141-
| transformation_position | Optional. `(Type: String)` Default value is `path` that places the transformation string as a path parameter in the URL. It can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use the `src` parameter to create the URL, then the transformation string is always added as a query parameter. |
142-
| query_parameters | Optional. `(Type: Map<String, String>)` These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful if you want to add some versioning parameter to your URLs. |
153+
| transformationPosition | Optional. `(Type: String)` Default value is `path` that places the transformation string as a path parameter in the URL. It can also be specified as `query` which adds the transformation string as the query parameter `tr` in the URL. If you use the `src` parameter to create the URL, then the transformation string is always added as a query parameter. |
154+
| queryParameters | Optional. `(Type: Map<String, String>)` These are the other query parameters that you want to add to the final URL. These can be any query parameters and not necessarily related to ImageKit. Especially useful if you want to add some versioning parameter to your URLs. |
143155
| signed | Optional. `(Type: Boolean)` Default is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. This can only be used if you are creating the URL with the `url_endpoint` and `path` parameters, and not with the `src` parameter. |
144-
| expire_seconds | Optional. `(Type: Integer)` Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. |
156+
| expireSeconds | Optional. `(Type: Integer)` Meant to be used along with the `signed` parameter to specify the time in seconds from now when the URL should expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. |
145157

146158

147159
## Examples of generating URLs
@@ -329,13 +341,13 @@ in the [documentation here](https://docs.imagekit.io/api-reference/media-api/lis
329341
correct values to get the results.
330342

331343
```java
332-
ResultList resultList=ImageKit.getInstance().getFileList(10,10);
333-
System.out.println("======FINAL RESULT=======");
334-
System.out.println(resultList);
335-
System.out.println("Raw Response:");
336-
System.out.println(resultList.getRaw());
337-
System.out.println("Map Response:");
338-
System.out.println(resultList.getMap());
344+
ResultList resultList=ImageKit.getInstance().getFileList(10,10);
345+
System.out.println("======FINAL RESULT=======");
346+
System.out.println(resultList);
347+
System.out.println("Raw Response:");
348+
System.out.println(resultList.getRaw());
349+
System.out.println("Map Response:");
350+
System.out.println(resultList.getMap());
339351
```
340352

341353
**2. Get File Details**
@@ -531,7 +543,7 @@ ImageKit.getInstance().pHashDistance("a4a65595ac94518b", "7838873e791f8400");
531543

532544
**1. First clone this repository to your system using git.**
533545
```shell script
534-
git clone <imagekit-repo-url>
546+
git clone https://github.com/imagekit-developer/imagekit-java.git
535547
```
536548
**2. Open project in your favorite Java IDE that can supports Gradle dependency management or you can use Terminal/Command Prompt.**
537549

0 commit comments

Comments
 (0)