Package org.technologybrewery.baton
Class AbstractMigration
java.lang.Object
org.technologybrewery.baton.AbstractMigration
- All Implemented Interfaces:
Migration
Common migration logic to make it easier to implement custom migrations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected booleanprotected Stringprotected Stringprotected intprotected org.apache.maven.project.MavenProjectEnables access to the runtime properties associated with the project's POM configuration against which Baton is being executed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbackupOriginalFile(File originalFile) execute(org.apache.maven.shared.model.fileset.FileSet[] fileSets) If active, validates applicability of the migration each targeted file and then performs the migration.protected Fileprotected Stringorg.apache.maven.project.MavenProjectgetName()intbooleanisActive()booleanprotected abstract booleanperformMigration(File file) Called to perform the specific migration logic.voidsetActive(boolean active) voidsetBackupCustomLocation(String backupCustomLocation) voidsetBackupMigratedOriginalFiles(boolean backupOriginalMigratedFiles) voidsetBackupOriginalMigratedFiles(boolean backupOriginalMigratedFiles) voidsetDescription(String description) voidsetFileNamePatterns(Set<String> fileNamePatterns) voidsetMavenProject(org.apache.maven.project.MavenProject project) voidvoidsetNumberOfBacksUpsToKeep(int numberOfBacksUpsToKeep) booleanprotected abstract booleanshouldExecuteOnFile(File file) Called to determine if this migration should be run on the passed file.
-
Field Details
-
name
-
description
-
active
protected boolean active -
fileNamePatterns
-
backupOriginalMigratedFiles
protected boolean backupOriginalMigratedFiles -
backupCustomLocation
-
numberOfBackupsToKeep
protected int numberOfBackupsToKeep -
project
protected org.apache.maven.project.MavenProject projectEnables access to the runtime properties associated with the project's POM configuration against which Baton is being executed.
-
-
Constructor Details
-
AbstractMigration
public AbstractMigration()
-
-
Method Details
-
shouldExecuteOnFile
Called to determine if this migration should be run on the passed file.- Parameters:
file- file to check- Returns:
- to execute or not
-
performMigration
Called to perform the specific migration logic.- Parameters:
file- file to migrate- Returns:
- if successful or not
-
backupOriginalFile
-
getBasedir
-
getBuildDir
-
getName
-
setName
-
getDescription
- Specified by:
getDescriptionin interfaceMigration
-
setDescription
- Specified by:
setDescriptionin interfaceMigration
-
isActive
public boolean isActive() -
setActive
public void setActive(boolean active) -
getFileNamePatterns
- Specified by:
getFileNamePatternsin interfaceMigration
-
setFileNamePatterns
- Specified by:
setFileNamePatternsin interfaceMigration
-
shouldBackupMigratedOriginalFiles
public boolean shouldBackupMigratedOriginalFiles()- Specified by:
shouldBackupMigratedOriginalFilesin interfaceMigration
-
setBackupMigratedOriginalFiles
public void setBackupMigratedOriginalFiles(boolean backupOriginalMigratedFiles) - Specified by:
setBackupMigratedOriginalFilesin interfaceMigration
-
isBackupOriginalMigratedFiles
public boolean isBackupOriginalMigratedFiles() -
setBackupOriginalMigratedFiles
public void setBackupOriginalMigratedFiles(boolean backupOriginalMigratedFiles) -
getBackupCustomLocation
- Specified by:
getBackupCustomLocationin interfaceMigration
-
setBackupCustomLocation
- Specified by:
setBackupCustomLocationin interfaceMigration
-
getNumberOfBacksUpsToKeep
public int getNumberOfBacksUpsToKeep()- Specified by:
getNumberOfBacksUpsToKeepin interfaceMigration
-
setNumberOfBacksUpsToKeep
public void setNumberOfBacksUpsToKeep(int numberOfBacksUpsToKeep) - Specified by:
setNumberOfBacksUpsToKeepin interfaceMigration
-
setMavenProject
public void setMavenProject(org.apache.maven.project.MavenProject project) - Specified by:
setMavenProjectin interfaceMigration
-
getMavenProject
public org.apache.maven.project.MavenProject getMavenProject()- Specified by:
getMavenProjectin interfaceMigration