Exemplo n.º 1
0
 /** Check the location of the POM, alternate settings file, etc - any file. */
 public FormValidation doCheckFileInWorkspace(@QueryParameter String value)
     throws IOException, ServletException {
   MavenModuleSetBuild lb = getLastBuild();
   if (lb != null) {
     FilePath ws = lb.getModuleRoot();
     if (ws != null) return ws.validateRelativePath(value, true, true);
   }
   return FormValidation.ok();
 }
Exemplo n.º 2
0
  /** Check that the provided file is a relative path. And check that it exists, just in case. */
  public FormValidation doCheckFileRelative(@QueryParameter String value)
      throws IOException, ServletException {
    String v = fixEmpty(value);
    if ((v == null) || (v.length() == 0)) {
      // Null values are allowed.
      return FormValidation.ok();
    }
    if ((v.startsWith("/")) || (v.startsWith("\\")) || (v.matches("^\\w\\:\\\\.*"))) {
      return FormValidation.error("Alternate settings file must be a relative path.");
    }

    MavenModuleSetBuild lb = getLastBuild();
    if (lb != null) {
      FilePath ws = lb.getWorkspace();
      if (ws != null) return ws.validateRelativePath(value, true, true);
    }
    return FormValidation.ok();
  }
Exemplo n.º 3
0
  protected void addTransientActionsFromBuild(
      MavenModuleSetBuild build, List<Action> collection, Set<Class> added) {
    if (build == null) return;

    for (Action a : build.getActions())
      if (a instanceof MavenAggregatedReport)
        if (added.add(a.getClass()))
          collection.add(((MavenAggregatedReport) a).getProjectAction(this));

    List<MavenReporter> list = build.projectActionReporters;
    if (list == null) return;

    for (MavenReporter step : list) {
      if (!added.add(step.getClass())) continue; // already added
      Action a = step.getAggregatedProjectAction(this);
      if (a != null) collection.add(a);
    }
  }