@Override
    public String getLastRevision(String siddhiAppName) {
        long restoreTime = -1;
        IncrementalSnapshotInfo lastSnapshotInfo = null;
        File dir = new File(folder + File.separator + siddhiAppName);
        File[] files = dir.listFiles();
        if (files == null || files.length == 0) {
            return null;
        }
        for (File file : files) {
            String fileName = file.getName();
            IncrementalSnapshotInfo snapshotInfo = PersistenceHelper.convertRevision(fileName);
            if (snapshotInfo.getTime() > restoreTime &&
                    siddhiAppName.equals(snapshotInfo.getSiddhiAppId()) &&
                    snapshotInfo.getId() != null &&
                    snapshotInfo.getQueryName() != null) {
                //Note: Here we discard the (items.length == 2) scenario which is handled
                // by the full snapshot handling
                restoreTime = snapshotInfo.getTime();
                lastSnapshotInfo = snapshotInfo;
            }
        }
        if (restoreTime != -1) {
            if (log.isDebugEnabled()) {
                log.debug("Latest revision to load: " + restoreTime + PersistenceConstants.REVISION_SEPARATOR +
                        siddhiAppName);
            }
            return lastSnapshotInfo.getRevision();
        }
        return null;
    }
Implementation of Persistence Store that would persist snapshots to the file system
modules/siddhi-core/src/main/java/io/siddhi/core/util/persistence/IncrementalFileSystemPersistenceStore.java