Example usage for java.net UnknownServiceException initCause

List of usage examples for java.net UnknownServiceException initCause

Introduction

In this page you can find the example usage for java.net UnknownServiceException initCause.

Prototype

public synchronized Throwable initCause(Throwable cause) 

Source Link

Document

Initializes the cause of this throwable to the specified value.

Usage

From source file:org.apache.shindig.protocol.multipart.DefaultMultipartFormParser.java

public Collection<FormDataItem> parse(HttpServletRequest servletRequest) throws IOException {
    FileItemFactory factory = new DiskFileItemFactory();
    ServletFileUpload upload = new ServletFileUpload(factory);

    try {/*from   ww w. j a va  2s . c  o m*/
        @SuppressWarnings("unchecked")
        List<FileItem> fileItems = upload.parseRequest(servletRequest);
        return convertToFormData(fileItems);
    } catch (FileUploadException e) {
        UnknownServiceException use = new UnknownServiceException("File upload error.");
        use.initCause(e);
        throw use;
    }
}