com.partnersoft.update.web
Class WebUpdate

java.lang.Object
  extended by com.partnersoft.update.web.WebUpdate
All Implemented Interfaces:
WebUpdateConstants

public class WebUpdate
extends java.lang.Object
implements WebUpdateConstants

A JavaWebStart-launched installation/update facility. This is designed to be standalone; it does not depend on any other Partner packages and a minimal set of third-party libraries. Therefore, it has many redundancies with com.partnersoft.io and com.partnersoft.update classes.

Author:
Paul Reavis Copyright 2005 Partner Software, Inc.

Field Summary
 int BUFFER_SIZE
           
 
Fields inherited from interface com.partnersoft.update.web.WebUpdateConstants
CENTRAL_HUB, CONFIG_LEVELS, CONFIG_MANAGER, DISTRIBUTION, INSTALL_TYPES, MAP_TRANSLATOR, OS, OS_DIRS, PALM_USER, PROVIDER, SHORT_INSTALL_TYPES, SITE_HUB, USER, WEB_USER
 
Constructor Summary
WebUpdate(java.lang.String action, java.lang.String source, java.lang.String installType, java.lang.String destination)
           
 
Method Summary
 java.io.File createFile(java.io.File base, java.lang.String path)
           
 java.io.File createFile(java.lang.String path)
           
 java.io.File createFileMakeDir(java.lang.String path)
           
 java.net.URL createURL(java.lang.String path)
           
 java.net.URL createURL(java.net.URL base, java.lang.String path)
           
 void die(java.lang.String message, java.lang.Throwable oopsie)
           
 void execAndHalt(java.lang.String command)
          Executes the given OS-specific command; then halts the current Java session.
 void execAndHalt(java.lang.String command, java.io.File currentDir)
          Executes the given OS-specific command; then halts the current Java session.
 void execAndWait(java.lang.String command, java.io.File currentDir)
           
 java.lang.Process execNoWait(java.lang.String command)
          Same as execNoWait(command, currentDir) but defaulted to the install directory.
 java.lang.Process execNoWait(java.lang.String command, java.io.File currentDir)
          Same as execAndWait(command, currentDir) but does not wait - the process continues in a separate thread.
 java.lang.String getOSType()
           
 java.lang.String humaneTimestamp()
           
 void logOutput(java.lang.Process proc)
           
static void main(java.lang.String[] argv)
           
static void makeAbsolutelySureItAintA3xInstall(java.io.File installDir)
           
 void makeDirsFor(java.io.File file)
           
 void move(java.lang.String fromPath, java.lang.String toPath)
           
 java.lang.String readLineFromDestination(java.lang.String path)
           
 java.lang.String readLineFromSource(java.lang.String path)
           
 java.lang.String slashToSeparator(java.lang.String filename)
          Unscrubs a string, turning Unix-style slashes into native File.separator strings.
 long streamCopy(java.io.InputStream source, java.io.OutputStream sink, int howMany, boolean showProgress)
           
 void unpack(java.io.File boxcarFile, java.io.File destinationDir)
           
 void update()
          The driver function; calls the full update sequence.
 java.util.TreeSet<java.lang.String> whichPackages(java.lang.String sourceType, java.lang.String destinationType, java.lang.String osType)
           
 void writeLine(java.lang.String path, java.lang.String line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

WebUpdate

public WebUpdate(java.lang.String action,
                 java.lang.String source,
                 java.lang.String installType,
                 java.lang.String destination)
Method Detail

main

public static void main(java.lang.String[] argv)

update

public void update()
            throws java.io.IOException
The driver function; calls the full update sequence.

Throws:
java.io.IOException

unpack

public void unpack(java.io.File boxcarFile,
                   java.io.File destinationDir)
            throws java.io.IOException
Throws:
java.io.IOException

makeAbsolutelySureItAintA3xInstall

public static void makeAbsolutelySureItAintA3xInstall(java.io.File installDir)
                                               throws java.io.IOException
Throws:
java.io.IOException

slashToSeparator

public java.lang.String slashToSeparator(java.lang.String filename)
Unscrubs a string, turning Unix-style slashes into native File.separator strings.


createURL

public java.net.URL createURL(java.net.URL base,
                              java.lang.String path)
                       throws java.io.IOException
Throws:
java.io.IOException

createURL

public java.net.URL createURL(java.lang.String path)
                       throws java.io.IOException
Throws:
java.io.IOException

createFile

public java.io.File createFile(java.io.File base,
                               java.lang.String path)
                        throws java.io.IOException
Throws:
java.io.IOException

createFile

public java.io.File createFile(java.lang.String path)
                        throws java.io.IOException
Throws:
java.io.IOException

makeDirsFor

public void makeDirsFor(java.io.File file)
                 throws java.io.IOException
Throws:
java.io.IOException

createFileMakeDir

public java.io.File createFileMakeDir(java.lang.String path)
                               throws java.io.IOException
Throws:
java.io.IOException

readLineFromSource

public java.lang.String readLineFromSource(java.lang.String path)
                                    throws java.io.IOException
Throws:
java.io.IOException

readLineFromDestination

public java.lang.String readLineFromDestination(java.lang.String path)
                                         throws java.io.IOException
Throws:
java.io.IOException

writeLine

public void writeLine(java.lang.String path,
                      java.lang.String line)
               throws java.io.IOException
Throws:
java.io.IOException

getOSType

public java.lang.String getOSType()

humaneTimestamp

public java.lang.String humaneTimestamp()

whichPackages

public java.util.TreeSet<java.lang.String> whichPackages(java.lang.String sourceType,
                                                         java.lang.String destinationType,
                                                         java.lang.String osType)

streamCopy

public long streamCopy(java.io.InputStream source,
                       java.io.OutputStream sink,
                       int howMany,
                       boolean showProgress)
                throws java.io.IOException
Throws:
java.io.IOException

move

public void move(java.lang.String fromPath,
                 java.lang.String toPath)
          throws java.io.IOException
Throws:
java.io.IOException

execAndWait

public void execAndWait(java.lang.String command,
                        java.io.File currentDir)
                 throws java.io.IOException
Throws:
java.io.IOException

execNoWait

public java.lang.Process execNoWait(java.lang.String command)
                             throws java.io.IOException
Same as execNoWait(command, currentDir) but defaulted to the install directory.

Throws:
java.io.IOException

execNoWait

public java.lang.Process execNoWait(java.lang.String command,
                                    java.io.File currentDir)
                             throws java.io.IOException
Same as execAndWait(command, currentDir) but does not wait - the process continues in a separate thread.

Throws:
java.io.IOException

execAndHalt

public void execAndHalt(java.lang.String command)
                 throws java.io.IOException
Executes the given OS-specific command; then halts the current Java session.

Throws:
java.io.IOException

execAndHalt

public void execAndHalt(java.lang.String command,
                        java.io.File currentDir)
                 throws java.io.IOException
Executes the given OS-specific command; then halts the current Java session.

Throws:
java.io.IOException

logOutput

public void logOutput(java.lang.Process proc)

die

public void die(java.lang.String message,
                java.lang.Throwable oopsie)