Package ca.eandb.util

Examples of ca.eandb.util.UnexpectedException


      try {
        if (!FileUtil.isAncestor(file, workingDirectory)) {
          throw new IllegalArgumentException("path must not reference parent directory.");
        }
      } catch (IOException e) {
        throw new UnexpectedException(e);
      }
      return file;
    }
View Full Code Here


          File dir = file.getParentFile();
          dir.mkdirs();
          try {
            return new FileOutputStream(file);
          } catch (FileNotFoundException e) {
            throw new UnexpectedException(e);
          }
        }
      });
    }
View Full Code Here

          File dir = file.getParentFile();
          dir.mkdirs();
          try {
            return new RandomAccessFile(file, "rw");
          } catch (FileNotFoundException e) {
            throw new UnexpectedException(e);
          }
        }
      });
    }
View Full Code Here

      MessageDigest md5 = MessageDigest.getInstance("MD5");
      Class<?> cl = Class.forName(name);
      ClassUtil.getClassDigest(cl, md5);
      return md5.digest();
    } catch (NoSuchAlgorithmException e) {
      throw new UnexpectedException(e);
    } catch (ClassNotFoundException e) {
      return null;
    }
  }
View Full Code Here

      /*
       * This should not happen.  getUrlForCacheEntry should ensure that the
       * URL is valid.
       */
      throw new UnexpectedException(e);

    } catch (IOException e) {

      e.printStackTrace();

View Full Code Here

   */
  private URL getUrlForCacheEntry(String name, byte[] digest) {
    try {
      return new URL(baseUrl, name.replace('.', '/') + StringUtil.toHex(digest));
    } catch (MalformedURLException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

            if (idleBegin()) {
              try {
                int seconds = (Integer) taskDesc.getTask().deserialize();
                this.idle(seconds);
              } catch (ClassNotFoundException 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.