Examples of UnexpectedException


Examples of ca.eandb.util.UnexpectedException

              } else if (conf.verbose) {
                System.out.print("= ");
                System.out.println(className);
              }
            } catch (FileNotFoundException e) {
              throw new UnexpectedException(e);
            } catch (IOException e) {
              System.out.print("E ");
              System.out.println(className);
            }
          }
View Full Code Here

Examples of com.braintreegateway.exceptions.UnexpectedException

            InputStream is = getClass().getClassLoader().getResourceAsStream(propertyFile);
            Properties p = new Properties();
            p.load(is);
            return p;
        } catch (IOException e) {
            throw new UnexpectedException("Couldn't load " + BRAINTREE_PROPERTY_FILE + " can't continue", e);
        }
    }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.UnexpectedException

    }

    protected SuspendInfo suspend() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm = getAtmosphereResource();
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        atm.getRequest().setAttribute(GWT_SUSPENDED, true);
        atm.suspend(-1, false);
        return new SuspendInfo(atm);
    }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.UnexpectedException

    }

    protected boolean isSuspended() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm = getAtmosphereResource();
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        Boolean var = (Boolean)atm.getRequest().getAttribute(GWT_SUSPENDED);
        return Boolean.TRUE.equals(var);
    }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.UnexpectedException

    private AtmosphereResource<HttpServletRequest, HttpServletResponse> getAtmosphereResource() {
        AtmosphereResource<HttpServletRequest, HttpServletResponse> atm =
                (AtmosphereResource<HttpServletRequest, HttpServletResponse>)
                getThreadLocalRequest().getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE);
        if (atm == null) {
            throw new UnexpectedException("Failed to find Atmosphere resource have you setup Atmosphere?", null);
        }
        return atm;
    }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.UnexpectedException

            throw new NullPointerException("streamWriter");
        }

        if (serviceMethod != null
                && !RPC1524.isExpectedException(serviceMethod, cause)) {
            throw new UnexpectedException("Service method '"
                    + getSourceRepresentation(serviceMethod)
                    + "' threw an unexpected exception: "
                    + cause.toString(), cause);
        }
View Full Code Here

Examples of com.jdroid.java.exception.UnexpectedException

   */
  public static List<String> fromCSV(File csvFile) {
    try {
      return CSVUtils.fromCSV(new FileInputStream(csvFile));
    } catch (IOException exception) {
      throw new UnexpectedException("Error reading the file: " + csvFile, exception);
    }
  }
View Full Code Here

Examples of com.jdroid.java.exception.UnexpectedException

        return result;
      } finally {
        csvReader.close();
      }
    } catch (IOException exception) {
      throw new UnexpectedException("Error reading the csv", exception);
    }
  }
View Full Code Here

Examples of com.jdroid.java.exception.UnexpectedException

      String fileName = "csv_file" + DateUtils.now().getTime();
      File file = File.createTempFile(fileName, ".csv");
      CSVUtils.writeCSV(new FileOutputStream(file), values);
      return file;
    } catch (IOException exception) {
      throw new UnexpectedException("Error creating a temporal file to write the csv values", exception);
    }
  }
View Full Code Here

Examples of com.jdroid.java.exception.UnexpectedException

    try {
      CSVWriter csvWriter = new CSVWriter(writer, separator, CSVWriter.NO_QUOTE_CHARACTER, StringUtils.EMPTY);
      csvWriter.writeNext(valueConverter.toArray(values));
      csvWriter.close();
    } catch (IOException exception) {
      throw new UnexpectedException("Error writing the values", exception);
    }
  }
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.