use of io.siddhi.core.exception.CannotClearSiddhiAppStateException in project siddhi by wso2.
the class FileSystemPersistenceStore method clearAllRevisions.
@Override
public void clearAllRevisions(String siddhiAppName) {
File targetDirectory = new File(folder + File.separator + siddhiAppName);
File[] files = targetDirectory.listFiles();
if (files == null || files.length == 0) {
log.info("No revisions were found to delete for the Siddhi App " + siddhiAppName);
return;
}
for (File file : files) {
if (file.exists()) {
if (!file.delete()) {
log.error("file is not deleted successfully : " + file.getName());
throw new CannotClearSiddhiAppStateException("Persistence state " + "file is not deleted : " + file.getName());
}
}
}
}
use of io.siddhi.core.exception.CannotClearSiddhiAppStateException in project siddhi by wso2.
the class IncrementalFileSystemPersistenceStore method clearAllRevisions.
@Override
public void clearAllRevisions(String siddhiAppName) {
File dir = new File(folder + File.separator + siddhiAppName);
File[] files = dir.listFiles();
if (files == null || files.length == 0) {
log.info("No revisions were found to delete for the Siddhi App " + siddhiAppName);
return;
}
for (File file : files) {
if (file.exists()) {
if (!file.delete()) {
log.error("file is not deleted successfully : " + file.getName());
throw new CannotClearSiddhiAppStateException("Persistence state " + "file is not deleted : " + file.getName());
}
}
}
}
Aggregations