net.sf.jpkgmk.prototype
Class AbstractPrototypeEntry

java.lang.Object
  extended by net.sf.jpkgmk.AbstractLineProvider
      extended by net.sf.jpkgmk.prototype.AbstractPrototypeEntry
All Implemented Interfaces:
LineProvider, PrototypeEntry
Direct Known Subclasses:
AbstractPrototypeEntryDevice, PrototypeEntryDirectory, PrototypeEntryFile, PrototypeEntryLink, PrototypeEntryPipe, PrototypeEntrySymbolicLink

public abstract class AbstractPrototypeEntry
extends AbstractLineProvider
implements PrototypeEntry

Abstract class that can be used for the most of the prototype entries, for example files, directories, links ...

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 $

Field Summary
static java.lang.String DEFAULT_FILE_CLASS
           
 
Constructor Summary
AbstractPrototypeEntry(java.lang.Integer part, PrototypeEntryType fileType, java.lang.String fileClass, java.lang.String entryPath, java.lang.String entryPathSource, java.lang.Integer major, java.lang.Integer minor, java.lang.String mode, java.lang.String owner, java.lang.String group, PrototypeEntryCommandDefault entryCommandDefault)
          Full constructor taking all possible arguments
AbstractPrototypeEntry(java.lang.Integer part, PrototypeEntryType fileType, java.lang.String fileClass, java.lang.String entryPath, java.lang.String entryPathSource, java.lang.String mode, java.lang.String owner, java.lang.String group, PrototypeEntryCommandDefault entryCommandDefault)
           
AbstractPrototypeEntry(PrototypeEntryType fileType, java.lang.String entryPath)
          Constructor taking the mandatory arguments to create a prototype file entry
AbstractPrototypeEntry(PrototypeEntryType fileType, java.lang.String entryPath, java.lang.String mode, java.lang.String owner, java.lang.String group)
           
AbstractPrototypeEntry(PrototypeEntryType fileType, java.lang.String fileClass, java.lang.String entryPath, java.lang.String entryPathSource, java.lang.String mode, java.lang.String owner, java.lang.String group, PrototypeEntryCommandDefault entryCommandDefault)
           
 
Method Summary
protected  java.io.File buildAbsolutePath(java.io.File targetDir, java.lang.String prototypeEntryPath)
           
protected abstract  void create(java.io.File targetDir, java.lang.String entryPathExpanded, java.lang.String entryPathSourceExpanded)
          Copies the file of this prototype entry into the target directory
 void create(java.io.File targetDir, VariableResolver variableResolver)
          Copies the file of this prototype entry into the target directory
 java.util.List<PkgMapEntry> createPkgMapEntry(java.io.File targetDir, VariableResolver variableResolver)
          Creates the PkgMapEntry objects for this PrototypeEntry.
protected abstract  PkgMapEntry createPkgMapEntry(java.lang.Integer part, PkgMapEntryType resultType, java.lang.String entryClass, java.lang.String entryPath, java.lang.String entryPathSource, java.lang.Integer major, java.lang.Integer minor, java.lang.String mode, java.lang.String owner, java.lang.String group, java.io.File targetDir)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getEntryPath()
           
 java.lang.String getEntryPathSource()
           
 java.lang.String getFileClass()
           
 java.lang.String getGroup()
           
 java.lang.String getLine()
           
 java.lang.Integer getMajor()
           
 java.lang.Integer getMinor()
           
 java.lang.String getMode()
           
 java.lang.String getOwner()
           
 PrototypeEntryType getType()
           
 int hashCode()
           
protected  java.lang.String resolveGroup()
           
protected  java.lang.String resolveMode()
           
protected  java.lang.String resolveOwner()
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jpkgmk.AbstractLineProvider
write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.jpkgmk.LineProvider
write
 

Field Detail

DEFAULT_FILE_CLASS

public static final java.lang.String DEFAULT_FILE_CLASS
See Also:
Constant Field Values
Constructor Detail

AbstractPrototypeEntry

public AbstractPrototypeEntry(PrototypeEntryType fileType,
                              java.lang.String entryPath)
Constructor taking the mandatory arguments to create a prototype file entry

Parameters:
fileType -
value -

AbstractPrototypeEntry

public AbstractPrototypeEntry(PrototypeEntryType fileType,
                              java.lang.String entryPath,
                              java.lang.String mode,
                              java.lang.String owner,
                              java.lang.String group)
Parameters:
fileType -
fileClass -
entryPath - the target path in that this file/directory should have in the package
mode -
owner -
group -

AbstractPrototypeEntry

