Returns the plan without the required jars when the files are already provided by the cluster.

@return The plan without attached jar files.
@throws ProgramInvocationException
332869
public JobWithJars getPlanWithoutJars() throws ProgramInvocationException {
		if (isUsingProgramEntryPoint()) {
			return new JobWithJars(getPlan(), Collections.<URL>emptyList(), classpaths, userCodeClassLoader);
		} else {
			throw new ProgramInvocationException("Cannot create a " + JobWithJars.class.getSimpleName() +
				" for a program that is using the interactive mode.", getPlan().getJobId());
		}
	}
177056
public static List<Resource> getClasspathResources() {
      synchronized (classpathResources) {
         if (classpathResources.isEmpty()) {
            for (String jar : SystemInfo.JAVA_CLASS_PATH.split(SystemInfo.PATH_SEPARATOR)) {
               File file = new File(jar);
               if (file.isDirectory()) {
                  classpathResources.addAll(new FileResource(file).getChildren(true));
               } else {
                  classpathResources.addAll(getJarContents(Resources.fromFile(jar), v -> true));
               }
            }
         }
         return Collections.unmodifiableList(classpathResources);
      }
   }
1344893
public URI generateShimJarFile() {

    try {
      Set<FileResource> globalFiles = new HashSet<>();

      final File globalFolder = new File(this.reefFileNames.getGlobalFolderPath());
      final File[] filesInGlobalFolder = globalFolder.listFiles();

      for (final File fileEntry : filesInGlobalFolder != null ? filesInGlobalFolder : new File[]{}) {
        globalFiles.add(getFileResourceFromFile(fileEntry, FileType.LIB));
      }

      File jarFile = this.jobJarMaker.newBuilder()
          .addGlobalFileSet(globalFiles)
          .build();

      return uploadFile(jarFile);
    } catch (IOException ex) {
      LOG.log(Level.SEVERE, "Failed to build JAR file", ex);
      throw new RuntimeException(ex);
    }
  }
348640
public Plan getPlan(final String planCode) {
        if (planCode == null || planCode.isEmpty())
            throw new RuntimeException("planCode cannot be empty!");

        return doGET(Plan.PLANS_RESOURCE + "/" + planCode, Plan.class);
    }
1046874
public Exclude<ExceptionClassFilter<T>> getOrCreateExclude()
   {
      List<Node> nodeList = childNode.get("exclude");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ExcludeImpl<ExceptionClassFilter<T>>(this, "exclude", childNode, nodeList.get(0));
      }
      return createExclude();
   }
202218
static private List<LaunchManifest.RequiredBundle> findExtensionBundles(List<File> dirs) throws IOException {
        List<LaunchManifest.RequiredBundle> list = new ArrayList<LaunchManifest.RequiredBundle>();
        for (File dir : dirs) {
            if (dir.exists()) {
                File[] files = dir.listFiles();
                if (files != null) {
                    for (File file : files) {
                        if (!file.isDirectory() && file.getName().toLowerCase().endsWith(".jar")) {
                            String bundles = getRequiredBundles(file);
                            if (bundles != null) {
                                list.addAll(LaunchManifest.parseRequireBundle(bundles));
                            }
                        }
                    }
                }
            }
        }
        return list;
    }
688597
private CompiledPlan getNextPlan() {
        CompiledPlan retval;
        AbstractParsedStmt nextStmt = null;
        if (m_parsedSelect != null) {
            nextStmt = m_parsedSelect;
            retval = getNextSelectPlan();
        } else if (m_parsedInsert != null) {
            nextStmt = m_parsedInsert;
            retval = getNextInsertPlan();
        } else if (m_parsedDelete != null) {
            nextStmt = m_parsedDelete;
            retval = getNextDeletePlan();
            // note that for replicated tables, multi-fragment plans
            // need to divide the result by the number of partitions
        } else if (m_parsedUpdate != null) {
            nextStmt = m_parsedUpdate;
            retval = getNextUpdatePlan();
        } else if (m_parsedUnion != null) {
            nextStmt = m_parsedUnion;
            retval = getNextUnionPlan();
        } else if (m_parsedSwap != null) {
            nextStmt = m_parsedSwap;
            retval = getNextSwapPlan();
        } else if (m_parsedMigrate != null) {
            nextStmt = m_parsedMigrate;
            retval = getNextMigratePlan();
        } else {
            throw new RuntimeException(
                    "setupForNewPlans encountered unsupported statement type.");
        }

        if (retval == null || retval.rootPlanGraph == null) {
            return null;
        }

        assert (nextStmt != null);
        retval.setParameters(nextStmt.getParameters());
        return retval;
    }
85789
private String[] requiredLibraries() {
        List<String> libraries = new ArrayList<String>(Arrays.asList(
            "org.dbunit",
            "org.apache.commons",
            "org.apache.log4j",
            "org.slf4j",
            "org.yaml",
            "org.codehaus.jackson"
        ));

        if (!dbunitConfigurationInstance.get().isExcludePoi()) {
            libraries.add("org.apache.poi");
        }

        return libraries.toArray(new String[libraries.size()]);
    }
