Top Description Inners Fields Constructors Methods
org.apache.tomcat.jakartaee

public Class Migration

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .File, .FileInputStream, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.util.ArrayList, .Enumeration, .HashSet, .List, .Set, java.util.concurrent.TimeUnit, java.util.logging.Level, .Logger, java.util.zip.CRC32, .ZipEntry, .ZipException, org.apache.commons.compress.archivers.zip.ZipArchiveEntry, .ZipArchiveInputStream, .ZipArchiveOutputStream, .ZipFile, .ZipShort, org.apache.commons.compress.utils.SeekableInMemoryByteChannel, org.apache.commons.io.IOUtils, org.apache.commons.io.input.CloseShieldInputStream, org.apache.commons.io.output.CloseShieldOutputStream

The main class for the Migration tool.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static enum
Migration.State

The tool state.

Field Summary

Modifier and TypeField and Description
private boolean
private final List<Converter>
private static final Set<String>
private File
private boolean
private final Set<String>
private static final 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

AccessConstructor and Description
public
Migration()

Construct a new migration tool instance.

Method Summary

Modifier and TypeMethod and Description
public void
addExclude(String
the exclude to add
exclude
)

Add specified resource exclusion.

public void
execute()

Execute migration operation.

public EESpecProfile

Returns:

the profile
getEESpecProfile
()

Get the Jakarta EE profile being used.

public boolean

Returns:

true if converted occurs
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.

private boolean
isArchive(String fileName)

private boolean
private boolean
isSignatureFile(String sourceName)

private void
private void
private void
private void
migrateFile(File src, File dest)

private void
public void
setDestination(File
the destination file
destination
)

Set destination file.

public void
setEESpecProfile(EESpecProfile
the Jakarta EE specification profile
profile
)

Set the Jakarta EE specifications that should be used.

public void
setEnableDefaultExcludes(boolean
true to enable the default
enableDefaultExcludes
)

Enable the default exclusion list for the tool.

public void
setMatchExcludesAgainstPathName(boolean
true to match excludes against the path name instead of the file name
matchExcludesAgainstPathName
)

Enable exclude matching against the path name.

public void
setSource(File
the source file
source
)

Set source file.

public void
setZipInMemory(boolean
true to buffer in memory
zipInMemory
)

Buffer all conversion operations for compressed archives in memory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

convertedback to summary
private boolean converted
convertersback to summary
private final List<Converter> converters
DEFAULT_EXCLUDESback to summary
private static final Set<String> DEFAULT_EXCLUDES
destinationback to summary
private File destination
enableDefaultExcludesback to summary
private boolean enableDefaultExcludes
excludesback to summary
private final Set<String> excludes
EXTRA_FIELD_ZIP64back to summary
private static final ZipShort EXTRA_FIELD_ZIP64
loggerback to summary
private static final Logger logger
matchExcludesAgainstPathNameback to summary
private boolean matchExcludesAgainstPathName
profileback to summary
private EESpecProfile profile
smback to summary
private static final StringManager sm
sourceback to summary
private File source
stateback to summary
private Migration.State state
ZIP64_THRESHOLD_LENGTHback to summary
private static final long ZIP64_THRESHOLD_LENGTH
zipInMemoryback to summary
private boolean zipInMemory

Constructor Detail

Migrationback to summary
public Migration()

Construct a new migration tool instance.

Method Detail

addExcludeback to summary
public void addExclude(String exclude)

Add specified resource exclusion.

Parameters
exclude:String

the exclude to add

executeback to summary
public void execute() throws IOException

Execute migration operation.

Exceptions
IOException:
when an exception occurs
getEESpecProfileback to summary
public EESpecProfile getEESpecProfile()

Get the Jakarta EE profile being used.

Returns:EESpecProfile

the profile

hasConvertedback to summary
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:boolean

true if converted occurs

isArchiveback to summary
private boolean isArchive(String fileName)
isExcludedback to summary
private boolean isExcluded(String name)
isSignatureFileback to summary
private boolean isSignatureFile(String sourceName)
migrateArchiveInMemoryback to summary
private void migrateArchiveInMemory(InputStream src, OutputStream dest) throws IOException
migrateArchiveStreamingback to summary
private void migrateArchiveStreaming(InputStream src, OutputStream dest) throws IOException
migrateDirectoryback to summary
private void migrateDirectory(File src, File dest) throws IOException
migrateFileback to summary
private void migrateFile(File src, File dest) throws IOException
migrateStreamback to summary
private void migrateStream(String name, InputStream src, OutputStream dest) throws IOException
setDestinationback to summary
public void setDestination(File destination)

