public static String getOperation ( HttpString method ) { String operation = "" ; if ( Methods . POST . equals ( method ) ) { operation = WRITE ; } else if ( Methods . PUT . equals ( method ) ) { operation = WRITE ; } else if ( Methods . DELETE . equals ( method ) ) { operation = WRITE ; } else if ( Methods . GET . equals ( method ) ) { operation = READ ; } else if ( Methods . PATCH . equals ( method ) ) { operation = WRITE ; } else if ( Methods . OPTIONS . equals ( method ) ) { operation = READ ; } else if ( Methods . HEAD . equals ( method ) ) { operation = READ ; } else { // ignore everything else } return operation ; }
Return if a given HTTP method results in a read or write request to a resource