// Path: app/src/main/java/io/rapidpro/surveyor/Logger.java
// public class Logger {
// 
//     private static final String TAG = "Surveyor";
// 
//     public static void e(String message, Throwable t) {
//         Log.e(TAG, message, t);
//     }
// 
//     public static void w(String message) {
//         Log.w(TAG, message);
//     }
// 
//     public static void d(String message) {
//         Log.d(TAG, message);
//     }
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/utils/SurveyUtils.java
// public class SurveyUtils {
//     /**
//      * Creates a nested directory
//      *
//      * @param root    the root directory
//      * @param folders the nested directory names
//      * @return the directory
//      * @throws IOException if any directory couldn't be created
//      */
//     public static File mkdir(File root, String... folders) throws IOException {
//         File current = root;
//         for (String folder : folders) {
//             current = new File(current, folder);
// 
//             if (!current.exists() && !current.mkdirs()) {
//                 throw new IOException("Unable to create directory: " + current.getAbsolutePath());
//             }
//         }
//         return current;
//     }
// }


import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import io.rapidpro.surveyor.Logger;
import io.rapidpro.surveyor.utils.SurveyUtils;
package io.rapidpro.surveyor.data;




/**
 * Directory based service for flow session submissions
 */
public class SubmissionService {

    private File rootDir;

    private static FileFilter DIR_FILTER = DirectoryFileFilter.INSTANCE;

    /**
     * Creates a new submission service
     *
     * @param rootDir the root directory
     */
    public SubmissionService(File rootDir) {
        this.rootDir = rootDir;

// Path: app/src/main/java/io/rapidpro/surveyor/Logger.java
// public class Logger {
// 
//     private static final String TAG = "Surveyor";
// 
//     public static void e(String message, Throwable t) {
//         Log.e(TAG, message, t);
//     }
// 
//     public static void w(String message) {
//         Log.w(TAG, message);
//     }
// 
//     public static void d(String message) {
//         Log.d(TAG, message);
//     }
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/utils/SurveyUtils.java
// public class SurveyUtils {
//     /**
//      * Creates a nested directory
//      *
//      * @param root    the root directory
//      * @param folders the nested directory names
//      * @return the directory
//      * @throws IOException if any directory couldn't be created
//      */
//     public static File mkdir(File root, String... folders) throws IOException {
//         File current = root;
//         for (String folder : folders) {
//             current = new File(current, folder);
// 
//             if (!current.exists() && !current.mkdirs()) {
//                 throw new IOException("Unable to create directory: " + current.getAbsolutePath());
//             }
//         }
//         return current;
//     }
// }


// Path: app/src/main/java/io/rapidpro/surveyor/data/SubmissionService.java
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import io.rapidpro.surveyor.Logger;
import io.rapidpro.surveyor.utils.SurveyUtils;

package io.rapidpro.surveyor.data;




/**
 * Directory based service for flow session submissions
 */
public class SubmissionService {

    private File rootDir;

    private static FileFilter DIR_FILTER = DirectoryFileFilter.INSTANCE;

    /**
     * Creates a new submission service
     *
     * @param rootDir the root directory
     */
    public SubmissionService(File rootDir) {
        this.rootDir = rootDir;

        Logger.d("SubmissionService created for directory " + this.rootDir.getAbsolutePath());