Set destination file.

Parameters
destination:File

the destination file

setEESpecProfileback to summary
public void setEESpecProfile(EESpecProfile profile)

Set the Jakarta EE specifications that should be used.

Parameters
profile:EESpecProfile

the Jakarta EE specification profile

setEnableDefaultExcludesback to summary
public void setEnableDefaultExcludes(boolean enableDefaultExcludes)

Enable the default exclusion list for the tool.

Parameters
enableDefaultExcludes:boolean

true to enable the default

setMatchExcludesAgainstPathNameback to summary
public void setMatchExcludesAgainstPathName(boolean matchExcludesAgainstPathName)

Enable exclude matching against the path name.

Parameters
matchExcludesAgainstPathName:boolean

true to match excludes against the path name instead of the file name

setSourceback to summary
public void setSource(File source)

Set source file.

Parameters
source:File

the source file

setZipInMemoryback to summary
public void setZipInMemory(boolean zipInMemory)

Buffer all conversion operations for compressed archives in memory.

Parameters
zipInMemory:boolean

true to buffer in memory

org.apache.tomcat.jakartaee back to summary

private Class Migration.MigrationZipArchiveEntry

extends ZipArchiveEntry
Class Inheritance

Field Summary

Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveEntry:
CRC_UNKNOWNPLATFORM_FATPLATFORM_UNIX

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
setName(String
the name to use
name
)

Overrides org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setName.

Sets the name of the entry.
Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveEntry:
addAsFirstExtraFieldaddExtraFieldcloneequalsgetAlignmentgetCentralDirectoryExtragetCommentSourcegetDataOffsetgetDiskNumberStartgetExternalAttributesgetExtraFieldgetExtraFieldsgetExtraFieldsgetExtraFieldsgetGeneralPurposeBitgetInternalAttributesgetLastModifiedDategetLocalFileDataExtragetLocalHeaderOffsetgetMethodgetNamegetNameSourcegetPlatformgetRawFlaggetRawNamegetSizegetTimegetUnixModegetUnparseableExtraFieldDatagetVersionMadeBygetVersionRequiredhashCodeisDirectoryisStreamContiguousisUnixSymlinkremoveExtraFieldremoveUnparseableExtraFieldDatasetAlignmentsetCentralDirectoryExtrasetCommentSourcesetCreationTimesetDataOffsetsetDiskNumberStartsetExternalAttributessetExtrasetExtrasetExtraFieldssetGeneralPurposeBitsetInternalAttributessetLastAccessTimesetLastModifiedTimesetLocalHeaderOffsetsetMethodsetNamesetNameSourcesetPlatformsetRawFlagsetSizesetStreamContiguoussetTimesetTimesetUnixModesetVersionMadeBysetVersionRequired

Constructor Detail

MigrationZipArchiveEntryback to summary
pack-priv MigrationZipArchiveEntry(ZipArchiveEntry entry) throws ZipException

Method Detail

setNameback to summary
public void setName(String name)

Overrides org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setName.

Doc from org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setName.

Sets the name of the entry.

Parameters
name:String

the name to use

Annotations
@Override
org.apache.tomcat.jakartaee back to summary

public final Enum Migration.State

extends Enum<Migration.State>
Class Inheritance

The tool state.

Field Summary

Modifier and TypeField and Description
public static final Migration.State
COMPLETE

Migration complete.

public static final Migration.State
NOT_STARTED

Migration not started yet.

public static final Migration.State
RUNNING

Migration in progress.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Migration.State
public static Migration.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMPLETEback to summary
public static final Migration.State COMPLETE

Migration complete.

NOT_STARTEDback to summary
public static final Migration.State NOT_STARTED

Migration not started yet.

RUNNINGback to summary
public static final Migration.State RUNNING

Migration in progress.

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static Migration.State valueOf(String name)
valuesback to summary
public static Migration.State[] values()