From: <do...@hy...> - 2007-03-24 22:49:40
|
Author: dougm Date: 2007-03-24 14:49:27 -0800 (Sat, 24 Mar 2007) New Revision: 3870 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3870 Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/ProcessData.java Log: add getBaseName method Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/ProcessData.java =================================================================== --- trunk/plugins/system/src/org/hyperic/hq/plugin/system/ProcessData.java 2007-03-24 21:39:10 UTC (rev 3869) +++ trunk/plugins/system/src/org/hyperic/hq/plugin/system/ProcessData.java 2007-03-24 22:49:27 UTC (rev 3870) @@ -25,6 +25,7 @@ //XXX move this class to sigar package org.hyperic.hq.plugin.system; +import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; @@ -176,6 +177,16 @@ return _name; } + public String getBaseName() { + int ix = _name.lastIndexOf(File.separator); + if (ix == -1) { + return _name; + } + else { + return _name.substring(ix+1); + } + } + public String getFormattedStartTime() { return getFormattedStartTime(_startTime); } @@ -240,7 +251,7 @@ _state + delim + getFormattedCpuTotal() + delim + getFormattedCpuPerc() + delim + - _name; + getBaseName(); } public String toString() { |