From 191fdec5ce4ac230972a2f2bb5dedc304a8da090 Mon Sep 17 00:00:00 2001 From: ANKUR DWIVEDI Date: Fri, 10 May 2024 15:27:59 +0530 Subject: [PATCH 1/4] update readme --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e2eac1d..3dd2ba6 100644 --- a/README.md +++ b/README.md @@ -473,6 +473,9 @@ The SDK provides a simple interface for all the [media APIs mentioned here](http Accepts an object of class `GetFileListRequest` specifying the parameters to be used to list and search files. All parameters specified in the [documentation here](https://docs.imagekit.io/api-reference/media-api/list-and-search-files) can be passed via their setter functions to get the results. +#### Applying Filters +Filter out the files by specifying the parameters. + ```java String[] tags = new String[3]; tags[0] = "Software"; @@ -482,7 +485,6 @@ GetFileListRequest getFileListRequest = new GetFileListRequest(); getFileListRequest.setType("file"); getFileListRequest.setSort("ASC_CREATED"); getFileListRequest.setPath("/"); -getFileListRequest.setSearchQuery("createdAt >= '2d' OR size < '2mb' OR format='png'"); getFileListRequest.setFileType("all"); getFileListRequest.setLimit("4"); getFileListRequest.setSkip("1"); @@ -496,6 +498,27 @@ System.out.println("Map Response:"); System.out.println(resultList.getResponseMetaData().getMap()); ``` +#### Advance Search +In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and setting this generated string to the `GetFileListRequest` object using `setSearchQuery`. + +```java +String[] tags = new String[3]; +tags[0] = "Software"; +tags[1] = "Developer"; +tags[2] = "Engineer"; +GetFileListRequest getFileListRequest = new GetFileListRequest(); +getFileListRequest.setSearchQuery("createdAt >= '2d' OR size < '2mb' OR format='png'"); +ResultList resultList = ImageKit.getInstance().getFileList(getFileListRequest); +System.out.println("======FINAL RESULT======="); +System.out.println(resultList); +System.out.println("Raw Response:"); +System.out.println(resultList.getResponseMetaData().getRaw()); +System.out.println("Map Response:"); +System.out.println(resultList.getResponseMetaData().getMap()); +``` + +Detailed documentation can be found here for [advance search queries](https://docs.imagekit.io/api-reference/media-api/list-and-search-files#advanced-search-queries). + **2. Get File Details** Accepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-details) From a66b67a3dfc23f0443b3fff7b3eeca7cad74bd7e Mon Sep 17 00:00:00 2001 From: ANKUR DWIVEDI Date: Fri, 10 May 2024 15:32:40 +0530 Subject: [PATCH 2/4] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd2ba6..708b90b 100644 --- a/README.md +++ b/README.md @@ -499,7 +499,7 @@ System.out.println(resultList.getResponseMetaData().getMap()); ``` #### Advance Search -In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and setting this generated string to the `GetFileListRequest` object using `setSearchQuery`. +In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and setting this generated string to the `GetFileListRequest` object using `setSearchQuery` function. ```java String[] tags = new String[3]; From 856bcc1199325b9362c3745996b20356bffd2290 Mon Sep 17 00:00:00 2001 From: ANKUR DWIVEDI Date: Fri, 10 May 2024 17:00:45 +0530 Subject: [PATCH 3/4] update readme --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 708b90b..c608840 100644 --- a/README.md +++ b/README.md @@ -502,10 +502,6 @@ System.out.println(resultList.getResponseMetaData().getMap()); In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and setting this generated string to the `GetFileListRequest` object using `setSearchQuery` function. ```java -String[] tags = new String[3]; -tags[0] = "Software"; -tags[1] = "Developer"; -tags[2] = "Engineer"; GetFileListRequest getFileListRequest = new GetFileListRequest(); getFileListRequest.setSearchQuery("createdAt >= '2d' OR size < '2mb' OR format='png'"); ResultList resultList = ImageKit.getInstance().getFileList(getFileListRequest); From d6adecadae6be7a3ebdc29f499d19c9fab476330 Mon Sep 17 00:00:00 2001 From: "ImageKit.io" <45416977+imagekitio@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:53:46 +0530 Subject: [PATCH 4/4] Add licence --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2d96bbb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Imagekit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.