60616263646566
validateGoArch(); return goArch; } public void validateGoArch() throws CommonException { if(goArch == null || goArch.asString().isEmpty()) throw new CommonException("GOARCH is undefined"); }
69707172737475
validateGoOs(); return goOs; } public void validateGoOs() throws CommonException { if(goOs == null || goOs.asString().isEmpty()) throw new CommonException("GOOS is undefined"); }
135136137138139140141142
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); } }
222324252627282930
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; }
3233343536373839
protected int parseInt(String str) throws CommonException { try { int integer = Integer.parseInt(str); return integer; } catch (NumberFormatException e) { throw new CommonException("Invalid integer: " + str); } }
4041424344454647
protected Path parsePath(String string) throws CommonException { try { return MiscUtil.createPath(string); } catch (InvalidPathExceptionX e) { throw new CommonException("Invalid path. ", e); } }