/** * Similar to {@link #getName()}, this is a convenience method that returns the first command line argument, which * is the name of the program that the process is executing. However, this is only the relative filename of the * program, which does not include the full path to the program (e.g. this would return "sh" if the name of the * process is "/usr/bin/sh"). * * @return filename of program that is executing * * @see #getName() * @see #getCommandLine() */ public String getBaseName() { if (baseName == null) { baseName = (getName() != null) ? new File(getName()).getName() : UNKNOWN_PROCESS_NAME; } return baseName; }
/** * Similar to {@link #getName()}, this is a convenience method that returns the first command line argument, which * is the name of the program that the process is executing. However, this is only the relative filename of the * program, which does not include the full path to the program (e.g. this would return "sh" if the name of the * process is "/usr/bin/sh"). * * @return filename of program that is executing * * @see #getName() * @see #getCommandLine() */ public String getBaseName() { if (baseName == null) { baseName = (getName() != null) ? new File(getName()).getName() : UNKNOWN_PROCESS_NAME; } return baseName; }
@Override public String toString() { StringBuilder s = new StringBuilder("process: "); s.append("pid=["); s.append(getPid()); s.append("], name=["); s.append((!getName().equals(UNKNOWN_PROCESS_NAME)) ? getName() : getBaseName()); s.append("], ppid=["); try { s.append(priorSnaphot().getParentPid()); } catch (Exception e) { s.append(e); } s.append("]"); return s.toString(); }
@Override public String toString() { StringBuilder s = new StringBuilder("process: "); s.append("pid=["); s.append(getPid()); s.append("], name=["); s.append((!getName().equals(UNKNOWN_PROCESS_NAME)) ? getName() : getBaseName()); s.append("], ppid=["); try { s.append(priorSnaphot().getParentPid()); } catch (Exception e) { s.append(e); } s.append("]"); return s.toString(); }
private String determineCatalinaHomeOnWindows(ProcessInfo processInfo) { File exePath = new File(processInfo.getName());
operand1 = (processToMatch != null) ? processToMatch.getName() : ""; operand2 = criteria.getValue(); } else if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.basename.toString())) {
operand1 = (processToMatch != null) ? processToMatch.getName() : ""; operand2 = criteria.getValue(); } else if (attribute.getAttributeValue().equals(Attribute.ProcessCategoryAttributes.basename.toString())) {