|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprotoj.lang.ProjectArchive
public final class ProjectArchive
Provides support for creating a compressed tar of the entire project. If further configuration is required, such as adding or excluding directories, then supply an appropriate config argument to the constructor below. In the following example, an extra directory called "exampledir" gets included in the mytar tar.gz file:
config = new ArgRunnable<ProjectArchive>() {
public void configure(ProjectArchive feature) {
feature.addFileSet("777", "777", "exampledir/**", null);
}
};
tarFeature = new ProjectArchive(this, name, userName, group, config);
Ant tasks can only be used once and cannot be reconfigured for a second time.
And so the solution is to place the configuration (the api calls) in a
runnable as in the above example so that it can be stored. The
createArchive(boolean, boolean) method then creates a brand new ant
tar task every time, but passes it through the runnable that was supplied to
the constructor so that it can be configured correctly.
| Constructor Summary | |
|---|---|
ProjectArchive(ArchiveFeature parent,
java.lang.String name,
java.lang.String prefix,
java.lang.String userName,
java.lang.String group,
ArgRunnable<ProjectArchive> config)
The individual property getter methods describe the parameters of the same name. |
|
| Method Summary | |
|---|---|
void |
addFileSet(java.lang.String fileMode,
java.lang.String dirMode,
java.lang.String includes,
java.lang.String excludes)
Adds the given fileset definition to the underlying tar ant task. |
void |
createArchive(boolean noSrc,
boolean isGlobalRwx)
Creates a tar of the parent in the target directory. |
org.apache.tools.ant.taskdefs.Tar |
getAntTar()
The underlying ant object, which can be used for further customization. |
java.io.File |
getArchiveFile()
|
java.lang.String |
getArchivePath()
Returns the full path name of the compressed tar file, eg /a/b/c/foo.tar.gz. |
java.lang.String |
getConfExcludesPattern()
The pattern used to filter out properties files from directly under the conf directory. |
java.lang.String |
getGroup()
The groupname for the tar entries. |
java.lang.String |
getLibExcludesPattern()
The pattern used to filter out source and javadoc jar files from directly under the lib directory. |
java.lang.String |
getLogExcludesPattern(java.io.File logFile)
The pattern used to filter out the protoj log file from the log directory. |
java.lang.String |
getName()
The name to be used in the tar file before any prefix or suffix decoration or file extensions have been applied. |
ArchiveFeature |
getParent()
The parent of this feature. |
java.lang.String |
getPrefix()
Often an application installation directory has additional business requirements such as the inclusion of a version number, customer product identifier and so on. |
java.lang.String |
getUncompressedPath()
Returns the full path name of the uncompressed tar file, eg /a/b/c/foo.tar. |
java.lang.String |
getUserName()
The username for the tar entries. |
boolean |
isGlobalRwx()
If this is true then permissions are set to rwx on all files and directories in the tar, overriding any original configuration. |
boolean |
isNoSrc()
Whether or not to include the source directory in the tar. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProjectArchive(ArchiveFeature parent,
java.lang.String name,
java.lang.String prefix,
java.lang.String userName,
java.lang.String group,
ArgRunnable<ProjectArchive> config)
ProjectArchive for more explanation of the
ArgRunnable parameter.
parent - name - prefix - userName - group - config - | Method Detail |
|---|
public ArchiveFeature getParent()
public java.lang.String getUserName()
public java.lang.String getGroup()
public java.lang.String getName()
public java.lang.String getPrefix()
public boolean isNoSrc()
public boolean isGlobalRwx()
public org.apache.tools.ant.taskdefs.Tar getAntTar()
public java.lang.String getUncompressedPath()
public java.lang.String getArchivePath()
public java.io.File getArchiveFile()
public void addFileSet(java.lang.String fileMode,
java.lang.String dirMode,
java.lang.String includes,
java.lang.String excludes)
isGlobalRwx() is set to true then the fileMode and dirMode
parameters are ignored in favor of the most relaxed rwx permissions.
fileMode - dirMode - includes - excludes -
public void createArchive(boolean noSrc,
boolean isGlobalRwx)
initTarTask(). Finally it is configured by applying the
config strategy and then executed.
noSrc - true in order to exclude the src directory, false otherwise.isGlobalRwx - true to override preconfigured permissions with rwx, false to
leave alonepublic java.lang.String getLogExcludesPattern(java.io.File logFile)
public java.lang.String getConfExcludesPattern()
public java.lang.String getLibExcludesPattern()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||