com.threerings.getdown.tools
Class Patcher

java.lang.Object
  extended by com.threerings.getdown.tools.Patcher

public class Patcher
extends Object

Applies a unified patch file to an application directory, providing percentage completion feedback along the way. Note: the patcher is not thread safe. Create a separate patcher instance for each patching action that is desired.


Field Summary
static String CREATE
          A suffix appended to file names to indicate that a file should be newly created.
static String DELETE
          A suffix appended to file names to indicate that a file should be deleted.
static String PATCH
          A suffix appended to file names to indicate that a file should be patched.
 
Constructor Summary
Patcher()
           
 
Method Summary
static void main(String[] args)
           
 void patch(File appdir, File patch, ProgressObserver obs)
          Applies the specified patch file to the application living in the specified application directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE

public static final String CREATE
A suffix appended to file names to indicate that a file should be newly created.

See Also:
Constant Field Values

PATCH

public static final String PATCH
A suffix appended to file names to indicate that a file should be patched.

See Also:
Constant Field Values

DELETE

public static final String DELETE
A suffix appended to file names to indicate that a file should be deleted.

See Also:
Constant Field Values
Constructor Detail

Patcher

public Patcher()
Method Detail

patch

public void patch(File appdir,
                  File patch,
                  ProgressObserver obs)
           throws IOException
Applies the specified patch file to the application living in the specified application directory. The supplied observer, if non-null, will be notified of progress along the way.

Note: this method runs on the calling thread, thus the caller may want to make use of a separate thread in conjunction with the patcher so that the user interface is not blocked for the duration of the patch.

Throws:
IOException

main

public static void main(String[] args)


Copyright © 2013. All Rights Reserved.