Package org.apache.turbine.util

Examples of org.apache.turbine.util.TurbineException


        }
        catch (Exception e)
        {
            log.error("Error sending file to server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here


        }
        catch (Exception e)
        {
            log.error("Error sending file to server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here

                    destinationLocationProperty, destinationFileName);
        }
        catch (Exception e)
        {
            log.error("Error getting file from server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here

                    destinationLocationProperty, destinationFileName);
        }
        catch (Exception e)
        {
            log.error("Error getting file from server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here

            TurbineXmlRpc.executeRpc(new URL(serverURL), "file.remove", params);
        }
        catch (Exception e)
        {
            log.error("Error removing file from server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here

                    params);
        }
        catch (Exception e)
        {
            log.error("Error removing file from server:", e);
            throw new TurbineException(e);
        }
    }
View Full Code Here

            throws TurbineException
    {
        String contentType = req.getHeader(CONTENT_TYPE);
        if (!contentType.startsWith(MULTIPART_FORM_DATA))
        {
            throw new TurbineException("the request doesn't contain a " +
                    MULTIPART_FORM_DATA + " stream");
        }
        int requestSize = req.getContentLength();
        if (requestSize == -1)
        {
            throw new TurbineException("the request was rejected because " +
                    "it's size is unknown");
        }
        if (requestSize > getSizeMax())
        {
            throw new TurbineException("the request was rejected because " +
                    "it's size exceeds allowed range");
        }

        try
        {
            List fileList = fileUpload
                    .parseRequest(req,
                            getSizeThreshold(),
                            getSizeMax(),
                            path);

            if (fileList != null)
            {
                for (Iterator it = fileList.iterator(); it.hasNext();)
                {
                    FileItem fi = (FileItem) it.next();
                    if (fi.isFormField())
                    {
                        log.debug("Found an simple form field: " + fi.getFieldName() +", adding value " + fi.getString());
                       
                        String value = null;
                        try
                        {
                            value = fi.getString(params.getCharacterEncoding());
                        }
                        catch (UnsupportedEncodingException e)
                        {
                            log.error(params.getCharacterEncoding()
                                    + " encoding is not supported."
                                    + "Used the default when reading form data.");
                            value = fi.getString();
                        }
                        params.append(fi.getFieldName(), value);
                    }
                    else
                    {
                        log.debug("Found an uploaded file: " + fi.getFieldName());
                        log.debug("It has " + fi.getSize() + " Bytes and is " + (fi.isInMemory() ? "" : "not ") + "in Memory");
                        log.debug("Adding FileItem as " + fi.getFieldName() + " to the params");
                        params.append(fi.getFieldName(), fi);
                    }
                }
            }
        }
        catch (FileUploadException e)
        {
            throw new TurbineException(e);
        }
    }
View Full Code Here

    public void doBuild(RunData data)
        throws Exception
    {
        if (!data.isOutSet())
        {
            throw new TurbineException(
                "data.declareDirectResponse() has not been called");
        }
    }
View Full Code Here

            if (screen == null)
            {
                String errMsg = "Couldn't map Template "
                    + template + " to any Screen class!";
                log.error(errMsg);
                throw new TurbineException(errMsg);
            }
            data.setScreen(screen);
        }
    }
View Full Code Here

                    {
                        data.getPage().setDoctype(new Doctype.Html40Frameset());
                    }
                    else
                    {
                        throw new TurbineException(errMsg);
                    }
                    break;
                }
            case 2:
                {
                    data.getPage()
                        .setDoctype(new Doctype()
                                    .setIdentifier((String) doctypeProperty.get(0))
                                    .setUri((String) doctypeProperty.get(1)));
                    break;
                }
            default:
                {
                    throw new TurbineException(errMsg);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.TurbineException

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.