net.sf.jpkgmk.prototype
Class PrototypeBuilder

java.lang.Object
  extended by net.sf.jpkgmk.prototype.PrototypeBuilder

public class PrototypeBuilder
extends java.lang.Object

Utility that helps creating a prototype file.

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
PrototypeBuilder()
           
PrototypeBuilder(java.io.File basedir)
           
PrototypeBuilder(java.io.File basedir, java.lang.String defaultUser, java.lang.String defaultGroup)
           
PrototypeBuilder(java.io.File basedir, java.lang.String defaultUser, java.lang.String defaultGroup, PermissionProvider defaultPermissionProvider)
           
 
Method Summary
 void add(PrototypeEntry prototypeEntry)
           
 void addDirectory(java.io.File directory)
          Adds the given directory recursively to this prototype file.
 void addDirectory(java.io.File directory, boolean recurse)
          Adds the given directory recursively to this prototype file.
 void addDirectory(java.io.File directory, java.lang.String targetPathDir)
          Adds the given directory recursively to this prototype file.
 void addDirectory(java.io.File directory, java.lang.String targetPathDir, java.lang.String owner, java.lang.String group, PermissionProvider permissionProvider)
          Adds the given directory recursively to this prototype file.
 void addDirectory(java.io.File directory, java.lang.String targetPathDir, java.lang.String owner, java.lang.String group, PermissionProvider permissionProvider, java.io.FileFilter fileFilter, boolean recurse)
          Adds the given directory recursively to this prototype file.
protected  void addDirectoryInternal(java.io.File directory, java.lang.String targetPathDir, java.lang.String owner, java.lang.String group, PermissionProvider permissionProvider, java.io.FileFilter fileFilter, boolean recurse)
           
 void addFile(java.io.File sourceFile)
           
 PrototypeEntryFile addFile(java.io.File sourceFile, PrototypeEntryType type)
           
 PrototypeEntryFile addFile(java.io.File sourceFile, PrototypeEntryType type, java.lang.String targetPathForPackage)
           
protected  PrototypeEntryFile addFileInternal(java.io.File currentFile, java.lang.String filePathOnTarget, java.lang.String owner, java.lang.String group, PermissionProvider permissionProvider, PrototypeEntryType entryType)
           
 void addLink(java.lang.String linkLocation, PrototypeEntryFile entry)
           
 java.io.File clean()
           
 java.io.File create()
           
 java.lang.String getDefaultGroup()
           
 java.lang.String getDefaultUser()
           
 java.io.File getFile()
           
 Prototype getPrototype()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrototypeBuilder

public PrototypeBuilder()
See Also:
PrototypeBuilder(File, String, String, PermissionProvider)

PrototypeBuilder

public PrototypeBuilder(java.io.File basedir)
See Also:
PrototypeBuilder(File, String, String, PermissionProvider)

PrototypeBuilder

public PrototypeBuilder(java.io.File basedir,
                        java.lang.String defaultUser,
                        java.lang.String defaultGroup)
See Also:
PrototypeBuilder(File, String, String, PermissionProvider)

PrototypeBuilder

public PrototypeBuilder(java.io.File basedir,
                        java.lang.String defaultUser,
                        java.lang.String defaultGroup,
                        PermissionProvider defaultPermissionProvider)
Parameters:
basedir - The basedirectory in which the prototype file is created after invocation of the create() method.
defaultUser -
defaultGroup -
defaultPermissionProvider -
Method Detail

getDefaultUser

public java.lang.String getDefaultUser()

getDefaultGroup

public java.lang.String getDefaultGroup()

getPrototype

public Prototype getPrototype()

add

public void add(PrototypeEntry prototypeEntry)

addLink

public void addLink(java.lang.String linkLocation,
                    PrototypeEntryFile entry)

addFile

public void addFile(java.io.File sourceFile)
             throws java.io.IOException
Throws:
java.io.IOException

addFile

public PrototypeEntryFile addFile(java.io.File sourceFile,
                                  PrototypeEntryType type)
                           throws java.io.IOException
Throws:
java.io.IOException

addFile

public PrototypeEntryFile addFile(java.io.File sourceFile,
                                  PrototypeEntryType type,
                                  java.lang.String targetPathForPackage)
                           throws java.io.IOException
Throws:
java.io.IOException

addDirectory

public void addDirectory(java.io.File directory)
Adds the given directory recursively to this prototype file. All files/subfiles and subdirs are included.

Parameters:
directory -

addDirectory

public void addDirectory(java.io.File directory,
                         boolean recurse)
Adds the given directory recursively to this prototype file. All files/subfiles and subdirs are included.

Parameters:
directory -
recurse -

addDirectory

public void addDirectory(java.io.File directory,
                         java.lang.String targetPathDir)
Adds the given directory recursively to this prototype file. All files/subfiles and subdirs are included.

Parameters:
directory -
targetPathDir -

addDirectory

public void addDirectory(java.io.File directory,
                         java.lang.String targetPathDir,
                         java.lang.String owner,
                         java.lang.String group,
                         PermissionProvider permissionProvider)
Adds the given directory recursively to this prototype file. All files/subfiles and subdirs are included.

Parameters:
directory -
owner -
group -
permissionProvider -
targetPathDir -

addDirectory

public void addDirectory(java.io.File directory,
                         java.lang.String targetPathDir,
                         java.lang.String owner,
                         java.lang.String group,
                         PermissionProvider permissionProvider,
                         java.io.FileFilter fileFilter,
                         boolean recurse)
Adds the given directory recursively to this prototype file. All files/subfiles and subdirs are included.

Parameters:
directory - The directory to be added to the prototype
targetPathDir - Path for this directory on the target machine. Can be null
owner - Owner of the directory and the child files. Can be null
group - Group of the directory and the child files. Can be null
permissionProvider - Permission provider for the given directory and the child files. Can be null
fileFilter - Can be null. Filters out some unwished files.
recurse - If subdirectories should be included

addDirectoryInternal

protected void addDirectoryInternal(java.io.File directory,
                                    java.lang.String targetPathDir,
                                    java.lang.String owner,
                                    java.lang.String group,
                                    PermissionProvider permissionProvider,
                                    java.io.FileFilter fileFilter,
                                    boolean recurse)

addFileInternal

protected PrototypeEntryFile addFileInternal(java.io.File currentFile,
                                             java.lang.String filePathOnTarget,
                                             java.lang.String owner,
                                             java.lang.String group,
                                             PermissionProvider permissionProvider,
                                             PrototypeEntryType entryType)

clean

public java.io.File clean()

create

public java.io.File create()
                    throws java.io.IOException
Throws:
java.io.IOException

getFile

public java.io.File getFile()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007-2008. All Rights Reserved.