public class WebUpdate extends java.lang.Object implements WebUpdateConstants
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.
NOTE: this class must compile under Java 1.4 to ensure broad compatibility across computers, since it will be launched using JavaWebStart and not our own Java. This means you can't use generics or for-each loops or other 1.5+ features.
Copyright 2005-2012 Partner Software, Inc.
| Modifier and Type | Field and Description |
|---|---|
int |
BUFFER_SIZE |
CENTRAL_HUB, CONFIG_LEVELS, DISTRIBUTION, INSTALL_TYPES, MAP_TRANSLATOR, MASTER_INSTALL, OS, OS_DIRS, PALM_USER, PROVIDER, SHORT_INSTALL_TYPES, SITE_HUB, USER, WEB_USER| Constructor and Description |
|---|
WebUpdate(java.lang.String action,
java.lang.String source,
java.lang.String installType,
java.lang.String destination) |
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList |
contentsForPackage(java.lang.String packageName) |
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) |
long |
downloadAndChecksum(java.io.InputStream source,
java.io.OutputStream sink)
Copies (or downloads) from the source to the sink, using a large buffer,
while simultaneously generating a checksum that can be used to verify
that the copied data matches what was expected.
|
long |
downloadAndChecksum(java.io.InputStream source,
java.io.OutputStream sink,
long howMany,
boolean showProgress)
Copies (or downloads) from the source to the sink, using a large buffer,
while simultaneously generating a checksum that can be used to verify
that the copied data matches what was expected.
|
void |
downloadFile(java.lang.String path) |
void |
execAndHalt(java.io.File currentDir,
java.lang.String... commands)
Executes the given OS-specific command; then halts the current Java
session.
|
void |
execAndHalt(java.lang.String... commands)
Executes the given OS-specific command; then halts the current Java
session.
|
void |
execAndWait(java.io.File currentDir,
java.lang.String... commands) |
java.lang.Process |
execNoWait(java.io.File currentDir,
java.lang.String... commands)
Same as execAndWait(command, currentDir) but does not wait - the process
continues in a separate thread.
|
java.lang.Process |
execNoWait(java.lang.String... commands)
Same as execNoWait(command, currentDir) but defaulted to the install
directory.
|
boolean |
getExitWhenDone() |
java.lang.String |
getOSType() |
java.lang.String |
humaneTimestamp() |
boolean |
isFailOnChecksumMismatch() |
boolean |
isHeadless() |
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.util.List |
readListFromSource(java.lang.String path) |
java.util.Set |
readSetFromSource(java.lang.String path) |
void |
setExitWhenDone(boolean tizit) |
void |
setFailOnChecksumMismatch(boolean failOnChecksumMismatch) |
void |
setHeadless(boolean tizit) |
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,
long howMany,
boolean showProgress) |
long |
streamCopyLengthUnknown(java.io.InputStream source,
java.io.OutputStream sink) |
long |
streamSkip(java.io.InputStream source,
long howMany,
boolean showProgress) |
boolean |
testBoxcar(java.io.File boxcarFile) |
void |
unpack(java.io.File boxcarFile,
java.io.File destinationDir) |
void |
update()
The driver function; calls the full update sequence.
|
java.util.TreeSet |
whichPackages(java.lang.String sourceType,
java.lang.String destinationType,
java.lang.String osType,
java.util.Collection mapPackages) |
void |
writeLine(java.lang.String path,
java.lang.String line) |
void |
writeList(java.lang.String path,
java.util.Collection list) |
public final int BUFFER_SIZE
public WebUpdate(java.lang.String action,
java.lang.String source,
java.lang.String installType,
java.lang.String destination)
public static void main(java.lang.String[] argv)
public void update()
throws java.io.IOException
java.io.IOExceptionpublic java.util.ArrayList contentsForPackage(java.lang.String packageName)
public void unpack(java.io.File boxcarFile,
java.io.File destinationDir)
throws java.io.IOException
java.io.IOExceptionpublic boolean testBoxcar(java.io.File boxcarFile)
throws java.io.IOException
java.io.IOExceptionpublic static void makeAbsolutelySureItAintA3xInstall(java.io.File installDir)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String slashToSeparator(java.lang.String filename)
public java.net.URL createURL(java.net.URL base,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.net.URL createURL(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.io.File createFile(java.io.File base,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.io.File createFile(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic void makeDirsFor(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic java.io.File createFileMakeDir(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic void downloadFile(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readLineFromSource(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List readListFromSource(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Set readSetFromSource(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readLineFromDestination(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic void writeLine(java.lang.String path,
java.lang.String line)
throws java.io.IOException
java.io.IOExceptionpublic void writeList(java.lang.String path,
java.util.Collection list)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getOSType()
public java.lang.String humaneTimestamp()
public java.util.TreeSet whichPackages(java.lang.String sourceType,
java.lang.String destinationType,
java.lang.String osType,
java.util.Collection mapPackages)
public long downloadAndChecksum(java.io.InputStream source,
java.io.OutputStream sink,
long howMany,
boolean showProgress)
throws java.io.IOException
java.io.IOExceptionpublic long downloadAndChecksum(java.io.InputStream source,
java.io.OutputStream sink)
throws java.io.IOException
java.io.IOExceptionpublic long streamCopy(java.io.InputStream source,
java.io.OutputStream sink,
long howMany,
boolean showProgress)
throws java.io.IOException
java.io.IOExceptionpublic long streamSkip(java.io.InputStream source,
long howMany,
boolean showProgress)
throws java.io.IOException
java.io.IOExceptionpublic long streamCopyLengthUnknown(java.io.InputStream source,
java.io.OutputStream sink)
throws java.io.IOException
java.io.IOExceptionpublic void move(java.lang.String fromPath,
java.lang.String toPath)
throws java.io.IOException
java.io.IOExceptionpublic void execAndWait(java.io.File currentDir,
java.lang.String... commands)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Process execNoWait(java.lang.String... commands)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Process execNoWait(java.io.File currentDir,
java.lang.String... commands)
throws java.io.IOException
java.io.IOExceptionpublic void execAndHalt(java.lang.String... commands)
throws java.io.IOException
java.io.IOExceptionpublic void execAndHalt(java.io.File currentDir,
java.lang.String... commands)
throws java.io.IOException
java.io.IOExceptionpublic void logOutput(java.lang.Process proc)
public void die(java.lang.String message,
java.lang.Throwable oopsie)
public boolean isHeadless()
public void setHeadless(boolean tizit)
public boolean getExitWhenDone()
public void setExitWhenDone(boolean tizit)
public boolean isFailOnChecksumMismatch()
public void setFailOnChecksumMismatch(boolean failOnChecksumMismatch)