Package com.jdroid.java.exception

Examples of com.jdroid.java.exception.UnexpectedException


     
      return getResponse();
    } catch (IOException e) {
      throw new ConnectionException(e);
    } catch (SAXException e) {
      throw new UnexpectedException(e);
    } finally {
      LOGGER.debug("Parsing finished.");
    }
  }
View Full Code Here


  public final void startElement(String uri, String localName, String qName, Attributes attributes) {
    try {
      super.startElement(uri, localName, qName, attributes);
      this.onStartElement(localName, attributes);
    } catch (SAXException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

    try {
      super.endElement(uri, localName, qName);
      this.onEndElement(localName, builder.toString().trim());
      builder.setLength(0);
    } catch (SAXException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

  }
 
  public Device(String deviceId, String registrationId, DeviceType deviceType) {
   
    if (deviceType == null) {
      throw new UnexpectedException("The device type is required");
    }
    this.deviceType = deviceType;
   
    this.deviceId = deviceId;
    this.registrationId = registrationId;
View Full Code Here

      return (T)PropertyUtils.getNestedProperty(from, this.propertyName);
    } catch (NestedNullException exception) {
      // if any the nested objects is null we return null as value
      return null;
    } catch (Exception ex) {
      throw new UnexpectedException("Error getting the property: '" + this.propertyName + "' of: " + from);
    }
  }
View Full Code Here

    simulateCrash();
   
    if (parser != null) {
      InputStream inputStream = getClass().getClassLoader().getResourceAsStream(filePath);
      if (inputStream == null) {
        throw new UnexpectedException("The mocked file wasn't found");
      }
      // Parse the stream
      T t = (T)(parser.parse(inputStream));
      FileUtils.safeClose(inputStream);
      return t;
View Full Code Here

  public static File createTempFile() {
    File file = null;
    try {
      file = File.createTempFile("tempFile", ".tmp");
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
    return file;
  }
View Full Code Here

   
    File file = null;
    try {
      file = File.createTempFile("tempFile", ".tmp");
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
    try {
      PrintWriter printWriter = new PrintWriter(file);
      printWriter.append(content);
      printWriter.close();
      return file;
    } catch (FileNotFoundException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

      new File(parentPath).mkdirs();
      PrintWriter printWriter = new PrintWriter(parentPath + File.separatorChar + fileName);
      printWriter.append(StringUtils.defaultString(content));
      printWriter.close();
    } catch (FileNotFoundException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

    } catch (ClientProtocolException e) {
      Throwable cause = e.getCause();
      if ((cause != null) && (cause instanceof CircularRedirectException)) {
        throw new ConnectionException(e, false);
      } else {
        throw new UnexpectedException(e);
      }
    } catch (ConnectTimeoutException e) {
      throw new ConnectionException(e, true);
    } catch (IOException e) {
      throw new ConnectionException(e, false);
View Full Code Here

TOP

Related Classes of com.jdroid.java.exception.UnexpectedException

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.