Deleting Bix Generated Files in the Pega server location

As part of our project, we are generating BIX Files on the daily basis in the Local directory within PEGA Server.

I am currently looking for PEGA based solution to delete the files older than a month from server. Is there any ootb or any other solution to implement this.

@BharanideviK there is no ootb solution available for this… but technically you can implement a file delete program in java step of your activity and schedule a job scheduler to run it every day. a sample program

File fold = new File(dirPath);

if (fold.exists()) {

File listAllFiles = folder.listAllFiles();

long Deletion = System.currentTimeMillis() -

(nday * 24 * 60 * 60 * 1000 L);

for (File listFile: listAllFiles) {

if (listFile.getName().endsWith(extension) &&

listFile.lastModified() < Deletion) {

if (!listFile.delete()) {

System.out.println(“Sorry can’t delete”);

}

}

}

}

here nday is your number of days.

@SriharshaAnika Thanks that worked. i have modified the code a litte and it is working as expected. thanks much