hudson.model.Item.getFullName()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中hudson.model.Item.getFullName()方法的一些代码示例,展示了Item.getFullName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getFullName()方法的具体详情如下:
包路径:hudson.model.Item
类名称:Item
方法名:getFullName

Item.getFullName介绍

[英]Gets the full name of this item, like "abc/def/ghi".

Full name consists of #getName()s of Items that lead from the root Hudson to this Item, separated by '/'. This is the unique name that identifies this Item inside the whole Hudson.
[中]获取此项的全名,如“abc/def/ghi”。
全名由从根Hudson到该项目的项目的#getName()组成,以“/”分隔。这是在整个哈德逊河中标识此项目的唯一名称。

代码示例

代码示例来源:origin: jenkinsci/jenkins

String name(Item i) {
    String n = i.getFullName();
    if (i instanceof ItemGroup) {
      n += '/';
    }
    return n;
  }
};

代码示例来源:origin: jenkinsci/jenkins

@Override
  public String toString(Object item) {
    return ((hudson.model.Item) item).getFullName();
  }
});

代码示例来源:origin: jenkinsci/jenkins

/**
 * Converts a list of items into a comma-separated list of full names.
 */
public static String toNameList(Collection<? extends Item> items) {
  StringBuilder buf = new StringBuilder();
  for (Item item : items) {
    if(buf.length()>0)
      buf.append(", ");
    buf.append(item.getFullName());
  }
  return buf.toString();
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Called when a {@link Trigger} is loaded into memory and started.
 *
 * @param project
 *      given so that the persisted form of this object won't have to have a back pointer.
 * @param newInstance
 *      True if this may be a newly created trigger first attached to the {@link Project} (generally if the project is being created or configured).
 *      False if this is invoked for a {@link Project} loaded from disk.
 * @see Items#currentlyUpdatingByXml
 */
public void start(J project, boolean newInstance) {
  this.job = project;
  try {// reparse the tabs with the job as the hash
    if (spec != null) {
      this.tabs = CronTabList.create(spec, Hash.from(project.getFullName()));
    } else {
      LOGGER.log(Level.WARNING, "The job {0} has a null crontab spec which is incorrect", job.getFullName());
    }
  } catch (ANTLRException e) {
    // this shouldn't fail because we've already parsed stuff in the constructor,
    // so if it fails, use whatever 'tabs' that we already have.
    LOGGER.log(Level.WARNING, String.format("Failed to parse crontab spec %s in job %s", spec, project.getFullName()), e);
  }
}

代码示例来源:origin: jenkinsci/jenkins

private File expandVariablesForDirectory(String base, Item item) {
  return new File(expandVariablesForDirectory(base, item.getFullName(), item.getRootDir().getPath()));
}

代码示例来源:origin: jenkinsci/jenkins

public static String getRelativeNameFrom(@CheckForNull Item p, @CheckForNull ItemGroup g, boolean useDisplayName) {
  if (p == null) return null;
  if (g == null) return useDisplayName ? p.getFullDisplayName() : p.getFullName();
  String separationString = useDisplayName ? " » " : "/";

代码示例来源:origin: jenkinsci/jenkins

/**
 * Performs syntax check.
 */
public FormValidation doCheckSpec(@QueryParameter String value, @AncestorInPath Item item) {
  try {
    CronTabList ctl = CronTabList.create(fixNull(value), item != null ? Hash.from(item.getFullName()) : null);
    Collection<FormValidation> validations = new ArrayList<>();
    updateValidationsForSanity(validations, ctl);
    updateValidationsForNextRun(validations, ctl);
    return FormValidation.aggregate(validations);
  } catch (ANTLRException e) {
    if (value.trim().indexOf('\n')==-1 && value.contains("**"))
      return FormValidation.error(Messages.TimerTrigger_MissingWhitespace());
    return FormValidation.error(e.getMessage());
  }
}

代码示例来源:origin: jenkinsci/jenkins

prefix += '/';
final String newFullName = rootItem.getFullName();
assert newFullName.startsWith(prefix);
int prefixS = prefix.length();
if (rootItem instanceof ItemGroup) {
  for (final Item child : Items.allItems(ACL.SYSTEM, (ItemGroup)rootItem, Item.class)) {
    final String childNew = child.getFullName();
    assert childNew.startsWith(newFullName);
    assert childNew.charAt(newFullName.length()) == '/';

代码示例来源:origin: jenkinsci/jenkins

@Override public int parseArguments(Parameters params) throws CmdLineException {
  final Jenkins j = Jenkins.get();
  final String src = params.getParameter(0);
  T s = j.getItemByFullName(src, type());
  if (s == null) {
    final Authentication who = Jenkins.getAuthentication();
    try (ACLContext acl = ACL.as(ACL.SYSTEM)) {
      Item actual = j.getItemByFullName(src);
      if (actual == null) {
        LOGGER.log(Level.FINE, "really no item exists named {0}", src);
      } else {
        LOGGER.log(Level.WARNING, "running as {0} could not find {1} of {2}", new Object[] {who.getPrincipal(), actual, type()});
      }
    }
    T nearest = Items.findNearest(type(), src, j);
    if (nearest != null) {
      throw new IllegalArgumentException("No such job '" + src + "'; perhaps you meant '" + nearest.getFullName() + "'?");
    } else {
      throw new IllegalArgumentException("No such job '" + src + "'");
    }
  }
  setter.addValue(s);
  return 1;
}

代码示例来源:origin: org.jenkins-ci.plugins/credentials

/**
 * {@inheritDoc}
 */
@Override
public String getToken(ModelObject context) {
  return context instanceof Item ? ((Item) context).getFullName() : null;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
  public String toString(Object item) {
    return ((hudson.model.Item) item).getFullName();
  }
});

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

String name(Item i) {
    String n = i.getFullName();
    if (i instanceof ItemGroup) {
      n += '/';
    }
    return n;
  }
};

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
  public String toString(Object item) {
    return ((hudson.model.Item) item).getFullName();
  }
});

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
  public String toString(Object item) {
    return ((hudson.model.Item) item).getFullName();
  }
});

