org.fuin.kickstart4j
Class UpdateSet

java.lang.Object
  extended by org.fuin.kickstart4j.UpdateSet

public final class UpdateSet
extends java.lang.Object

Set of update operations based on a list fo source files and a local directory.


Constructor Summary
UpdateSet(java.util.List srcFiles, java.util.List mkDirs, java.io.File destDir, boolean lazyLoading)
          Constructor with source URL and destination directory.
 
Method Summary
 java.lang.String createClasspath()
          Creates a classpath from the entries in the classpathJarFiles list.
 java.util.List getChangedFiles()
          Returns a list of files that changed.
 java.util.List getChangedFiles(int order)
          Returns a list of files that changed and have a given order.
 java.util.List getClasspathJarFiles()
          Returns a list of jar files needed for starting the target application.
 java.util.List getDecompressFiles()
          Returns a list of files that needs to be decompressed after the copy.
 java.util.List getDecompressFiles(int order)
          Returns a list of files that needs to be decompressed after the copy and have a given order.
 java.util.List getDeletedFiles()
          Returns a list of files that are present in the local directory but no longer needed.
 java.util.List getDeletedFiles(int order)
          Returns a list of files that are present in the local directory but no longer needed and have a given order.
 java.io.File getDestDir()
          Returns the destination directory.
 java.util.List getMkDirs()
          Returns a list of directories to create at the target location.
 java.util.List getNewFiles()
          Returns a list of files that are new.
 java.util.List getNewFiles(int order)
          Returns a list of files that are new and have a given order.
 java.util.List getOrderList()
          Returns a list of order numbers included in "newFiles", "changedFiles", "unchangedFiles" or "decompressFiles".
 java.util.List getUnchangedFiles()
          Returns a list of files that haven't changed.
 java.util.List getUnchangedFiles(int order)
          Returns a list of files that haven't changed and have a given order.
 boolean isUpdateNecessary()
          Checks if there is are new or changed files or files to be deleted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateSet

public UpdateSet(java.util.List srcFiles,
                 java.util.List mkDirs,
                 java.io.File destDir,
                 boolean lazyLoading)
Constructor with source URL and destination directory.

Parameters:
srcFiles - List of SrcFile objects - Cannot be null.
mkDirs - List of MkDir objects - Cannot be null.
destDir - Destination directory - Cannot be null and must exist!
lazyLoading - If lazy loading is active true else false.
Method Detail

getDestDir

public final java.io.File getDestDir()
Returns the destination directory.

Returns:
Local program directory.

getNewFiles

public final java.util.List getNewFiles()
Returns a list of files that are new.

Returns:
List of SrcFile that are not present in the local directory.

getNewFiles

public final java.util.List getNewFiles(int order)
Returns a list of files that are new and have a given order.

Parameters:
order - Order number.
Returns:
List of SrcFile that are not present in the local directory.

getChangedFiles

public final java.util.List getChangedFiles()
Returns a list of files that changed.

Returns:
List of SrcFile with a difference between remote and local directory.

getChangedFiles

public final java.util.List getChangedFiles(int order)
Returns a list of files that changed and have a given order.

Parameters:
order - Order number.
Returns:
List of SrcFile with a difference between remote and local directory.

getDeletedFiles

public final java.util.List getDeletedFiles()
Returns a list of files that are present in the local directory but no longer needed.

Returns:
List of SrcFile no longer present on remote directory.

getDeletedFiles

public final java.util.List getDeletedFiles(int order)
Returns a list of files that are present in the local directory but no longer needed and have a given order.

Parameters:
order - Order number.
Returns:
List of SrcFile no longer present on remote directory.

getUnchangedFiles

public final java.util.List getUnchangedFiles()
Returns a list of files that haven't changed.

Returns:
List of SrcFile without a difference between remote and local directory.

getUnchangedFiles

public final java.util.List getUnchangedFiles(int order)
Returns a list of files that haven't changed and have a given order.

Parameters:
order - Order number.
Returns:
List of SrcFile without a difference between remote and local directory.

getDecompressFiles

public final java.util.List getDecompressFiles()
Returns a list of files that needs to be decompressed after the copy.

Returns:
List of SrcFile that are unzipped at the destination directory.

getDecompressFiles

public final java.util.List getDecompressFiles(int order)
Returns a list of files that needs to be decompressed after the copy and have a given order.

Parameters:
order - Order number.
Returns:
List of SrcFile that are unzipped at the destination directory.

getClasspathJarFiles

public final java.util.List getClasspathJarFiles()
Returns a list of jar files needed for starting the target application.

Returns:
List of SrcFile that are added to the classpath.

getMkDirs

public final java.util.List getMkDirs()
Returns a list of directories to create at the target location.

Returns:
List of MkDir objects.

getOrderList

public final java.util.List getOrderList()
Returns a list of order numbers included in "newFiles", "changedFiles", "unchangedFiles" or "decompressFiles".

Returns:
Sorted list of order numbers (lowest to highest).

isUpdateNecessary

public final boolean isUpdateNecessary()
Checks if there is are new or changed files or files to be deleted.

Returns:
If an update needs to be performed true else false.

createClasspath

public final java.lang.String createClasspath()
Creates a classpath from the entries in the classpathJarFiles list.

Returns:
List of JAR-files.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.