sunlabs.brazil.handler

Class PushHandler

public class PushHandler extends Object implements Handler

Skeleton Handler for uploading files using multipart/form-data. Application specific functionality is added by overriding {@link #processData}.
NOTE: Most applications will want to use the {@link sunlabs.brazil.template.MultipartSetTemplate} to deal with multipart/form data.

Properties:

prefix, suffix, glob, match
Specify the URL that triggers this handler. (See {@link MatchString}).

Version: 2.2, 06/11/13

Author: Stephen Uhler

Nested Class Summary
static classPushHandler.Split
Split multipart data into its constituent pieces.
Method Summary
static intindexOf(byte[] src, int srcStart, int srcEnd, byte[] dst, int dstStart, int dstEnd)
Find the index of dst in src or -1 if not found > This is the byte array equivalent to string.indexOf()
static intindexOf(byte[] src, int srcStart, int srcEnd, String dst)
booleaninit(Server server, String prefix)
booleanprocessData(Request request)
process the data - this doesn't currently do anything useful.
booleanrespond(Request request)
Make sure this is one of our requests.

Method Detail

indexOf

public static int indexOf(byte[] src, int srcStart, int srcEnd, byte[] dst, int dstStart, int dstEnd)
Find the index of dst in src or -1 if not found > This is the byte array equivalent to string.indexOf()

indexOf

public static int indexOf(byte[] src, int srcStart, int srcEnd, String dst)

init

public boolean init(Server server, String prefix)

processData

public boolean processData(Request request)
process the data - this doesn't currently do anything useful.

respond

public boolean respond(Request request)
Make sure this is one of our requests. IF OK, save file to proper spot.