com.izforge.izpack.util.os
Class WinSetupFileQueue

java.lang.Object
  extended by com.izforge.izpack.util.os.WinSetupAPIBase
      extended by com.izforge.izpack.util.os.WinSetupFileQueue
All Implemented Interfaces:
NativeLibraryClient

public class WinSetupFileQueue
extends WinSetupAPIBase


Field Summary
 
Fields inherited from class com.izforge.izpack.util.os.WinSetupAPIBase
INVALID_HANDLE_VALUE, SP_COPY_DELETESOURCE, SP_COPY_FORCE_IN_USE, SP_COPY_FORCE_NEWER, SP_COPY_FORCE_NOOVERWRITE, SP_COPY_IN_USE_NEEDS_REBOOT, SP_COPY_LANGUAGEAWARE, SP_COPY_NEWER, SP_COPY_NEWER_ONLY, SP_COPY_NEWER_OR_SAME, SP_COPY_NOBROWSE, SP_COPY_NODECOMP, SP_COPY_NOOVERWRITE, SP_COPY_NOPRUNE, SP_COPY_NOSKIP, SP_COPY_OEMINF_CATALOG_ONLY, SP_COPY_REPLACE_BOOT_FILE, SP_COPY_REPLACEONLY, SP_COPY_SOURCE_ABSOLUTE, SP_COPY_SOURCE_SIS_MASTER, SP_COPY_SOURCEPATH_ABSOLUTE, SP_COPY_WARNIFSKIP, SP_FLAG_CABINETCONTINUATION, SPFILEQ_FILE_IN_USE, SPFILEQ_REBOOT_IN_PROGRESS, SPFILEQ_REBOOT_RECOMMENDED
 
Constructor Summary
WinSetupFileQueue(Librarian librarian)
          Creates a new file queue which uses the default setup callback handler from the Windows Setup API.
WinSetupFileQueue(Librarian librarian, WinSetupQueueCallbackInterface handler)
          Creates a new file queue and defines a Java callback handler for it that is used instead of the default setup callback handler from the Windows Setup API.
 
Method Summary
 void addCopy(File sourcefile, File targetfile)
          Places an individual file copy operation on a setup file queue.
 void addCopy(File sourcefile, File targetfile, boolean forceInUse)
          Places an individual file copy operation on a setup file queue.
protected  void addCopy(File sourcefile, File targetfile, int copyStyle)
          Places an individual file copy operation on a setup file queue.
 void addDelete(File file)
          Places an individual file delete operation on a setup file queue.
 void addMove(File sourcefile, File targetfile)
          Places an individual file move operation on a setup file queue.
 void addMove(File sourcefile, File targetfile, boolean forceInUse)
          Places an individual file move operation on a setup file queue.
 void addRename(File sourcefile, File targetfile)
          Places an individual file rename operation on a setup file queue.
 void close()
          Closes the file queue.
 boolean commit()
          Commits the enqueued operations in the file queue.
 boolean isRebootNecessary()
          Check whether reboot is necessary to apply committed changes.
 
Methods inherited from class com.izforge.izpack.util.os.WinSetupAPIBase
freeLibrary, SetupCloseFileQueue, SetupCommitFileQueue, SetupOpenFileQueue, SetupPromptReboot, SetupQueueCopy, SetupQueueDelete, SetupQueueRename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinSetupFileQueue

public WinSetupFileQueue(Librarian librarian)
                  throws Exception
Creates a new file queue which uses the default setup callback handler from the Windows Setup API.

Parameters:
librarian - the librarian
Throws:
Exception - if the WinSetupAPI library cannot be loaded

WinSetupFileQueue

public WinSetupFileQueue(Librarian librarian,
                         WinSetupQueueCallbackInterface handler)
                  throws IOException
Creates a new file queue and defines a Java callback handler for it that is used instead of the default setup callback handler from the Windows Setup API.

Parameters:
librarian - the librarian
handler - Java callback handler
Throws:
IzPackException - if the WinSetupAPI library cannot be loaded
IOException
Method Detail

addCopy

protected void addCopy(File sourcefile,
                       File targetfile,
                       int copyStyle)
                throws IOException
Places an individual file copy operation on a setup file queue.

Parameters:
sourcefile - Copy source file
targetfile - Copy target file
copyStyle - A bitwise 'or-ed' combination of copy styles
Throws:
IOException

addCopy

public void addCopy(File sourcefile,
                    File targetfile)
             throws IOException
Places an individual file copy operation on a setup file queue.

Parameters:
sourcefile - Copy source file
targetfile - Copy target file
Throws:
IOException

addCopy

public void addCopy(File sourcefile,
                    File targetfile,
                    boolean forceInUse)
             throws IOException
Places an individual file copy operation on a setup file queue.

Parameters:
sourcefile - Copy source file
targetfile - Copy target file
forceInUse - Whether to force target-in-use behavior
Throws:
IOException

addDelete

public void addDelete(File file)
               throws IOException
Places an individual file delete operation on a setup file queue.

Parameters:
file - File to delete.
Throws:
IOException

addRename

public void addRename(File sourcefile,
                      File targetfile)
               throws IOException
Places an individual file rename operation on a setup file queue. Note: The target file must not exist, otherwise committing the queue will fail. For moving a file to an existing target use addMove.

Parameters:
sourcefile - Rename source file
targetfile - Rename target file
Throws:
IOException

addMove

public void addMove(File sourcefile,
                    File targetfile)
             throws IOException
Places an individual file move operation on a setup file queue. This is done by a copy/delete operation since we want to be sure whether the move really happened.

Parameters:
sourcefile - Move source file
targetfile - Move target file
Throws:
IOException

addMove

public void addMove(File sourcefile,
                    File targetfile,
                    boolean forceInUse)
             throws IOException
Places an individual file move operation on a setup file queue. This is done by a copy/delete operation since we want to be sure whether the move really happened.

Parameters:
sourcefile - Move source file
targetfile - Move target file
forceInUse - Whether to force target-in-use behavior
Throws:
IOException

commit

public boolean commit()
               throws IOException
Commits the enqueued operations in the file queue.

Throws:
IOException

close

public void close()
Closes the file queue.


isRebootNecessary

public boolean isRebootNecessary()
Check whether reboot is necessary to apply committed changes. Valid only after committing the file queue, otherwise always false.

Returns:
true - if reboot is necessary to apply committed changes


Copyright © 2018. All rights reserved.