Package org.apache.tomcat.jakartaee
Class Migration
java.lang.Object
org.apache.tomcat.jakartaee.Migration
The main class for the Migration tool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
static enum
The tool state. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private File
private boolean
private static final org.apache.commons.compress.archivers.zip.ZipShort
private static final Logger
private boolean
private EESpecProfile
private static final StringManager
private File
private Migration.State
private static final long
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExclude
(String exclude) Add specified resource exclusion.void
execute()
Execute migration operation.Get the Jakarta EE profile being used.boolean
NOTE: this method is not to indicate that no changes were made, but that the source can be used and satisfy the selected profile.private boolean
private boolean
isExcluded
(String name) private boolean
isSignatureFile
(String sourceName) private void
migrateArchiveInMemory
(InputStream src, OutputStream dest) private void
migrateArchiveStreaming
(InputStream src, OutputStream dest) private void
migrateDirectory
(File src, File dest) private void
migrateFile
(File src, File dest) private void
migrateStream
(String name, InputStream src, OutputStream dest) void
setDestination
(File destination) Set destination file.void
setEESpecProfile
(EESpecProfile profile) Set the Jakarta EE specifications that should be used.void
setEnableDefaultExcludes
(boolean enableDefaultExcludes) Enable the default exclusion list for the tool.void
setMatchExcludesAgainstPathName
(boolean matchExcludesAgainstPathName) Enable exclude matching against the path name.void
Set source file.void
setZipInMemory
(boolean zipInMemory) Buffer all conversion operations for compressed archives in memory.
-
Field Details
-
logger
-
sm
-
DEFAULT_EXCLUDES
-
EXTRA_FIELD_ZIP64
private static final org.apache.commons.compress.archivers.zip.ZipShort EXTRA_FIELD_ZIP64 -
ZIP64_THRESHOLD_LENGTH
private static final long ZIP64_THRESHOLD_LENGTH- See Also:
-
profile
-
enableDefaultExcludes
private boolean enableDefaultExcludes -
matchExcludesAgainstPathName
private boolean matchExcludesAgainstPathName -
zipInMemory
private boolean zipInMemory -
converted
private boolean converted -
state
-
source
-
destination
-
converters
-
excludes
-
-
Constructor Details
-
Migration
public Migration()Construct a new migration tool instance.
-
-
Method Details
-
setEESpecProfile
Set the Jakarta EE specifications that should be used.- Parameters:
profile
- the Jakarta EE specification profile
-
getEESpecProfile
Get the Jakarta EE profile being used.- Returns:
- the profile
-
setEnableDefaultExcludes
public void setEnableDefaultExcludes(boolean enableDefaultExcludes) Enable the default exclusion list for the tool.- Parameters:
enableDefaultExcludes
- true to enable the default
-
setMatchExcludesAgainstPathName
public void setMatchExcludesAgainstPathName(boolean matchExcludesAgainstPathName) Enable exclude matching against the path name.- Parameters:
matchExcludesAgainstPathName
- true to match excludes against the path name instead of the file name
-
setZipInMemory
public void setZipInMemory(boolean zipInMemory) Buffer all conversion operations for compressed archives in memory.- Parameters:
zipInMemory
- true to buffer in memory
-
addExclude
Add specified resource exclusion.- Parameters:
exclude
- the exclude to add
-
setSource
Set source file.- Parameters:
source
- the source file
-
setDestination
Set destination file.- Parameters:
destination
- the destination file
-
hasConverted
public boolean hasConverted()NOTE: this method is not to indicate that no changes were made, but that the source can be used and satisfy the selected profile.- Returns:
- true if converted occurs
-
execute
Execute migration operation.- Throws:
IOException
- when an exception occurs
-
migrateDirectory
- Throws:
IOException
-
migrateFile
- Throws:
IOException
-
migrateArchiveStreaming
- Throws:
IOException
-
migrateArchiveInMemory
- Throws:
IOException
-
isSignatureFile
-
migrateStream
- Throws:
IOException
-
isArchive
-
isExcluded
-