代码示例来源:origin: Argelbargel/gitlab-branch-source-plugin

void acquire(Item owner) {
  if (!users.contains(owner.getFullName())) {
    LOGGER.info("acquiring listener for " + owner.getFullName() + "...");
    users.add(owner.getFullName());
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Converts a list of items into a comma-separated list of full names.
 */
public static String toNameList(Collection<? extends Item> items) {
  StringBuilder buf = new StringBuilder();
  for (Item item : items) {
    if(buf.length()>0)
      buf.append(", ");
    buf.append(item.getFullName());
  }
  return buf.toString();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Converts a list of items into a comma-separated list of full names.
 */
public static String toNameList(Collection<? extends Item> items) {
  StringBuilder buf = new StringBuilder();
  for (Item item : items) {
    if(buf.length()>0)
      buf.append(", ");
    buf.append(item.getFullName());
  }
  return buf.toString();
}

代码示例来源:origin: jenkinsci/workflow-cps-plugin

@CheckForNull
  @Override
  public FlowDurabilityHint suggestFor(@Nonnull Item x) {
    return hintMapping.get(x.getFullName());
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/pubsub-light

private synchronized void setJobChannelItem(@Nonnull Item jobChannelItem) {
  this.jobChannelItem = jobChannelItem;
  super.setChannelName(Events.JobChannel.NAME);
  set(EventProps.Job.job_name, jobChannelItem.getFullName());
  setItemProps(jobChannelItem);
}

代码示例来源:origin: org.jenkins-ci.plugins/pubsub-light

/**
 * Set {@link Item} propertis on the message instance.
 * @param item The Jenkins {@link Item}.
 */
protected T setItemProps(@Nonnull Item item) {
  set(EventProps.Jenkins.jenkins_object_name, item.getFullName());
  set(EventProps.Jenkins.jenkins_object_url, item.getUrl());
  return (T) this;
}

相关文章