List of usage examples for java.lang IllegalArgumentException printStackTrace
public void printStackTrace()
From source file:org.dcm4che.tool.dcmdir.DcmDir.java
@SuppressWarnings("unchecked") public static void main(String[] args) { try {//www. ja va2 s . c o m CommandLine cl = parseComandLine(args); DcmDir main = new DcmDir(); main.setInUse(cl.hasOption("in-use")); main.setEncodingOptions(CLIUtils.encodingOptionsOf(cl)); CLIUtils.configure(main.fsInfo, cl); main.setOriginalSequenceLength(cl.hasOption("orig-seq-len")); if (cl.hasOption("w")) { String s = cl.getOptionValue("w"); try { main.setWidth(Integer.parseInt(s)); } catch (IllegalArgumentException e) { throw new ParseException(MessageFormat.format(rb.getString("illegal-width"), s)); } } try { List<String> argList = cl.getArgList(); long start = System.currentTimeMillis(); if (cl.hasOption("l")) { main.openForReadOnly(new File(cl.getOptionValue("l"))); main.list(); } else if (cl.hasOption("d")) { main.open(new File(cl.getOptionValue("d"))); int num = 0; for (String arg : argList) num += main.removeReferenceTo(new File(arg)); main.close(); long end = System.currentTimeMillis(); System.out.println(); System.out.println( MessageFormat.format(rb.getString("deleted"), num, main.getFile(), (end - start))); } else if (cl.hasOption("p")) { main.open(new File(cl.getOptionValue("p"))); int num = main.purge(); main.close(); long end = System.currentTimeMillis(); System.out.println( MessageFormat.format(rb.getString("purged"), num, main.getFile(), (end - start))); } else if (cl.hasOption("z")) { String fpath = cl.getOptionValue("z"); File f = new File(fpath); File bak = new File(fpath + "~"); main.compact(f, bak); long end = System.currentTimeMillis(); System.out.println(MessageFormat.format(rb.getString("compacted"), f, bak.length(), f.length(), (end - start))); } else { if (cl.hasOption("c")) { main.create(new File(cl.getOptionValue("c"))); } else if (cl.hasOption("u")) { main.open(new File(cl.getOptionValue("u"))); } main.setRecordFactory(new RecordFactory()); int num = 0; for (String arg : argList) num += main.addReferenceTo(new File(arg)); main.close(); long end = System.currentTimeMillis(); System.out.println(); System.out.println( MessageFormat.format(rb.getString("added"), num, main.getFile(), (end - start))); } } finally { main.close(); } } catch (ParseException e) { System.err.println("dcmdir: " + e.getMessage()); System.err.println(rb.getString("try")); System.exit(2); } catch (IOException e) { System.err.println("dcmdir: " + e.getMessage()); e.printStackTrace(); System.exit(2); } }
From source file:Main.java
public static DateTime createTimeUTC(String UTCrepresentation) { DateTimeFormatter UTCformat = null; try {// ww w . j ava 2 s . c o m UTCformat = DateTimeFormat.forPattern("YYYYMMdd'T'HHmmssZ"); } catch (IllegalArgumentException e) { e.printStackTrace(); } return UTCformat.parseDateTime(UTCrepresentation); }
From source file:Main.java
public static void printObject(Object object) { Class<?> class1 = object.getClass(); Field[] fields = class1.getDeclaredFields(); for (Field field : fields) { try {/*from w ww. j a v a2 s .co m*/ field.setAccessible(true); } catch (IllegalArgumentException e) { e.printStackTrace(); } } }
From source file:Main.java
public static void printAllInform(Class clsShow) { try {/*from ww w .j a v a 2s.co m*/ int i; for (i = 0; i < clsShow.getMethods().length; i++) { } for (i = 0; i < clsShow.getFields().length; i++) { } } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalArgumentException e2) { e2.printStackTrace(); } catch (Exception e3) { e3.printStackTrace(); } }
From source file:Main.java
/** * force show virtual menu key </br> * must call after setContentView() //from w ww . ja va 2s . c om * @param window you can use getWindow() */ public static void forceShowMenuKey(Window window) { try { window.addFlags(WindowManager.LayoutParams.class.getField("FLAG_NEEDS_MENU_KEY").getInt(null)); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); } }
From source file:Main.java
public static long getCurrMillis() { long _t = 0L; try {//from w ww .j a va2 s.c o m _t = Calendar.getInstance(Locale.getDefault()).getTimeInMillis(); return _t; } catch (IllegalArgumentException e) { e.printStackTrace(); } _t = new Date().getTime(); return _t; }
From source file:Main.java
public static void removeCustomProgressDialog() { try {/*from w ww . j a v a 2 s. c om*/ if (mDialog != null) { mDialog.dismiss(); mDialog = null; } } catch (IllegalArgumentException ie) { ie.printStackTrace(); } catch (RuntimeException re) { re.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
From source file:Main.java
public static void removeSimpleProgressDialog() { try {/*w ww . j a va2 s .c om*/ if (mProgressDialog != null) { if (mProgressDialog.isShowing()) { mProgressDialog.dismiss(); mProgressDialog = null; } } } catch (IllegalArgumentException ie) { ie.printStackTrace(); } catch (RuntimeException re) { re.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
From source file:Main.java
public static void removeCustomeProgressDialog() { try {//from ww w.ja v a 2 s .c o m if (mDialog != null) { if (mDialog.isShowing()) { mDialog.dismiss(); mDialog = null; } } } catch (IllegalArgumentException ie) { ie.printStackTrace(); } catch (RuntimeException re) { re.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
From source file:Main.java
public static void showSimpleProgressDialog(Context context, String title, String msg, boolean isCancelable) { try {//from www .jav a 2 s. c om if (mProgressDialog == null) { mProgressDialog = ProgressDialog.show(context, title, msg); mProgressDialog.setCancelable(isCancelable); } if (!mProgressDialog.isShowing()) { mProgressDialog.show(); } } catch (IllegalArgumentException ie) { ie.printStackTrace(); } catch (RuntimeException re) { re.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }