remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java
changeset 1035 97d4ae8fcb13
parent 597 4524a9f87990
     1.1 --- a/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java	Thu Jun 23 15:07:16 2011 +0200
     1.2 +++ b/remoting/server/hudson/src/main/java/org/netbeans/modules/jackpot30/hudson/InstallIndexingTool.java	Sun Jan 08 20:11:20 2017 +0100
     1.3 @@ -49,7 +49,9 @@
     1.4  import hudson.tools.InstallSourceProperty;
     1.5  import hudson.tools.ToolInstallation;
     1.6  import hudson.tools.ToolProperty;
     1.7 +import java.io.ByteArrayInputStream;
     1.8  import java.io.IOException;
     1.9 +import java.io.InputStream;
    1.10  import java.util.Arrays;
    1.11  import org.kohsuke.stapler.DataBoundConstructor;
    1.12  
    1.13 @@ -84,12 +86,21 @@
    1.14  
    1.15      }
    1.16  
    1.17 +    private static final String INSTALLER_DESCRIPTION =
    1.18 +            "{\"list\": [{\"id\": \"main\", \"name\": \"main\", \"url\": \"http://deadlock.netbeans.org/hudson/job/jackpot30/lastSuccessfulBuild/artifact/remoting/build/indexing-backend.zip\"}]}";
    1.19 +
    1.20      //XXX:
    1.21      @Initializer(after=InitMilestone.JOB_LOADED)
    1.22      public static void prepareUpdates() throws IOException, InterruptedException {
    1.23          FilePath update = new FilePath(new FilePath(Hudson.getInstance().getRootPath(), "updates"), "org.netbeans.modules.jackpot30.hudson.InstallIndexingTool");
    1.24  
    1.25 -        update.copyFrom(InstallIndexingTool.class.getResource("org.netbeans.modules.jackpot30.hudson.InstallIndexingTool"));
    1.26 +        InputStream in = new ByteArrayInputStream(INSTALLER_DESCRIPTION.getBytes());
    1.27 +
    1.28 +        try {
    1.29 +            update.copyFrom(in);
    1.30 +        } finally {
    1.31 +            in.close();
    1.32 +        }
    1.33  
    1.34          //preinstall main tool if it does not exist:
    1.35          IndexingTool[] tools = Hudson.getInstance().getDescriptorByType(IndexingTool.DescriptorImpl.class).getInstallations();