public AbstractPrototypeEntry(PrototypeEntryType fileType,
                              java.lang.String fileClass,
                              java.lang.String entryPath,
                              java.lang.String entryPathSource,
                              java.lang.String mode,
                              java.lang.String owner,
                              java.lang.String group,
                              PrototypeEntryCommandDefault entryCommandDefault)
Parameters:
fileType -
fileClass -
entryPath - the target path in that this file/directory should have in the package
entryPathSource - path to the local source file
mode -
owner -
group -

AbstractPrototypeEntry

public AbstractPrototypeEntry(java.lang.Integer part,
                              PrototypeEntryType fileType,
                              java.lang.String fileClass,
                              java.lang.String entryPath,
                              java.lang.String entryPathSource,
                              java.lang.String mode,
                              java.lang.String owner,
                              java.lang.String group,
                              PrototypeEntryCommandDefault entryCommandDefault)
Parameters:
part -
fileType -
fileClass -
entryPath - the target path that this file/directory should have in the created package
entryPathSource - path to the local source file
mode -
owner -
group -

AbstractPrototypeEntry

public AbstractPrototypeEntry(java.lang.Integer part,
                              PrototypeEntryType fileType,
                              java.lang.String fileClass,
                              java.lang.String entryPath,
                              java.lang.String entryPathSource,
                              java.lang.Integer major,
                              java.lang.Integer minor,
                              java.lang.String mode,
                              java.lang.String owner,
                              java.lang.String group,
                              PrototypeEntryCommandDefault entryCommandDefault)
Full constructor taking all possible arguments

Parameters:
part - Optional part number
fileType -
fileClass -
entryPath - the target path in that this file/directory should have in the package
entryPathSource - path to the local source file
major - The major device number. The field is only specified for block or character special devices.
minor - The minor device number. The field is only specified for block or character special devices.
mode -
owner -
group -
entryCommandDefault -
Method Detail

getLine

public java.lang.String getLine()
Specified by:
getLine in interface LineProvider
Returns:
The prototype line

getType

public PrototypeEntryType getType()
Specified by:
getType in interface PrototypeEntry
Returns:
Returns the type of this entry

getEntryPath

public java.lang.String getEntryPath()

getEntryPathSource

public java.lang.String getEntryPathSource()

getFileClass

public java.lang.String getFileClass()

getMode

public java.lang.String getMode()

getOwner

public java.lang.String getOwner()

getGroup

public java.lang.String getGroup()

getMajor

public java.lang.Integer getMajor()

getMinor

public java.lang.Integer getMinor()

resolveMode

protected final java.lang.String resolveMode()

resolveOwner

protected final java.lang.String resolveOwner()

resolveGroup

protected final java.lang.String resolveGroup()

buildAbsolutePath

protected java.io.File buildAbsolutePath(java.io.File targetDir,
                                         java.lang.String prototypeEntryPath)

create

public final void create(java.io.File targetDir,
                         VariableResolver variableResolver)
                  throws java.io.IOException
Copies the file of this prototype entry into the target directory

Specified by:
create in interface PrototypeEntry
variableResolver - The variable resolver to be used for expanding variables within the paths of this entry
Throws:
java.io.IOException
See Also:
PrototypeEntry.create(java.io.File, VariableResolver)

create

protected abstract void create(java.io.File targetDir,
                               java.lang.String entryPathExpanded,
                               java.lang.String entryPathSourceExpanded)
                        throws java.io.IOException
Copies the file of this prototype entry into the target directory

Throws:
java.io.IOException

createPkgMapEntry

public java.util.List<PkgMapEntry> createPkgMapEntry(java.io.File targetDir,
                                                     VariableResolver variableResolver)
Description copied from interface: PrototypeEntry
Creates the PkgMapEntry objects for this PrototypeEntry.

Specified by:
createPkgMapEntry in interface PrototypeEntry
Parameters:
targetDir - The directory in which the pkgMap entry is located
Returns:
The list of all created PkgMapEntry objects created by this prototype entry. Can be empty.
See Also:
PrototypeEntry.createPkgMapEntry(java.io.File, net.sf.jpkgmk.util.VariableResolver)

createPkgMapEntry

protected abstract PkgMapEntry createPkgMapEntry(java.lang.Integer part,
                                                 PkgMapEntryType resultType,
                                                 java.lang.String entryClass,
                                                 java.lang.String entryPath,
                                                 java.lang.String entryPathSource,
                                                 java.lang.Integer major,
                                                 java.lang.Integer minor,
                                                 java.lang.String mode,
                                                 java.lang.String owner,
                                                 java.lang.String group,
                                                 java.io.File targetDir)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

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


Copyright © 2007-2008. All Rights Reserved.