protected void processCommandLineArguments(String[] args, PublisherInfo publisherInfo) throws Exception { if (args == null) return; for (int i = 0; i < args.length; i++) { // check for args without parameters (i.e., a flag arg) processFlag(args[i], publisherInfo); // check for args with parameters. If we are at the last argument or if the next one // has a '-' as the first character, then we can't have an arg with a parm so continue. if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$ continue; processParameter(args[i], args[++i], publisherInfo); } }
public Object run(String args[]) throws Exception { try { info = createPublisherInfo(); processCommandLineArguments(args, info); Object result = run(info); if (result != IApplication.EXIT_OK) { System.out.println(NLS.bind(Messages.message_publisherArguments, null)); for (int i = 0; i < args.length; i++) System.out.println(args[i]); } return result; } catch (Exception e) { if (e.getMessage() != null) System.err.println(e.getMessage()); else e.printStackTrace(System.err); throw e; } }
public Object run(PublisherInfo publisherInfo) throws Exception { try { this.info = publisherInfo; setupAgent(); initialize(publisherInfo); System.out.println(NLS.bind(Messages.message_generatingMetadata, publisherInfo.getSummary())); IPublisherAction[] actions = createActions(); Publisher publisher = createPublisher(publisherInfo); IStatus result = publisher.publish(actions, new NullProgressMonitor()); long after = System.currentTimeMillis();
protected void processParameter(String arg, String parameter, PublisherInfo pinfo) throws URISyntaxException { super.processParameter(arg, parameter, pinfo); if (arg.equalsIgnoreCase("-categoryQualifier")) //$NON-NLS-1$ categoryQualifier = parameter; if (arg.equalsIgnoreCase("-categoryVersion")) //$NON-NLS-1$ categoryVersion = parameter; }
/** * Detect the flag -addJREIU to turn on the generation of the JREIU. */ protected void processFlag(String flag, PublisherInfo publisherInfo) { super.processFlag(flag, publisherInfo); if (flag.equalsIgnoreCase("-addJREIU"))//$NON-NLS-1$ { addJRE = true; } } }
protected void initializeRepositories(PublisherInfo publisherInfo) throws ProvisionException { if (artifactLocation != null) { IArtifactRepository repo = Publisher.createArtifactRepository(agent, artifactLocation, artifactRepoName, compress, reusePackedFiles); if (!append && !isEmpty(repo)) { File repoLocation = URIUtil.toFile(artifactLocation); if (repoLocation != null && source != null) { throw new ProvisionException(createConfigurationEror(Messages.exception_noArtifactRepo)); if (metadataLocation == null) throw new ProvisionException(createConfigurationEror(Messages.exception_noMetadataRepo)); publisherInfo.setMetadataRepository(Publisher.createMetadataRepository(agent, metadataLocation, metadataRepoName, append, compress));
protected void initialize(PublisherInfo publisherInfo) throws ProvisionException { super.initialize(publisherInfo); if (publisherInfo.getConfigurations().length == 0) publisherInfo.setConfigurations(new String[] {""}); //$NON-NLS-1$ }
protected void initialize(PublisherInfo publisherInfo) throws ProvisionException { if (inplace) { File location = new File(source); if (metadataLocation == null) metadataLocation = location.toURI(); if (artifactLocation == null) artifactLocation = location.toURI(); publisherInfo.setArtifactOptions(publisherInfo.getArtifactOptions() | IPublisherInfo.A_INDEX | IPublisherInfo.A_PUBLISH); } initializeRepositories(publisherInfo); }
public Object run(PublisherInfo publisherInfo) throws Exception { try { this.info = publisherInfo; setupAgent(); initialize(publisherInfo); System.out.println(NLS.bind(Messages.message_generatingMetadata, publisherInfo.getSummary())); IPublisherAction[] actions = createActions(); Publisher publisher = createPublisher(publisherInfo); IStatus result = publisher.publish(actions, new NullProgressMonitor()); long after = System.currentTimeMillis();
protected void processParameter(String arg, String parameter, PublisherInfo pinfo) throws URISyntaxException { super.processParameter(arg, parameter, pinfo); this.append = true; // Always append, otherwise we will end up with nothing if (arg.equalsIgnoreCase("-categoryQualifier")) //$NON-NLS-1$ categoryQualifier = parameter; if (arg.equalsIgnoreCase("-categoryDefinition")) //$NON-NLS-1$ categoryDefinition = URIUtil.fromString(parameter); }
protected void processFlag(String arg, PublisherInfo publisherInfo) { super.processFlag(arg, publisherInfo); if (arg.equalsIgnoreCase("-startAll")) //$NON-NLS-1$ start = true; }
protected void initializeRepositories(PublisherInfo publisherInfo) throws ProvisionException { if (artifactLocation != null) { IArtifactRepository repo = Publisher.createArtifactRepository(agent, artifactLocation, artifactRepoName, compress, reusePackedFiles); if (!append && !isEmpty(repo)) { File repoLocation = URIUtil.toFile(artifactLocation); if (repoLocation != null && source != null) { throw new ProvisionException(createConfigurationEror(Messages.exception_noArtifactRepo)); if (metadataLocation == null) throw new ProvisionException(createConfigurationEror(Messages.exception_noMetadataRepo)); publisherInfo.setMetadataRepository(Publisher.createMetadataRepository(agent, metadataLocation, metadataRepoName, append, compress));
@Override protected void initialize(PublisherInfo publisherInfo) throws ProvisionException { super.initialize(publisherInfo); if (publisherInfo.getConfigurations().length == 0) publisherInfo.setConfigurations(new String[] {""}); //$NON-NLS-1$ }
protected void initialize(PublisherInfo publisherInfo) throws ProvisionException { if (inplace) { File location = new File(source); if (metadataLocation == null) metadataLocation = location.toURI(); if (artifactLocation == null) artifactLocation = location.toURI(); publisherInfo.setArtifactOptions(publisherInfo.getArtifactOptions() | IPublisherInfo.A_INDEX | IPublisherInfo.A_PUBLISH); } initializeRepositories(publisherInfo); }
public Object run(PublisherInfo publisherInfo) throws Exception { try { this.info = publisherInfo; setupAgent(); initialize(publisherInfo); System.out.println(NLS.bind(Messages.message_generatingMetadata, publisherInfo.getSummary())); IPublisherAction[] actions = createActions(); Publisher publisher = createPublisher(publisherInfo); IStatus result = publisher.publish(actions, new NullProgressMonitor()); long after = System.currentTimeMillis();
protected void processCommandLineArguments(String[] args, PublisherInfo publisherInfo) throws Exception { if (args == null) return; for (int i = 0; i < args.length; i++) { // check for args without parameters (i.e., a flag arg) processFlag(args[i], publisherInfo); // check for args with parameters. If we are at the last argument or if the next one // has a '-' as the first character, then we can't have an arg with a parm so continue. if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$ continue; processParameter(args[i], args[++i], publisherInfo); } }
@Override protected void processParameter(String arg, String parameter, PublisherInfo pinfo) throws URISyntaxException { super.processParameter(arg, parameter, pinfo); if (arg.equalsIgnoreCase("-features")) //$NON-NLS-1$ features = createFiles(parameter); if (arg.equalsIgnoreCase("-bundles")) //$NON-NLS-1$ bundles = createFiles(parameter); if (arg.equalsIgnoreCase("-iu")) //$NON-NLS-1$ rootIU = parameter; if (arg.equalsIgnoreCase("-version")) //$NON-NLS-1$ rootVersion = parameter; }
public Object run(String args[]) throws Exception { try { info = createPublisherInfo(); processCommandLineArguments(args, info); Object result = run(info); if (result != IApplication.EXIT_OK) { System.out.println(NLS.bind(Messages.message_publisherArguments, null)); for (int i = 0; i < args.length; i++) System.out.println(args[i]); } return result; } catch (Exception e) { if (e.getMessage() != null) System.err.println(e.getMessage()); else e.printStackTrace(System.err); throw e; } }
@Override protected void processFlag(String arg, PublisherInfo publisherInfo) { super.processFlag(arg, publisherInfo); if (arg.equalsIgnoreCase("-startAll")) //$NON-NLS-1$ start = true; }
protected void initializeRepositories(PublisherInfo publisherInfo) throws ProvisionException { if (artifactLocation != null) { IArtifactRepository repo = Publisher.createArtifactRepository(agent, artifactLocation, artifactRepoName, compress, reusePackedFiles); if (!append && !isEmpty(repo)) { File repoLocation = URIUtil.toFile(artifactLocation); if (repoLocation != null && source != null) { throw new ProvisionException(createConfigurationEror(Messages.exception_noArtifactRepo)); if (metadataLocation == null) throw new ProvisionException(createConfigurationEror(Messages.exception_noMetadataRepo)); publisherInfo.setMetadataRepository(Publisher.createMetadataRepository(agent, metadataLocation, metadataRepoName, append, compress));