Examples of CodecException


Examples of com.robustaweb.library.commons.exception.CodecException

    public  String getUsername(String b64String) throws CodecException{
       
        String decoded = Base64Converter.decodeToString(b64String);
        int index = decoded.indexOf(":");
        if (index < 0) {
            throw new  CodecException("can't find ':' character in decoded credentials for :" + decoded);
        }
       
        return decoded.substring(0, index);
    }
View Full Code Here

Examples of com.robustaweb.library.commons.exception.CodecException

    public  String getPassword(String b64String) throws CodecException{
       
        String decoded = Base64Converter.decodeToString(b64String);
        int index = decoded.indexOf(":");
        if (index < 0) {
            throw new  CodecException("can't find ':' character in decoded credentials for :" + decoded);
        }
       
        return decoded.substring(index + 1);
    }
View Full Code Here

Examples of com.robustaweb.library.commons.exception.CodecException

    @Override
    public String getUsername(String b64String) throws CodecException {
        String decoded = decodeBase64(b64String);
        int index = decoded.indexOf(":");
        if (index < 0) {
            throw new CodecException("can't find ':' character in decoded credentials for :" + decoded);
        }

        return decoded.substring(0, index);
    }
View Full Code Here

Examples of com.robustaweb.library.commons.exception.CodecException

    @Override
    public String getPassword(String b64String) throws CodecException {
        String decoded = decodeBase64(b64String);
        int index = decoded.indexOf(":");
        if (index < 0) {
            throw new CodecException("can't find ':' character in decoded credentials for :" + decoded);
        }

        return decoded.substring(index + 1);
    }
View Full Code Here

Examples of io.netty.handler.codec.CodecException

    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, SctpMessage msg) throws Exception {
        if (!msg.isComplete()) {
            throw new CodecException(String.format("Received SctpMessage is not complete, please add %s in the " +
                    "pipeline before this handler", SctpMessageCompletionHandler.class.getSimpleName()));
        }

        ctx.nextInboundByteBuffer().writeBytes(msg.data());
        ctx.fireInboundBufferUpdated();
View Full Code Here

Examples of io.netty.handler.codec.CodecException

                        if (validExtension != null && ((validExtension.rsv() & rsv) == 0)) {
                            rsv = rsv | validExtension.rsv();
                            validExtensions.add(validExtension);
                        } else {
                            throw new CodecException(
                                    "invalid WebSocket Extension handhshake for \"" + extensionsHeader + "\"");
                        }
                    }

                    for (WebSocketClientExtension validExtension : validExtensions) {
View Full Code Here

Examples of io.netty.handler.codec.CodecException

    @Override
    protected void decode(ChannelHandlerContext ctx, WebSocketFrame msg, List<Object> out) throws Exception {
        if (decoder == null) {
            if (!(msg instanceof TextWebSocketFrame) && !(msg instanceof BinaryWebSocketFrame)) {
                throw new CodecException("unexpected initial frame type: " + msg.getClass().getName());
            }
            decoder = new EmbeddedChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE));
        }

        decoder.writeInbound(msg.content().retain());
        if (appendFrameTail(msg)) {
            decoder.writeInbound(Unpooled.wrappedBuffer(FRAME_TAIL));
        }

        CompositeByteBuf compositeUncompressedContent = ctx.alloc().compositeBuffer();
        for (;;) {
            ByteBuf partUncompressedContent = decoder.readInbound();
            if (partUncompressedContent == null) {
                break;
            }
            if (!partUncompressedContent.isReadable()) {
                partUncompressedContent.release();
                continue;
            }
            compositeUncompressedContent.addComponent(partUncompressedContent);
            compositeUncompressedContent.writerIndex(compositeUncompressedContent.writerIndex() +
                    partUncompressedContent.readableBytes());
        }
        if (compositeUncompressedContent.numComponents() <= 0) {
            compositeUncompressedContent.release();
            throw new CodecException("cannot read uncompressed buffer");
        }

        if (msg.isFinalFragment() && noContext) {
            cleanup();
        }

        WebSocketFrame outMsg;
        if (msg instanceof TextWebSocketFrame) {
            outMsg = new TextWebSocketFrame(msg.isFinalFragment(), newRsv(msg), compositeUncompressedContent);
        } else if (msg instanceof BinaryWebSocketFrame) {
            outMsg = new BinaryWebSocketFrame(msg.isFinalFragment(), newRsv(msg), compositeUncompressedContent);
        } else if (msg instanceof ContinuationWebSocketFrame) {
            outMsg = new ContinuationWebSocketFrame(msg.isFinalFragment(), newRsv(msg),
                    compositeUncompressedContent);
        } else {
            throw new CodecException("unexpected frame type: " + msg.getClass().getName());
        }
        out.add(outMsg);
    }
View Full Code Here

Examples of io.netty.handler.codec.CodecException

            fullCompressedContent.writerIndex(fullCompressedContent.writerIndex() +
                    partCompressedContent.readableBytes());
        }
        if (fullCompressedContent.numComponents() <= 0) {
            fullCompressedContent.release();
            throw new CodecException("cannot read compressed buffer");
        }

        if (msg.isFinalFragment() && noContext) {
            cleanup();
        }

        ByteBuf compressedContent;
        if (removeFrameTail(msg)) {
            int realLength = fullCompressedContent.readableBytes() - FRAME_TAIL.length;
            compressedContent = fullCompressedContent.slice(0, realLength);
        } else {
            compressedContent = fullCompressedContent;
        }

        WebSocketFrame outMsg;
        if (msg instanceof TextWebSocketFrame) {
            outMsg = new TextWebSocketFrame(msg.isFinalFragment(), rsv(msg), compressedContent);
        } else if (msg instanceof BinaryWebSocketFrame) {
            outMsg = new BinaryWebSocketFrame(msg.isFinalFragment(), rsv(msg), compressedContent);
        } else if (msg instanceof ContinuationWebSocketFrame) {
            outMsg = new ContinuationWebSocketFrame(msg.isFinalFragment(), rsv(msg), compressedContent);
        } else {
            throw new CodecException("unexpected frame type: " + msg.getClass().getName());
        }
        out.add(outMsg);
    }
View Full Code Here

Examples of io.netty.handler.codec.CodecException

                        if (validExtension != null && ((validExtension.rsv() & rsv) == 0)) {
                            rsv = rsv | validExtension.rsv();
                            validExtensions.add(validExtension);
                        } else {
                            throw new CodecException(
                                    "invalid WebSocket Extension handhshake for \"" + extensionsHeader + "\"");
                        }
                    }

                    for (WebSocketClientExtension validExtension : validExtensions) {
View Full Code Here

Examples of jade.content.lang.Codec.CodecException

   * to the ontology used for this operation.
   */
  public void fillContent(ACLMessage msg, AbsContentElement content) throws CodecException, OntologyException {
    Codec    codec = lookupLanguage(msg.getLanguage());
    if (codec == null) {
      throw new CodecException("Unknown language "+msg.getLanguage());
    }
    String ontoName = msg.getOntology();
    Ontology o = null;
    if (ontoName != null) {
      o = lookupOntology(ontoName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.