Package ca.eandb.util

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


    byte[] def = FileUtil.getFileContents(file);
    MessageDigest alg;
    try {
      alg = MessageDigest.getInstance(conf.digestAlgorithm);
    } catch (NoSuchAlgorithmException e) {
      throw new UnexpectedException(e);
    }
    return alg.digest(def);
  }
View Full Code Here

              } 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

  private byte[] getDigest(byte[] def, Configuration conf) {
    try {
      MessageDigest alg = MessageDigest.getInstance(conf.digestAlgorithm);
      return alg.digest(def);
    } catch (NoSuchAlgorithmException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

    synchronized (document) {
      int offset = document.getLength();
      try {
        document.insertString(offset, s, attributes);
      } catch (BadLocationException e) {
        throw new UnexpectedException(e);
      }
    }
  }
View Full Code Here

      objectStream.flush();
      gzipStream.finish();
      data = byteStream.toByteArray();
      objectStream.close();
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

        return object;
      } finally {
        gzipStream.close();
      }
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

        return object;
      } finally {
        gzipStream.close();
      }
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

      public void process(Queue<String> argq, T state) {
        try {
          Object value = field.get(state);
          argProcessor.process(argq, value);
        } catch (IllegalArgumentException e) {
          throw new UnexpectedException(e);
        } catch (IllegalAccessException e) {
          throw new UnexpectedException(e);
        }
      }
    });
  }
View Full Code Here

            } else if (paramType == File.class) {
              state[index] = new File(argq.remove());
            } else if (paramType == Boolean.class || paramType == boolean.class) {
              state[index] = Boolean.parseBoolean(argq.remove());
            } else {
              throw new UnexpectedException();
            }
          }
        }
      });

      // Add the command that processes its arguments and invokes the
      // method.
      addCommand(key, new Command<T>(){
        public void process(Queue<String> argq, T state) {
          Object[] params = defaultParams.clone();
          argProcessor.process(argq, params);
          try {
            method.invoke(state, params);
          } catch (IllegalArgumentException e) {
            throw new UnexpectedException(e);
          } catch (IllegalAccessException e) {
            throw new UnexpectedException(e);
          } catch (InvocationTargetException e) {
            throw new UnexpectedException(e);
          }
        }
      });
    }
  }
View Full Code Here

TOP

Related Classes of ca.eandb.util.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.