405999
@javax.annotation.Nonnull
    public java.util.Optional<net.morimekta.providence.model.ProgramType> optionalProgram() {
        return java.util.Optional.ofNullable(mProgram);
    }
440191
public Manifest getManifest()
    throws IOException
  {
    Manifest manifest;

    JarFile jarFile = getJarFile();

    try {
      if (jarFile == null)
        manifest = null;
      else
        manifest = jarFile.getManifest();
    } finally {
      closeJarFile(jarFile);
    }

    return manifest;
  }
441657
public static String getJvmStartupOptions() {
		try {
			final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
			final StringBuilder bld = new StringBuilder();
			
			for (String s : bean.getInputArguments()) {
				bld.append(s).append(' ');
			}

			return bld.toString();
		}
		catch (Throwable t) {
			return UNKNOWN;
		}
	}
977225
public MapFactory<E, MutableInteger> getMapFactory() {
    return ErasureUtils.<MapFactory<E,MutableInteger>>uncheckedCast(mapFactory);
  }
793153
private static File getToolsJar() {
        String javaHome = System.getProperty("java.home");
        File file = new File(javaHome, "../lib/tools.jar");
        if (!file.exists()) {
            file = new File(javaHome, "lib/tools.jar");
            if (!file.exists()) {
                return null;
            }
        }

        return file;
    }
738176
public JavaClassSource create(ClassIndex index, ClassPlan plan) {
        this.names.clear();

        // base class
        JavaClassSource type = Roaster.parse(
                JavaClassSource.class,
                "public class " + plan.getClassName() + "<T extends " + plan.getClassName() + "<T>> implements " + Keyed.class.getName() + "{}"
        );


        type.setPackage(plan.getPackageName());

        type.addImport(AttributeDocumentation.class);
        type.addImport(ResourceDocumentation.class);
        type.addImport(SingletonResource.class);

        JavaDocSource javaDoc = type.getJavaDoc();
        ResourceDescription desc = plan.getDescription();
        javaDoc.setText(desc.getText());

        addAddressAnnotations(type, plan);
        addConstructor(type, plan);
        addResourceTypeAnnotation(type, plan);
        addPropertyChangeSupport(type, plan);

        addChildResources(index, type, plan);
        addSingletonResources(index, type, plan);

        if (plan.getSubresourceClass() != null) {
            type.addNestedType(plan.getSubresourceClass());
        }

        for (EnumPlan enumPlan : plan.getEnumPlans()) {
            EnumFactory factory = new EnumFactory();
            JavaEnumSource enumType = factory.create(index, enumPlan);
            enumType.setStatic(true);
            type.addNestedType(enumType);
        }

        addAttribtues(index, type, plan);

        return type;
    }
992903
PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {
		String[] programArgs = options.getProgramArgs();
		String jarFilePath = options.getJarFilePath();
		List<URL> classpaths = options.getClasspaths();

		if (jarFilePath == null) {
			throw new IllegalArgumentException("The program JAR file was not specified.");
		}

		File jarFile = new File(jarFilePath);

		// Check if JAR file exists
		if (!jarFile.exists()) {
			throw new FileNotFoundException("JAR file does not exist: " + jarFile);
		}
		else if (!jarFile.isFile()) {
			throw new FileNotFoundException("JAR file is not a file: " + jarFile);
		}

		// Get assembler class
		String entryPointClass = options.getEntryPointClassName();

		PackagedProgram program = entryPointClass == null ?
				new PackagedProgram(jarFile, classpaths, programArgs) :
				new PackagedProgram(jarFile, classpaths, entryPointClass, programArgs);

		program.setSavepointRestoreSettings(options.getSavepointRestoreSettings());

		return program;
	}
503747
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "PLAN")
    public org.openprovenance.prov.model.QualifiedName getPlan() {
        return plan;
    }
223761
private static String getExtractDirectory() {
        createExtractor();
        String containerPath = extractor.container.getName();
        File containerFile = new File(containerPath);
        if (containerFile.isDirectory()) {
            extractor.allowNonEmptyInstallDirectory(true);
            return containerFile.getAbsolutePath();
        }
        // check if user specified explicit directory
        String extractDirVar = System.getenv("WLP_JAR_EXTRACT_DIR");

        // if so, return it and done
        if (extractDirVar != null && extractDirVar.length() > 0) {
            String retVal = createIfNeeded(extractDirVar.trim());
            return retVal;
        } else {

            String extractDirVarRoot = System.getenv("WLP_JAR_EXTRACT_ROOT");
            if (extractDirVarRoot == null || extractDirVarRoot.length() == 0) {
                extractDirVarRoot = getUserHome() + File.separator + "wlpExtract";
            }
            createIfNeeded(extractDirVarRoot);

            try {
                String basedir = (new File(extractDirVarRoot)).getAbsolutePath();
                return createTempDirectory(basedir, jarFileName() + "_");
            } catch (Exception e) {
                throw new RuntimeException("Could not create temp directory under: " + extractDirVarRoot);
            }
        }
    }