// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/ConfigurationServlet.java
// public static final String CAMERA_KEY = "camera";


import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import javax.servlet.ServletContext;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.onebeartoe.application.Enums;
import static org.onebeartoe.electronics.photorama.ConfigurationServlet.CAMERA_KEY;
import org.onebeartoe.web.PlainTextResponseServlet;

        switch(mode)
        {
            case FOOT_PEDAL:
            {
                subpath = "foot-pedal/";
                break;
            }
            case PHOTO_BOOTH:
            {
                subpath = "photo-booth/";
                break;
            }
            case TIME_LAPSE:
            {
                subpath = "time-lapse/";
                break;
            }
            default:
            {
                // off
                subpath = "";
            }
        }
        
        return subpath;
    }
    
    private String updateMode(PhotoramaModes mode)
    {        
        ServletContext context = getServletContext();

// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/ConfigurationServlet.java
// public static final String CAMERA_KEY = "camera";


// Path: photorama-raspberry-pi-webapp/src/main/java/org/onebeartoe/electronics/photorama/ModeServlet.java
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import javax.servlet.ServletContext;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.onebeartoe.application.Enums;
import static org.onebeartoe.electronics.photorama.ConfigurationServlet.CAMERA_KEY;
import org.onebeartoe.web.PlainTextResponseServlet;

        switch(mode)
        {
            case FOOT_PEDAL:
            {
                subpath = "foot-pedal/";
                break;
            }
            case PHOTO_BOOTH:
            {
                subpath = "photo-booth/";
                break;
            }
            case TIME_LAPSE:
            {
                subpath = "time-lapse/";
                break;
            }
            default:
            {
                // off
                subpath = "";
            }
        }
        
        return subpath;
    }
    
    private String updateMode(PhotoramaModes mode)
    {        
        ServletContext context = getServletContext();

        Camera camera = (Camera) context.getAttribute(CAMERA_KEY);
