org.jvnet.hudson.update_center
Class Main

java.lang.Object
  extended by org.jvnet.hudson.update_center.Main

public class Main
extends Object

Author:
Kohsuke Kawaguchi

Field Summary
 File canonical
           
 String cap
           
 List<File> certificates
           
 String connectionCheckUrl
           
 File download
          This option builds the directory image for the download server.
static String EOL
           
 File htaccess
           
 String id
           
 File indexHtml
           
 File latestCoreTxt
           
 Integer maxPlugins
           
 File output
           
 boolean prettyPrint
           
 File privateKey
           
 File releaseHistory
           
 File www
           
 
Constructor Summary
Main()
           
 
Method Summary
protected  net.sf.json.JSONObject buildCore(MavenRepository repository, PrintWriter redirect)
          Identify the latest core, populates the htaccess redirect file, optionally download the core wars and build the index.html
protected  net.sf.json.JSONObject buildFullReleaseHistory(MavenRepository repo)
          Build JSON for the release history list.
protected  net.sf.json.JSONObject buildPlugins(MavenRepository repository, PrintWriter redirect)
          Build JSON for the plugin list.
protected  net.sf.json.JSONArray buildReleaseHistory(MavenRepository repository)
           
protected  void createLatestSymlink(PluginHistory hpi, HPI latest)
          Generates symlink to the latest version.
protected  MavenRepository createRepository()
           
protected  List<X509Certificate> getCertificateChain()
          Loads a certificate chain and makes sure it's valid.
static void main(String[] args)
           
 void run()
           
 int run(String[] args)
           
protected  void sign(net.sf.json.JSONObject o)
          Generates a canonicalized JSON format of the given object, and put the signature in it.
protected  void stage(MavenArtifact a, File dst)
          Stages an artifact into the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

public File output

releaseHistory

public File releaseHistory

htaccess

public File htaccess

download

public File download
This option builds the directory image for the download server.


www

public File www

indexHtml

public File indexHtml

latestCoreTxt

public File latestCoreTxt

privateKey

public File privateKey

certificates

public List<File> certificates

canonical

public File canonical

id

public String id

maxPlugins

public Integer maxPlugins

connectionCheckUrl

public String connectionCheckUrl

prettyPrint

public boolean prettyPrint

cap

public String cap

EOL

public static final String EOL
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

run

public int run(String[] args)
        throws Exception
Throws:
Exception

run

public void run()
         throws Exception
Throws:
Exception

createRepository

protected MavenRepository createRepository()
                                    throws Exception
Throws:
Exception

sign

protected void sign(net.sf.json.JSONObject o)
             throws GeneralSecurityException,
                    IOException
Generates a canonicalized JSON format of the given object, and put the signature in it. Because it mutates the signed object itself, validating the signature needs a bit of work, but this enables a signature to be added transparently.

Throws:
GeneralSecurityException
IOException

getCertificateChain

protected List<X509Certificate> getCertificateChain()
                                             throws FileNotFoundException,
                                                    GeneralSecurityException
Loads a certificate chain and makes sure it's valid.

Throws:
FileNotFoundException
GeneralSecurityException

buildPlugins

protected net.sf.json.JSONObject buildPlugins(MavenRepository repository,
                                              PrintWriter redirect)
                                       throws Exception
Build JSON for the plugin list.

Parameters:
repository -
redirect -
Throws:
Exception

createLatestSymlink

protected void createLatestSymlink(PluginHistory hpi,
                                   HPI latest)
                            throws InterruptedException,
                                   IOException
Generates symlink to the latest version.

Throws:
InterruptedException
IOException

stage

protected void stage(MavenArtifact a,
                     File dst)
              throws IOException,
                     InterruptedException
Stages an artifact into the specified location.

Throws:
IOException
InterruptedException

buildFullReleaseHistory

protected net.sf.json.JSONObject buildFullReleaseHistory(MavenRepository repo)
                                                  throws Exception
Build JSON for the release history list.

Parameters:
repo -
Throws:
Exception

buildReleaseHistory

protected net.sf.json.JSONArray buildReleaseHistory(MavenRepository repository)
                                             throws Exception
Throws:
Exception

buildCore

protected net.sf.json.JSONObject buildCore(MavenRepository repository,
                                           PrintWriter redirect)
                                    throws Exception
Identify the latest core, populates the htaccess redirect file, optionally download the core wars and build the index.html

Returns:
the JSON for the core Jenkins
Throws:
Exception


Copyright © 2004-2011. All Rights Reserved.