Package com.xmlcalabash.core

Examples of com.xmlcalabash.core.XProcException


        // Also no need to close the input stream here, since 
        // DataStore implementations close the input stream when
        // necessary.
      }
    } catch (IOException ioe) {
            throw new XProcException(XProcConstants.dynamicError(29), ioe);
        }
        return documents;
    }
View Full Code Here


                    b = '\n';
                }
            }

            if (b < 0) {
                throw new XProcException("Got -1 reading stream...");
            }
            switch (state) {
                case H_NAME:
                    if (b == '\n') {
                        state = H_DONE;
                    } else {
                        if (b == ':') {
                            state = H_VALUE;
                        } else {
                            name += (char) b;
                        }
                    }
                    break;
                case H_VALUE:
                    if (b == '\n') {
                        if (peek == ' ' || peek == '\t') {
                            // nop, we'll catch this on the next loop
                        } else {
                            state = H_DONE;
                        }
                    } else {
                        value += (char) b;
                    }
                    break;
                default:
                    throw new XProcException("Default in getHeader?");
            }
        }

        if ("".equals(name)) {
            return null;
View Full Code Here

    protected URI getDataUri(String uri) {
        try {
            return new URI(uri);
        } catch (URISyntaxException use) {
            throw new XProcException(use);
        }
    }
View Full Code Here

                    b = '\n';
                }
            }

            if (b < 0) {
                throw new XProcException("Got -1 reading stream...");
            }

            if (b == '\n') {
                done = true;
            } else {
View Full Code Here

        while (contentLength > 0) {
            try {
                int len = stream.read(bodybytes, pos, contentLength);
                if (len < 0) {
                    throw new XProcException("Read returned -1?");
                }
                pos += len;
                contentLength -= len;
            } catch (IOException ioe) {
                throw new XProcException(ioe);
            }
        }

        // The separator has to be at the start of a line...
        int peek = peekByte();
        if (peek == '\r') {
            nextByte();
            peek = peekByte();
        }

        if (peek == '\n') {
            nextByte();
        }

        String line = getLine();
        if (!separator.equals(line) && !lastsep.equals(line)) {
            throw new XProcException("MIME multipart missing separator?");
        }

        return new ByteArrayInputStream(bodybytes);
    }
View Full Code Here

        int sepidx = 0;
        int state = B_SOL;
        while (!done) {
            int b = nextByte();
            if (b < 0) {
                throw new XProcException("Got -1 in readBodyPart?");
            }

            if (bodyidx == bodysize) {
                byte newbytes[] = new byte[bodysize + bodygrow];
                System.arraycopy(bodybytes, 0, newbytes, 0, bodysize);
View Full Code Here

            return peek;
        } else {
            try {
                peek = stream.read();
            } catch (IOException ioe) {
                throw new XProcException(ioe);
            }
            return peek;
        }
    }
View Full Code Here

            return v;
        } else {
            try {
                return stream.read();
            } catch (IOException ioe) {
                throw new XProcException(ioe);
            }
        }
    }
View Full Code Here

        throw new XProcException("The root step can't have getVariables!");
    }
*/

    public RuntimeValue getVariable(QName name) {
        throw new XProcException("The root step doesn't have getVariables!");
    }
View Full Code Here

                    result.write(tree.getResult());
                }
            });
        } catch (FileNotFoundException fnfe) {
            URI uri = href.getBaseURI().resolve(href.getString());
            throw new XProcException(step.getNode(), "Cannot copy: file does not exist: " + uri.toASCIIString());
        } catch (IOException ioe) {
            throw new XProcException(step.getNode(), ioe);
        }
    }
View Full Code Here

TOP

Related Classes of com.xmlcalabash.core.XProcException

Copyright © 2018 www.massapicom. 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.