Skip to content

Commit

Permalink
Merge pull request #695 from jayesh12234/develop
Browse files Browse the repository at this point in the history
MOSIP-28650-fixed impressionToPick logic
  • Loading branch information
mohanachandran-s authored Jan 20, 2025
2 parents 8c27ee5 + 1f0941b commit 4d5b4a2
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automationtests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cd ${{ env.SERVICE_LOCATION }} && find ./ -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ./${{ env.SERVICE_LOCATION }}/${{ env.BUILD_ARTIFACT }}.zip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/packetcreator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
SERVICE_LOCATION: mosip-packet-creator
CONFIG_LOCATION: 'src/main/resources/dockersupport/centralized/mosip-packet-creator'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
if: ${{ ( env.BUILD_ARTIFACT != 'false' ) }}
with:
name: ${{ env.BUILD_ARTIFACT }}
Expand All @@ -60,7 +60,7 @@ jobs:
cp -r ./src/main/resources/dockersupport/centralized/mountvolume/profile_resource ./profile_resource
zip -r ${{ env.NEW_BUILD_ARTIFACT }}.zip build_files/* profile_resource
- name: Upload the springboot jars
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.NEW_BUILD_ARTIFACT }}
path: ./${{env.SERVICE_LOCATION}}/${{ env.NEW_BUILD_ARTIFACT }}.zip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
cd ${{ env.SERVICE_LOCATION }} && find ./ -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ./${{ env.SERVICE_LOCATION }}/${{ env.BUILD_ARTIFACT }}.zip
Expand Down Expand Up @@ -120,8 +120,8 @@ jobs:
SERVICE_LOCATION: mosip-packet-creator
CONFIG_LOCATION: 'src/main/resources/dockersupport/centralized/mosip-packet-creator'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
if: ${{ ( env.BUILD_ARTIFACT != 'false' ) }}
with:
name: ${{ env.BUILD_ARTIFACT }}
Expand All @@ -141,7 +141,7 @@ jobs:
cp -r ./src/main/resources/dockersupport/centralized/mountvolume/profile_resource ./profile_resource
zip -r ${{ env.NEW_BUILD_ARTIFACT }}.zip build_files/* profile_resource
- name: Upload the springboot jars
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.NEW_BUILD_ARTIFACT }}
path: ./${{env.SERVICE_LOCATION}}/${{ env.NEW_BUILD_ARTIFACT }}.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,19 @@ public static BiometricDataModel getBiometricData(Boolean bFinger, String contex
Hashtable<Integer, List<File>> tblFiles = new Hashtable<Integer, List<File>>();
File dir = new File(dirPath);

File listDir[] = dir.listFiles();
File listDir[]=null;
if (dir.isDirectory()) {
// Use FileFilter to filter files
listDir = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
// Check if it's a directory and starts with "Impression"
return file.isDirectory() && file.getName().startsWith("Impression");
}
});
} else {
logger.error(dirPath + " is not a directory.");
}
int numberOfSubfolders = listDir.length;

int min = 1;
Expand Down Expand Up @@ -1049,7 +1061,19 @@ public static BiometricDataModel updateFingerData(String contextKey) throws IOEx
Hashtable<Integer, List<File>> tblFiles = new Hashtable<Integer, List<File>>();
File dir = new File(dirPath);

File listDir[] = dir.listFiles();
File listDir[]=null;
if (dir.isDirectory()) {
// Use FileFilter to filter files
listDir = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
// Check if it's a directory and starts with "Impression"
return file.isDirectory() && file.getName().startsWith("Impression");
}
});
} else {
logger.error(dirPath + " is not a directory.");
}
int numberOfSubfolders = listDir.length;

int min = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static byte[][] getPhoto(String contextKey) {
FileFilter filter = new FileFilter() {
@Override
public boolean accept(File pathname) {
return !pathname.isDirectory();
return !pathname.isDirectory( ) && pathname.getName().startsWith("face");
}
};
File[] listDir = dir.listFiles(filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static io.restassured.RestAssured.given;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
Expand Down Expand Up @@ -128,9 +129,19 @@ public void createProfile(String profilePath,String profile, ResidentModel resid
Hashtable<Integer, List<File>> tblFiles = new Hashtable<Integer, List<File>>();
File dir = new File(dirPath);

File listDir[] = dir.listFiles();
int numberOfSubfolders = listDir.length;

File listDir[]=null;
if (dir.isDirectory()) {
// Use FileFilter to filter files
listDir = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
// Check if it's a directory and starts with "Impression"
return file.isDirectory() && file.getName().startsWith("Impression");
}
});
} else {
logger.error(dirPath + " is not a directory.");
} int numberOfSubfolders = listDir.length;
int min=1;
int max=numberOfSubfolders ;
int randomNumber = (int) (Math.random()*(max-min)) + min;
Expand Down

0 comments on commit 4d5b4a2

Please sign in to comment.