From 9a584f04694107337d16b443329e729d500f0f09 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 15 Jul 2004 00:24:17 +0000 Subject: [PATCH] remove obsolete class --- .../src/net/hyperic/sigar/cmd/PidFinder.java | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 bindings/java/src/net/hyperic/sigar/cmd/PidFinder.java diff --git a/bindings/java/src/net/hyperic/sigar/cmd/PidFinder.java b/bindings/java/src/net/hyperic/sigar/cmd/PidFinder.java deleted file mode 100644 index e10a03a0..00000000 --- a/bindings/java/src/net/hyperic/sigar/cmd/PidFinder.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.hyperic.sigar.cmd; - -import net.hyperic.sigar.Sigar; -import net.hyperic.sigar.SigarException; -import net.hyperic.sigar.SigarProxy; -import net.hyperic.sigar.ptql.ProcessFinder; - -class PidFinder { - - public static long[] getPids(SigarProxy sigar, String[] args) - throws SigarException { - - long[] pids; - - switch (args.length) { - case 0: - pids = new long[] { sigar.getPid() }; - break; - case 1: - if (args[0].indexOf("=") > 0) { - pids = ProcessFinder.find(sigar, args[0]); - } - else if (args[0].equals("$$")) { - pids = new long[] { sigar.getPid() }; - } - else { - pids = new long[] { - Long.parseLong(args[0]) - }; - } - break; - default: - throw new IllegalArgumentException("Usage: cmd [pid|query]"); - } - - return pids; - } - - public static long getPid(SigarProxy sigar, String[] args) - throws SigarException { - - long[] pids = getPids(sigar, args); - if (pids.length != 1) { - throw new IllegalArgumentException("Query matches more than 1 process"); - } - - return pids[0]; - } -}