Package melnorme.utilbox.core

Examples of melnorme.utilbox.core.CommonException


    validateGoArch();
    return goArch;
  }
  public void validateGoArch() throws CommonException {
    if(goArch == null || goArch.asString().isEmpty())
      throw new CommonException("GOARCH is undefined");
  }
View Full Code Here


    validateGoOs();
    return goOs;
  }
  public void validateGoOs() throws CommonException {
    if(goOs == null || goOs.asString().isEmpty())
      throw new CommonException("GOOS is undefined");
  }
View Full Code Here

 
  protected static Path createPath(String pathString) throws CommonException {
    try {
      return MiscUtil.createPath(pathString);
    } catch (InvalidPathExceptionX e) {
      throw new CommonException("Invalid path: " + e.getCause().getMessage(), null);
    }
  }
View Full Code Here

public class ParseHelper {
 
  protected int parsePositiveInt(String str) throws CommonException {
    int integer = parseInt(str);
    if(integer < 0) {
      throw new CommonException("Integer is not positive: " + str);
    }
    return integer;
  }
View Full Code Here

  protected int parseInt(String str) throws CommonException {
    try {
      int integer = Integer.parseInt(str);
      return integer;
    } catch (NumberFormatException e) {
      throw new CommonException("Invalid integer: " + str);
    }
  }
View Full Code Here

 
  protected Path parsePath(String string) throws CommonException {
    try {
      return MiscUtil.createPath(string);
    } catch (InvalidPathExceptionX e) {
      throw new CommonException("Invalid path. ", e);
    }
  }
View Full Code Here

TOP

Related Classes of melnorme.utilbox.core.CommonException

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.