Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse')
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ApplicationClientFile.java45
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Archive.java469
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ArchiveTypeDiscriminatorRegistry.java102
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ClientModuleRef.java25
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveFactoryRegistry.java48
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveResourceHandler.java121
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchiveFactory.java445
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchivePackage.java1327
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ConnectorModuleRef.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Container.java83
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EARFile.java299
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBJarFile.java55
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBModuleRef.java27
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/File.java240
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/GenericArchiveTypeDiscriminator.java47
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleFile.java96
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleRef.java180
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RARFile.java63
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ReadOnlyDirectory.java36
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RepairArchiveCommand.java163
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ValidateXmlCommand.java176
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WARFile.java100
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WebModuleRef.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/XmlValidationResult.java72
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveException.java37
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveRuntimeException.java64
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveWrappedException.java62
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DeploymentDescriptorLoadException.java62
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DuplicateObjectException.java72
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/EmptyResourceException.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/IArchiveWrappedException.java22
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ManifestException.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NestedJarException.java40
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoEJB10DescriptorsException.java42
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleElementException.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleFileException.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotADeploymentDescriptorException.java42
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotSupportedException.java59
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ObjectNotFoundException.java42
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/OpenFailureException.java63
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ReopenException.java65
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ResourceLoadException.java63
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SaveFailureException.java61
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SubclassResponsibilityException.java44
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/UncontainedModuleFileException.java43
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveConstants.java35
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveInit.java67
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifest.java20
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifestImpl.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveOptions.java248
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminator.java80
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminatorImpl.java180
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveURIConverterImpl.java316
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ExportStrategy.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileExtensionsFilterImpl.java144
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIterator.java31
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIteratorImpl.java52
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ManifestPackageEntryImpl.java110
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/NestedArchiveIterator.java79
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ResourceProxyValidator.java107
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntry.java54
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntryImpl.java138
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilter.java29
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilterImpl.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SelectedFilesFilterImpl.java84
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/AltResourceRegister.java46
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ApplicationClientFileImpl.java211
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopySessionUtility.java153
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopyUtility.java244
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveImpl.java1491
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ClientModuleRefImpl.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchiveFactoryImpl.java1099
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchivePackageImpl.java623
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ConnectorModuleRefImpl.java55
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java431
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EARFileImpl.java1214
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBJarFileImpl.java271
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBModuleRefImpl.java57
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/FileImpl.java664
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleFileImpl.java209
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleRefImpl.java546
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java254
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ReadOnlyDirectoryImpl.java114
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootArchiveTypeDescriminatorImpl.java93
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootEJBJarDescriminatorImpl.java125
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WARFileImpl.java447
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WebModuleRefImpl.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ExportStrategyImpl.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ImportStrategyImpl.java94
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategy.java24
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategyImpl.java37
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ConnectorDirectorySaveStrategyImpl.java222
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategy.java20
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategyImpl.java53
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryLoadStrategyImpl.java275
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectorySaveStrategyImpl.java251
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ExportStrategyImpl.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ImportStrategyImpl.java94
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ExportStrategyImpl.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ImportStrategyImpl.java93
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ExportStrategyImpl.java63
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategy.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategyImpl.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategy.java150
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategyImpl.java599
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NestedArchiveLoadStrategyImpl.java264
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NullLoadStrategyImpl.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarExportStrategyImpl.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarImportStrategyImpl.java96
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ReadOnlyDirectoryLoadStrategyImpl.java118
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategy.java57
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategyImpl.java280
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/TempZipFileLoadStrategyImpl.java64
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ExportStrategyImpl.java26
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ImportStrategyImpl.java94
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/XmlBasedImportStrategyImpl.java46
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipFileLoadStrategyImpl.java194
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipStreamSaveStrategyImpl.java168
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveFileDynamicClassLoader.java335
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveUtil.java904
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ClasspathUtil.java125
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveAdapterFactory.java414
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveSwitch.java518
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/DeleteOnExitUtility.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/EARFileUtil.java90
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/FileDups.java204
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java473
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.java103
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/RarFileDynamicClassLoader.java52
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/WarFileDynamicClassLoader.java80
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseApplication.java30
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseArchive.java82
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfigRegister.java358
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfiguration.java31
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseLibrary.java33
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseModule.java33
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseWARFile.java30
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigFactory.java86
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigPackage.java731
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseApplicationImpl.java157
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseArchiveImpl.java344
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseConfigurationImpl.java141
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseLibraryImpl.java187
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseModuleImpl.java150
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseWARFileImpl.java159
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigFactoryImpl.java129
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigPackageImpl.java351
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigAdapterFactory.java191
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigSwitch.java200
149 files changed, 0 insertions, 26083 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ApplicationClientFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ApplicationClientFile.java
deleted file mode 100644
index 73b84984b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ApplicationClientFile.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-
-
-/**
- * @generated
- */
-public interface ApplicationClientFile extends ModuleFile {
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
-
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The DeploymentDescriptor reference
- */
- ApplicationClient getDeploymentDescriptor() throws DeploymentDescriptorLoadException;
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the DeploymentDescriptor reference
- */
- void setDeploymentDescriptor(ApplicationClient value);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Archive.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Archive.java
deleted file mode 100644
index 8192d266c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Archive.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ReopenException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-
-
-/**
- * @generated
- */
-public interface Archive extends Container {
-
- public static final int EXPAND_NONE = 0;
- public static final int EXPAND_WAR_FILES = 1 << 1;
- public static final int EXPAND_EAR_FILES = 1 << 2;
- public static final int EXPAND_EJBJAR_FILES = 1 << 3;
- public static final int EXPAND_APPCLIENT_FILES = 1 << 4;
- public static final int EXPAND_ARCHIVES = 1 << 5;
- public static final int EXPAND_RAR_FILES = 1 << 6;
- public static final int EXPAND_ALL = (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6);
-
- public Archive addCopy(Archive anArchive) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- public File addCopy(File aFile) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- /**
- * Get a flattened list from the directory, then addCopy the list
- *
- * @throws com.ibm.etools.archive.exception.DuplicateObjectException
- * if a file with a uri that equals one of the nested files in the directory exists
- *
- * @return java.util.List the copied files that were added to the archive
- */
- public List addCopy(ReadOnlyDirectory dir) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- public List addCopyFiles(List listOfFiles) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- public void addOrReplaceMofResource(Resource aResource);
-
- /**
- * @deprecated Use {@link #getDependentOpenArchives()}
- *
- * If any opened archive contains files that have this archive as its loading container, return
- * false; otherwise return true. This method supports the following scenario: open jar A. create
- * jar B. Copy files from A to B. Attempt to close jar A before saving jar B. Then attempt to
- * save B, and the save fails because A is closed. This method allows client code to test for
- * dependent open archives before saving the source archive. If this method returns false, the
- * solution is to either close or save B before closing A.
- */
- public boolean canClose();
-
- /**
- * Closes the load strategy for this archive and closes all contained archives; WARNING: If
- * files have been copied from this archive to another archive, then the destination archive
- * should be saved or closed before this archive can be safely closed; to test if this archive
- * can safely close invoke {@link #canClose()}
- */
- public void close();
-
- /**
- * Save this archive as an expanded directory where the flags is the result of bitwise or of the
- * specified types to be expanded; example:
- * <code>anEarFile.saveAsDirectory(anEarFile.EXPAND_WAR_FILES | anEarFile.EXPAND_EJBJARFILES)</code>;
- *
- * If this archive was loaded from the same uri as it is being extracted to, the orignal will be
- * deleted and replaced with the directory
- *
- * @throws SaveFailureException
- * if an exception occurs while saving
- *
- * @throws ReopenException
- * if an exception occurs while re-syncing the archive to the newly saved
- * destination
- */
- public void extract(int expansionFlags) throws SaveFailureException, ReopenException;
-
- /**
- * For performance, save the archive without reopening; Further operations on this instance
- * without first calling {@link #reopen}will yield unexpected results.
- *
- * @see #extract(int)
- */
- public void extractNoReopen(int expansionFlags) throws SaveFailureException;
-
- /**
- * Save this archive as a directory using the specified uri
- *
- * The archive will not be renamed
- *
- * @throws SaveFailureException
- * if an exception occurs while saving
- *
- * @see #extract(int)
- */
- public void extractTo(String uri, int expansionFlags) throws SaveFailureException;
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.ClassLoader
- */
- public java.lang.ClassLoader getArchiveClassLoader();
-
- /**
- * Return a list of files in the ARchive that start with the prefix
- */
- public java.util.List filterFilesByPrefix(String prefix);
-
- /**
- * Return a list of files in the Archive excluding any file that starts with one of the prefixes
- */
- public java.util.List filterFilesWithoutPrefix(String[] prefixes);
-
- /**
- * Returns a filtered list of archive files; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getArchiveFiles();
-
- public ResourceSet getResourceSet();
-
- /**
- * Return a list of all root level (non-nested) opened archives containing files that have this
- * archive as its loading container; the set will be empty if no such opened archive exists.
- * This method supports the following scenario: open jar A. create jar B. Copy files from A to
- * B. Attempt to close jar A before saving jar B. Then attempt to save B, and the save fails
- * because A is closed. This method allows client code to test for dependent open archives
- * before saving the source archive. If the return value is not empty, the solution is to either
- * close or save B before closing A.
- */
- public Set getDependentOpenArchives();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.String
- */
- public java.lang.String getExtraClasspath();
-
- /**
- * Used internally by the framework, specifically as an optimization when saving/exploding
- * archives with nested archives
- */
- public FileIterator getFilesForSave() throws IOException;
-
- public Collection getLoadedMofResources();
-
- public ArchiveManifest getManifest();
-
- public Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException;
-
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions getOptions();
-
- /**
- * @see LoadStrategy#getResourceInputStream(String)
- */
- public InputStream getResourceInputStream(String uri) throws IOException;
-
- /**
- * Used for websphere runtime where archives are on disk (not nested in jars)
- *
- * @return list of absolute paths that represents this archive only, and in the case of
- * WARFiles, the nested loadable contents.
- */
- public RuntimeClasspathEntry[] getLocalRuntimeClassPath();
-
- /**
- * Used for websphere runtime where archives are on disk (not nested in jars) to get the
- * recursive behavior, the Archive must belong to an EAR file
- *
- * @return list of absolute paths that represents this archive, all it's prereqs, recursive.
- */
- public RuntimeClasspathEntry[] getFullRuntimeClassPath();
-
- /**
- * Used for websphere runtime where archives are on disk (not nested in jars) to get the
- * recursive behavior, the Archive must belong to an EAR file
- *
- * @return list of absolute paths that represents the dependencies of this Archive, all it's
- * prereqs, recursive.
- */
- public RuntimeClasspathEntry[] getDependencyClassPath();
-
- /**
- * Return the absolute path of the root from which meta resources get loaded
- */
- public String getResourcesPath() throws FileNotFoundException;
-
- /**
- * Return the absolute path of the root from which classes and properties are loaded
- */
- public String getBinariesPath() throws FileNotFoundException;
-
- /**
- * Optional filter for saving a subset of files; filter will be applied for all save and extract
- * invokations
- */
- public SaveFilter getSaveFilter();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.SaveStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy getSaveStrategy();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.String
- */
- public java.lang.String getXmlEncoding();
-
- /**
- * Return whether this Archive has
- *
- * @other on it's classpath, either directly or transitively
- * @param Archive
- * other - another archive in the same EAR file
- */
- public boolean hasClasspathVisibilityTo(Archive other);
-
- /**
- * Internal API; Used for implementation of {@link #hasClasspathVisibilityTo(Archive)}
- *
- * @param Archive
- * other - another archive in the same EAR file
- * @param Set
- * visited - the set of archives already visited
- */
- public boolean hasClasspathVisibilityTo(Archive other, Set visited, EARFile ear);
-
- /**
- * Perform any necessary initialization after the archive has been opened.
- */
- public void initializeAfterOpen();
-
- /**
- * Used internally by the load strategy
- */
- public void initializeClassLoader();
-
- /**
- * An item is considered a duplicate if the archive contains a file or loaded mof resource with
- * the uri, or if the uri is equal to the manifest uri
- */
- public boolean isDuplicate(String uri);
-
- /**
- * Used as an optimization at copy time
- */
- public boolean isManifestSet();
-
- public boolean isMofResourceLoaded(String uri);
-
- /**
- * Used internally for dispatch between the archive and the load strategy when building the file
- * list; clients should not need to call this method.
- */
- public boolean isNestedArchive(String uri);
-
- /**
- * Indicates whether the archive is still opened for read; if not, IOExceptions could be thrown
- * on attempts to get input streams on file entries. reopen() will cause this archive and its
- * nested archives to rebuild their load strategies
- */
- public boolean isOpen();
-
- /**
- * Create a new mof resource and add it to the resource set of the context of this archive; all
- * resources in memory are saved when the archive is saved
- *
- * @throws DuplicateObjectException
- * if a resource already exists in this archive having the uri
- */
- public Resource makeMofResource(String uri) throws DuplicateObjectException;
-
- /**
- * Create a new mof resource and add it to the resource set of the context of this archive; all
- * resources in memory are saved when the archive is saved
- *
- * @throws DuplicateObjectException
- * if a resource already exists in this archive having the uri
- */
- public Resource makeMofResource(String uri, EList extent) throws DuplicateObjectException;
-
- /**
- * Used internally for dispatch between the archive and the load strategy when building the file
- * list; clients should not need to call this method.
- */
- public Archive openNestedArchive(String uri) throws OpenFailureException;
-
- /**
- * Used internally for dispatch between the archive and the load strategy when building the file
- * list; clients should not need to call this method.
- */
- public Archive openNestedArchive(LooseArchive loose) throws OpenFailureException;
-
- /**
- * Set the value of the extra class path with no refresh of the class loader
- */
- public void primSetExtraClasspath(java.lang.String newExtraClasspath);
-
- public void remove(File aFile);
-
- /**
- * Used internally for "re-syncing" an archive after save; clients normally should not need this
- * method
- */
- public void reopen() throws ReopenException;
-
- /**
- * Used internally for reopening nested archives; clients normally should not need this method
- */
- public void reopen(Archive parent) throws ReopenException;
-
- /**
- * Save this archive as a jar file with the uri of the archive;
- *
- * @throws SaveFailureException
- * if an exception occurs while saving
- *
- * @throws ReopenException
- * if an exception occurs while re-syncing the archive to the newly saved
- * destination
- */
- public void save() throws SaveFailureException, ReopenException;
-
- /**
- * Save this archive using the save strategy specified
- *
- * @throws SaveFailureException
- * if an exception occurs while saving
- */
- public void save(SaveStrategy aStrategy) throws SaveFailureException;
-
- /**
- * Save this archive as a jar file using uri provided; If the uri is different than the URI of
- * this archive, the uri of this archive will change to the new uri (for reopen)
- *
- * @throws SaveFailureException
- * if an exception occurs while saving
- *
- * @throws ReopenException
- * if an exception occurs while re-syncing the archive to the newly saved
- * destination
- */
- public void saveAs(String uri) throws SaveFailureException, ReopenException;
-
- /**
- * For performance, save the archive without reopening; Further operations on this instance
- * without first calling {@link #reopen}will yield unexpected results.
- *
- * @see #saveAs(String)
- */
- public void saveAsNoReopen(String uri) throws SaveFailureException;
-
- /**
- * For performance, save the archive without reopening; Further operations on this instance
- * without first calling {@link #reopen}will yield unexpected results.
- *
- * @see #save()
- */
- public void saveNoReopen() throws SaveFailureException;
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newArchiveClassLoader
- * java.lang.ClassLoader
- */
- public void setArchiveClassLoader(java.lang.ClassLoader newArchiveClassLoader);
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newExtraClasspath
- * java.lang.String
- */
- public void setExtraClasspath(java.lang.String newExtraClasspath);
-
- public void setManifest(ArchiveManifest newManifest);
-
- public void setManifest(java.util.jar.Manifest aManifest);
-
- /**
- * Sets the Class-path manifest entry, rebuilds the class loader, and refreshes any reflected
- * java classes
- */
- public void setManifestClassPathAndRefresh(String classpath);
-
- public void setOptions(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions newOptions);
-
- /**
- * Optional filter for saving a subset of files; filter will be applied for all save and extract
- * invokations
- */
- public void setSaveFilter(SaveFilter aFilter);
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newSaveStrategy
- * com.ibm.etools.archive.SaveStrategy
- */
- public void setSaveStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy newSaveStrategy);
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newXmlEncoding
- * java.lang.String
- */
- public void setXmlEncoding(java.lang.String newXmlEncoding);
-
- /**
- * Determine whether java reflection should be set up for this archive
- */
- public boolean shouldUseJavaReflection();
-
- /**
- * Returns the value of the '<em><b>Types</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Types</em>' attribute list isn't clear, there really should be
- * more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Types</em>' attribute list.
- * @see org.eclipse.jst.j2ee.commonarchivecore.CommonarchivePackage#getArchive_Types()
- * @model type="java.lang.String"
- * @generated
- */
- EList getTypes();
-
- boolean isType(String type);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ArchiveTypeDiscriminatorRegistry.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ArchiveTypeDiscriminatorRegistry.java
deleted file mode 100644
index d0a763084..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ArchiveTypeDiscriminatorRegistry.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-
-
-/**
- * @author mdelder
- */
-public class ArchiveTypeDiscriminatorRegistry {
-
- private Collection discriminators = null;
- private Collection customTypes = null;
-
- /*
- * Most known types are of length 3. Whenver a new type is added that is not of length 3,
- * modifications may be necessary to the 'isKnownArchiveType() method
- */
- private static final String[] defaultKnownTypes = new String[]{"ear", "war", "jar", "zip", "far"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
-
- public static final ArchiveTypeDiscriminatorRegistry INSTANCE = new ArchiveTypeDiscriminatorRegistry();
-
- public static void registorDiscriminator(GenericArchiveTypeDiscriminator discriminator) {
- INSTANCE.getDiscriminators().add(discriminator);
- INSTANCE.addKnownArchiveTypes(discriminator.getCustomFileExtensions());
- }
-
- public static ArchiveTypeDiscriminatorRegistry getInstance() {
- return INSTANCE;
- }
-
- /**
- * @return
- */
- public Collection getDiscriminators() {
- if (discriminators == null)
- discriminators = new ArrayList();
- return discriminators;
- }
-
- public void contributeTypes(Archive archive) {
- if (discriminators == null)
- return;
- GenericArchiveTypeDiscriminator discriminator = null;
- for (Iterator itr = discriminators.iterator(); itr.hasNext();) {
- discriminator = (GenericArchiveTypeDiscriminator) itr.next();
- if (discriminator.discriminate(archive))
- archive.getTypes().add(discriminator.getTypeKey());
- }
- }
-
- public void addKnownArchiveTypes(String[] newTypes) {
- if (customTypes == null) {
- customTypes = new ArrayList();
- }
- for (int i = 0; i < newTypes.length; i++) {
- customTypes.add(newTypes[i]);
- }
- }
-
- public boolean isKnownArchiveType(String fileURI) {
- if (fileURI == null || fileURI.length() == 0)
- return false;
-
- String lowerCaseUri = fileURI.toLowerCase();
- /*
- * Ensure that the length of the URI is long enough to contain a .3 style extension
- */
- if (lowerCaseUri.length() > 4 && lowerCaseUri.charAt(lowerCaseUri.length() - 4) == '.') {
- String ending = lowerCaseUri.substring(lowerCaseUri.length() - 3);
- for (int i = 0; i < defaultKnownTypes.length; i++)
- if (defaultKnownTypes[i].equals(ending))
- return true;
- }
-
- String customType = null;
- if (customTypes != null) {
- Iterator customTypesIterator = customTypes.iterator();
- while (customTypesIterator.hasNext()) {
- customType = (String) customTypesIterator.next();
- if (fileURI.endsWith(customType))
- return true;
- }
- }
-
- return false;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ClientModuleRef.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ClientModuleRef.java
deleted file mode 100644
index 34f715246..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ClientModuleRef.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-
-/**
- * @generated
- */
-public interface ClientModuleRef extends ModuleRef {
- ApplicationClient getApplicationClient() throws ArchiveWrappedException;
-} //ClientModuleRef
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveFactoryRegistry.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveFactoryRegistry.java
deleted file mode 100644
index 153081021..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveFactoryRegistry.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Aug 7, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl;
-
-
-/**
- * @author jlanuti
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class CommonArchiveFactoryRegistry {
-
- public static CommonArchiveFactoryRegistry INSTANCE = new CommonArchiveFactoryRegistry();
-
- protected CommonarchiveFactory commonArchiveFactory = ((CommonarchiveFactoryImpl) CommonarchivePackage.eINSTANCE.getCommonarchiveFactory()).getDelegate();
-
- /**
- * Constructor
- */
- public CommonArchiveFactoryRegistry() {
- super();
- }
-
- public CommonarchiveFactory getCommonArchiveFactory() {
- return commonArchiveFactory;
- }
-
- public void setCommonArchiveFactory(CommonarchiveFactory factory) {
- commonArchiveFactory = factory;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveResourceHandler.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveResourceHandler.java
deleted file mode 100644
index 6ff299808..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveResourceHandler.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-import org.eclipse.osgi.util.NLS;
-
-public class CommonArchiveResourceHandler extends NLS {
- private static final String BUNDLE_NAME = "commonarchive";//$NON-NLS-1$
-
- private CommonArchiveResourceHandler() {
- // Do not instantiate
- }
-
- public static String not_a_dir_EXC_;
- public static String FileImpl__Error_0;
- public static String RepairArchiveCommand_usage1_ERROR_;
- public static String file_exist_as_dir_EXC_;
- public static String duplicate_entry_EXC_;
- public static String ser_not_dd_EXC_;
- public static String EAR_File;
- public static String RAR_File;
- public static String filename_exception_EXC_;
- public static String An_Application_Client_JAR_file;
- public static String no_sec_role_EXC_;
- public static String Original_archive_is_not_a__EXC_;
- public static String duplicate_module_EXC_;
- public static String reading_dd_EXC_;
- public static String Module_file_does_not_exist_2;
- public static String A_WAR_file;
- public static String IOException_occurred_while_EXC_;
- public static String io_ex_manifest_EXC_;
- public static String FixPrimKeyCommand_usage__s_EXC_;
- public static String FixPrimKeyCommand_usage___;
- public static String Parameter_should_not_be_nu_EXC_;
- public static String dd_in_ear_load_EXC_;
- public static String no_dds_10_EXC_;
- public static String list_components_war_EXC_;
- public static String An_EJB_JAR_file;
- public static String open_nested_EXC_;
- public static String Repair_command_failed___ex_EXC_;
- public static String nested_open_fail_EXC_;
- public static String Error_iterating_the_archiv_EXC_;
- public static String make_temp_file_WARN_;
- public static String missing_class_EXC_;
- public static String repair_usage_ERROR_;
- public static String Application_Client_Jar_Fil;
- public static String WAR_File;
- public static String could_not_find_dir_EXC_;
- public static String Converted;
- public static String Absolute_path_unknown_EXC_;
- public static String add_copy_lib_dir_EXC_;
- public static String removing_key_field_INFO_;
- public static String Module_file;
- public static String Stack_trace_of_nested_exce_EXC_;
- public static String tx_bean_mgd_WARN_;
- public static String manifest_dd_load_EXC_;
- public static String key_class_reflection_ERROR_;
- public static String uncontained_module_EXC_;
- public static String file_not_found_EXC_;
- public static String io_ex_reading_dd_EXC_;
- public static String invalid_cp_file_WARN_;
- public static String invalid_archive_EXC_;
- public static String load_resource_EXC_;
- public static String invalid_classpath_WARN_;
- public static String Extract_destination_is_the_EXC_;
- public static String subclass_responsibilty_EXC_;
- public static String Module_not_in_EAR;
- public static String File_not_correct_type;
- public static String io_ex_loading_EXC_;
- public static String could_not_open_EXC_;
- public static String manifest_dd_find_EXC_;
- public static String nested_jar_EXC_;
- public static String dup_resource_EXC_;
- public static String Repairs_all_entries_in_the;
- public static String add_copy_class_dir_EXC_;
- public static String io_ex_reopen_EXC_;
- public static String Error_occurred_iterating_f_EXC_;
- public static String dup_sec_role_module_EXC_;
- public static String duplicate_file_EXC_;
- public static String inferred_dds_EXC_;
- public static String unable_replace_EXC_;
- public static String EJB_Jar_File;
- public static String A_file_does_not_exist_for_module;
- public static String A_RAR_file;
- public static String dup_sec_role_EXC_;
- public static String _The_following_files_could_EXC_;
- public static String key_field_reflection_ERROR_;
- public static String End_of_list_reached_EXC_;
- public static String error_saving_EXC_;
- public static String Archive_is_not_a_valid_EJB_EXC_;
- public static String make_temp_dir_EXC_;
- public static String RepairArchiveCommand_usage;
- public static String FixPrimKeyCommand_failed___EXC_;
- public static String A_Application_file;
- public static String Null_uri_EXC_;
- public static String Internal_Error__Iterator_o_EXC_;
- public static String AbstractArchiveSaveAdapter_Saving_resource_;
- public static String ArchiveFactoryImpl_Saving_archive_to_0_;
- public static String ArchiveFactoryImpl_Error_saving_archive_0_to_output_;
- public static String ArchiveFactoryImpl_The_specified_file_0_exists_and_;
- public static String ArchiveFactoryImpl_Saving_archiv_;
- public static String ArchiveFactoryImpl_Error_saving_archive_0_;
- public static String ArchiveImpl_0_in_1_;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, CommonArchiveResourceHandler.class);
- }
-
- public static String getString(String key, Object[] args) {
- return NLS.bind(key, args);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchiveFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchiveFactory.java
deleted file mode 100644
index d545402f9..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchiveFactory.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-
-
-/**
- * @generated
- */
-public interface CommonarchiveFactory extends EFactory {
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- CommonarchiveFactory eINSTANCE = org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.init();
-
- /**
- * Tell the factory that an archive has been opened; the factory maintains a weak set of all the
- * open archives to determine if another archive can be closed.
- */
- public void archiveClosed(Archive aClosedArchive);
-
- /**
- * Tell the factory that an archive has been opened; the factory maintains a weak set of all the
- * open archives to determine if another archive can be closed.
- */
- public void archiveOpened(Archive anOpenArchive);
-
- /**
- * @deprecated Use {@link #getOpenArchivesDependingOn(Archive)}
- *
- * If any opened archive contains files that have the parameter as its loading container, return
- * false; otherwise return true. This method supports the following scenario: open jar A. create
- * jar B. Copy files from A to B. Attempt to close jar A before saving jar B. Then attempt to
- * save B, and the save fails because A is closed. This method allows client code to test for
- * dependent open archives before saving the source archive. If this method returns false, the
- * solution is to either close or save B before closing A.
- */
- public boolean canClose(Archive anArchive);
-
- /**
- * Close any open archives and delete the temp files associated with nested archives. Due to
- * limitations in the deleteOnExit() method of file, in 1.2.2 there is no way to ensure these
- * files get deleted. Client code should use good practice by calling {@link Archive#close}when
- * finished with an Archive instance, rather than just discard an instance with open file
- * handles and wait for it to be gc'd. Beyond that, program code compiled for 1.3 can (and
- * should) implement the following shutdown hook: <code>
- * Runtime.getRuntime().addShutdownHook(new Thread() {
- public void run() {
- ((CommonarchivePackage)EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory().closeOpenArchives();
- }
- });</code>
- */
- public void closeOpenArchives();
-
- public Archive copy(Archive anArchive);
-
- public ModuleFile copy(ModuleFile aModuleFile);
-
- /**
- * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
- * descriptor)
- */
- public ApplicationClientFile createApplicationClientFileInitialized(String uri);
-
- /**
- * Creates a new archive for editing, and initializes it appropriately
- */
- public Archive createArchiveInitialized(String uri);
-
- /**
- * Used internally; clients usually should not need this method
- */
- public LoadStrategy createChildLoadStrategy(String uri, LoadStrategy parent) throws java.io.IOException, java.io.FileNotFoundException;
-
- /**
- * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
- * descriptor)
- */
- public EARFile createEARFileInitialized(String uri);
-
- /**
- * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
- * descriptor)
- */
- public EJBJarFile createEJBJarFileInitialized(String uri);
-
- /**
- * Create an initialized archive based on the given URI and options
- */
- public Archive createArchiveInitialized(ArchiveOptions options, java.lang.String uri);
-
- /**
- * Create an initialized EAR based on the given URI and options
- */
- public EARFile createEARFileInitialized(ArchiveOptions options, java.lang.String uri);
-
- /**
- * Create an initialized EJB based on the given URI and options
- */
- public EJBJarFile createEJBJarFileInitialized(ArchiveOptions options, java.lang.String uri);
-
- /**
- * Initialize archive based on the options
- */
- public void initializeNewApplicationClientFile(ApplicationClientFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialize archive based on the options
- */
- public void initializeNewArchive(Archive anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialize archive based on the options
- */
- public void initializeNewEARFile(EARFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialized archive based on the options
- */
- public void initializeNewEJBJarFile(EJBJarFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialized archive based on the options
- */
- public void initializeNewModuleFile(ModuleFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialized archive based on the options
- */
- public void initializeNewRARFile(RARFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Initialized archive based on the options
- */
- public void initializeNewWARFile(WARFile anArchive, String uri, ArchiveOptions options);
-
- /**
- * Returns a NullLoadStrategyImpl; used for new archives
- */
- LoadStrategy createEmptyLoadStrategy();
-
- /**
- * Helper method to dynamically build a load strategy from the file system. Determines whether
- * the uri points to a jar file or directory and returns the appropriate strategy
- */
- public LoadStrategy createLoadStrategy(String uri) throws FileNotFoundException, IOException;
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile createRARFileInitialized(java.lang.String uri);
-
- /**
- * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
- * descriptor)
- */
- public WARFile createWARFileInitialized(String uri);
-
- /**
- * Helper method to introspect an archive and get it's class path entries before fully opening
- * the archive; needed because we may need extra classpath info to be able to open the 1.0 file
- * and deserialize its deployment descriptor
- *
- * @return a tokenized array of class path components
- */
- public String[] getManifestClassPathValues(String uri) throws OpenFailureException;
-
- /**
- * Return a list of all root level (non-nested) opened archives containing files that have the
- * parameter as its loading container; the set will be empty if no such opened archive exists.
- * This method supports the following scenario: open jar A. create jar B. Copy files from A to
- * B. Attempt to close jar A before saving jar B. Then attempt to save B, and the save fails
- * because A is closed. This method allows client code to test for dependent open archives
- * before saving the source archive. If the return value is not empty, the solution is to either
- * close or save B before closing A.
- */
- public Set getOpenArchivesDependingOn(Archive anArchive);
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public ApplicationClientFile openApplicationClientFile(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public ApplicationClientFile openApplicationClientFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- public ApplicationClientFile openApplicationClientFile(String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive openArchive(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive openArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- /**
- * open the archive by the passed uri
- *
- * @return the appropriate kind of archive
- */
- public Archive openArchive(String uri) throws OpenFailureException;
-
- /**
- * open the archive by the passed uri, and use the extraClassPath for java reflection, in
- * addition to the manifest class-path; mostly used for ejb 1.0 jar files to be converted
- *
- * @return the appropriate kind of archive
- */
- public Archive openArchive(String uri, String extraClassPath) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EARFile openEARFile(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EARFile openEARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- public EARFile openEARFile(String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJB11JarFile(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJB11JarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJB11JarFile(String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJBJarFile(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri, String extraClassPath) throws OpenFailureException;
-
- public EJBJarFile openEJBJarFile(String uri) throws OpenFailureException;
-
- public EJBJarFile openEJBJarFile(String uri, String extraClassPath) throws OpenFailureException;
-
- /**
- * Used internally for openning an Archive in an Archive
- */
- public Archive openNestedArchive(String uri, Archive parent) throws OpenFailureException;
-
- /**
- * Used internally for openning an Archive in an Archive
- */
- public Archive openNestedArchive(LooseArchive loose, Archive parent) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public RARFile openRARFile(ArchiveOptions options, java.lang.String uri) throws OpenFailureException;
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile openRARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile openRARFile(String uri) throws OpenFailureException;
-
- public ReadOnlyDirectory openReadOnlyDirectory(String uri) throws java.io.IOException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public WARFile openWARFile(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public WARFile openWARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- public WARFile openWARFile(String uri) throws OpenFailureException;
-
- /**
- * Open the archive by the passed parameter, without attempting to determine what kind of
- * archive it is
- *
- * @return an instance of Archive, but not a subclass
- */
- Archive primOpenArchive(String uri) throws OpenFailureException;
-
- Archive primOpenArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;
-
- Archive primOpenArchive(ArchiveOptions options, String uri) throws OpenFailureException;
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return WARFile value
- */
- WARFile createWARFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EJBJarFile value
- */
- EJBJarFile createEJBJarFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ApplicationClientFile value
- */
- ApplicationClientFile createApplicationClientFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EARFile value
- */
- EARFile createEARFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return RARFile value
- */
- RARFile createRARFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return Archive value
- */
- Archive createArchive();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return File value
- */
- File createFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ReadOnlyDirectory value
- */
- ReadOnlyDirectory createReadOnlyDirectory();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- CommonarchivePackage getCommonarchivePackage();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EJBModuleRef value
- */
- EJBModuleRef createEJBModuleRef();
-
- /**
- * Convienince method for wrapping a standalone EJB JAR file
- */
- EJBModuleRef createEJBModuleRef(EJBJarFile ejbJarFile);
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return WebModuleRef value
- */
- WebModuleRef createWebModuleRef();
-
- /**
- * Convienince method for wrapping a standalone WAR file
- */
- WebModuleRef createWebModuleRef(WARFile warFile);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ClientModuleRef value
- */
- ClientModuleRef createClientModuleRef();
-
- /**
- * Convienince method for wrapping a standalone Application Client JAR file
- */
- ClientModuleRef createClientModuleRef(ApplicationClientFile clientFile);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ConnectorModuleRef value
- */
- ConnectorModuleRef createConnectorModuleRef();
-
- /**
- * Convienince method for wrapping a standalone RAR file
- */
- ConnectorModuleRef createConnectorModuleRef(RARFile rarFile);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchivePackage.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchivePackage.java
deleted file mode 100644
index f9b861813..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchivePackage.java
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.jst.j2ee.common.CommonPackage;
-
-/**
- * @lastgen interface CommonarchivePackage extends EPackage {}
- */
-public interface CommonarchivePackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "commonarchivecore"; //$NON-NLS-1$
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER = 7;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE = 3;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE = 6;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE = 4;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_REF = 10;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_MODULE_REF = 11;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WEB_MODULE_REF = 12;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CLIENT_MODULE_REF = 13;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONNECTOR_MODULE_REF = 14;
- /**
- * @generated This field/method will be replaced during code generation.
- */
-
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE = 5;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE = 2;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE = 9;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE = 1;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE = 0;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__URI = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 0;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__LAST_MODIFIED = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 1;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__SIZE = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int FILE__DIRECTORY_ENTRY = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 3;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__ORIGINAL_URI = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 4;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__LOADING_CONTAINER = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 5;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int FILE__CONTAINER = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the '<em>File</em>' class.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int FILE_FEATURE_COUNT = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 7;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__URI = FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__LAST_MODIFIED = FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__SIZE = FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONTAINER__DIRECTORY_ENTRY = FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__ORIGINAL_URI = FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__LOADING_CONTAINER = FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__CONTAINER = FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONTAINER__FILES = FILE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the the '<em>Container</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int CONTAINER_FEATURE_COUNT = FILE_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__URI = CONTAINER__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__LAST_MODIFIED = CONTAINER__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__SIZE = CONTAINER__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE__DIRECTORY_ENTRY = CONTAINER__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__ORIGINAL_URI = CONTAINER__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__LOADING_CONTAINER = CONTAINER__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__CONTAINER = CONTAINER__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int ARCHIVE__FILES = CONTAINER__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ARCHIVE__TYPES = CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>Archive</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ARCHIVE_FEATURE_COUNT = CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__URI = ARCHIVE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__LAST_MODIFIED = ARCHIVE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__SIZE = ARCHIVE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODULE_FILE__DIRECTORY_ENTRY = ARCHIVE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__ORIGINAL_URI = ARCHIVE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__LOADING_CONTAINER = ARCHIVE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__CONTAINER = ARCHIVE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_FILE__FILES = ARCHIVE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODULE_FILE__TYPES = ARCHIVE__TYPES;
-
- /**
- * The number of structural features of the the '<em>Module File</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int MODULE_FILE_FEATURE_COUNT = ARCHIVE_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__URI = MODULE_FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__LAST_MODIFIED = MODULE_FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__SIZE = MODULE_FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EJB_JAR_FILE__DIRECTORY_ENTRY = MODULE_FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__ORIGINAL_URI = MODULE_FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__LOADING_CONTAINER = MODULE_FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__CONTAINER = MODULE_FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__FILES = MODULE_FILE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EJB_JAR_FILE__TYPES = MODULE_FILE__TYPES;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR = MODULE_FILE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the the '<em>EJB Jar File</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int EJB_JAR_FILE_FEATURE_COUNT = MODULE_FILE_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__URI = MODULE_FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__LAST_MODIFIED = MODULE_FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__SIZE = MODULE_FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int WAR_FILE__DIRECTORY_ENTRY = MODULE_FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__ORIGINAL_URI = MODULE_FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__LOADING_CONTAINER = MODULE_FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__CONTAINER = MODULE_FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__FILES = MODULE_FILE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int WAR_FILE__TYPES = MODULE_FILE__TYPES;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WAR_FILE__DEPLOYMENT_DESCRIPTOR = MODULE_FILE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the the '<em>WAR File</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int WAR_FILE_FEATURE_COUNT = MODULE_FILE_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__URI = MODULE_FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__LAST_MODIFIED = MODULE_FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__SIZE = MODULE_FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EAR_FILE__DIRECTORY_ENTRY = MODULE_FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__ORIGINAL_URI = MODULE_FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__LOADING_CONTAINER = MODULE_FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__CONTAINER = MODULE_FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__FILES = MODULE_FILE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EAR_FILE__TYPES = MODULE_FILE__TYPES;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__MODULE_REFS = MODULE_FILE_FEATURE_COUNT + 0;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EAR_FILE__DEPLOYMENT_DESCRIPTOR = MODULE_FILE_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the the '<em>EAR File</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int EAR_FILE_FEATURE_COUNT = MODULE_FILE_FEATURE_COUNT + 2;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__URI = MODULE_FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__LAST_MODIFIED = MODULE_FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__SIZE = MODULE_FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int APPLICATION_CLIENT_FILE__DIRECTORY_ENTRY = MODULE_FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__ORIGINAL_URI = MODULE_FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__LOADING_CONTAINER = MODULE_FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__CONTAINER = MODULE_FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__FILES = MODULE_FILE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int APPLICATION_CLIENT_FILE__TYPES = MODULE_FILE__TYPES;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR = MODULE_FILE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Application Client File</em>' class.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int APPLICATION_CLIENT_FILE_FEATURE_COUNT = MODULE_FILE_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY = 8;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__URI = CONTAINER__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__LAST_MODIFIED = CONTAINER__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__SIZE = CONTAINER__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int READ_ONLY_DIRECTORY__DIRECTORY_ENTRY = CONTAINER__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__ORIGINAL_URI = CONTAINER__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__LOADING_CONTAINER = CONTAINER__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__CONTAINER = CONTAINER__CONTAINER;
-
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int READ_ONLY_DIRECTORY__FILES = CONTAINER__FILES;
- /**
- * The number of structural features of the the '<em>Read Only Directory</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int READ_ONLY_DIRECTORY_FEATURE_COUNT = CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__URI = MODULE_FILE__URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__LAST_MODIFIED = MODULE_FILE__LAST_MODIFIED;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__SIZE = MODULE_FILE__SIZE;
- /**
- * The feature id for the '<em><b>Directory Entry</b></em>' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int RAR_FILE__DIRECTORY_ENTRY = MODULE_FILE__DIRECTORY_ENTRY;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__ORIGINAL_URI = MODULE_FILE__ORIGINAL_URI;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__LOADING_CONTAINER = MODULE_FILE__LOADING_CONTAINER;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__CONTAINER = MODULE_FILE__CONTAINER;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int RAR_FILE__FILES = MODULE_FILE__FILES;
- /**
- * The feature id for the '<em><b>Types</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int RAR_FILE__TYPES = MODULE_FILE__TYPES;
-
- /**
- * The feature id for the '<em><b>Deployment Descriptor</b></em>' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int RAR_FILE__DEPLOYMENT_DESCRIPTOR = MODULE_FILE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the the '<em>RAR File</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int RAR_FILE_FEATURE_COUNT = MODULE_FILE_FEATURE_COUNT + 1;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_REF__MODULE_FILE = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 0;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int MODULE_REF__EAR_FILE = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODULE_REF__MODULE = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the the '<em>Module Ref</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int MODULE_REF_FEATURE_COUNT = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 3;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_MODULE_REF__MODULE_FILE = MODULE_REF__MODULE_FILE;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int EJB_MODULE_REF__EAR_FILE = MODULE_REF__EAR_FILE;
-
- /**
- * The feature id for the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int EJB_MODULE_REF__MODULE = MODULE_REF__MODULE;
-
- /**
- * The number of structural features of the the '<em>EJB Module Ref</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int EJB_MODULE_REF_FEATURE_COUNT = MODULE_REF_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WEB_MODULE_REF__MODULE_FILE = MODULE_REF__MODULE_FILE;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int WEB_MODULE_REF__EAR_FILE = MODULE_REF__EAR_FILE;
-
- /**
- * The feature id for the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int WEB_MODULE_REF__MODULE = MODULE_REF__MODULE;
-
- /**
- * The number of structural features of the the '<em>Web Module Ref</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int WEB_MODULE_REF_FEATURE_COUNT = MODULE_REF_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CLIENT_MODULE_REF__MODULE_FILE = MODULE_REF__MODULE_FILE;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CLIENT_MODULE_REF__EAR_FILE = MODULE_REF__EAR_FILE;
-
- /**
- * The feature id for the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CLIENT_MODULE_REF__MODULE = MODULE_REF__MODULE;
-
- /**
- * The number of structural features of the the '<em>Client Module Ref</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int CLIENT_MODULE_REF_FEATURE_COUNT = MODULE_REF_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONNECTOR_MODULE_REF__MODULE_FILE = MODULE_REF__MODULE_FILE;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- int CONNECTOR_MODULE_REF__EAR_FILE = MODULE_REF__EAR_FILE;
-
- /**
- * The feature id for the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int CONNECTOR_MODULE_REF__MODULE = MODULE_REF__MODULE;
-
- /**
- * The number of structural features of the the '<em>Connector Module Ref</em>' class. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int CONNECTOR_MODULE_REF_FEATURE_COUNT = MODULE_REF_FEATURE_COUNT + 0;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- String eNS_URI = "commonarchive.xmi"; //$NON-NLS-1$
- /**
- * The package namespace name.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "org.eclipse.jst.j2ee.commonarchivecore"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- CommonarchivePackage eINSTANCE = org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl.init();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return Container object
- */
- EClass getContainer();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getContainer_Files();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return WARFile object
- */
- EClass getWARFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getWARFile_DeploymentDescriptor();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ModuleFile object
- */
- EClass getModuleFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EARFile object
- */
- EClass getEARFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getEARFile_DeploymentDescriptor();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getEARFile_ModuleRefs();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ModuleRef object
- */
- EClass getModuleRef();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getModuleRef_ModuleFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getModuleRef_EarFile();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef#getModule <em>Module</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Module</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef#getModule()
- * @see #getModuleRef()
- * @generated
- */
- EReference getModuleRef_Module();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EJBModuleRef object
- */
- EClass getEJBModuleRef();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return WebModuleRef object
- */
- EClass getWebModuleRef();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ClientModuleRef object
- */
- EClass getClientModuleRef();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ConnectorModuleRef object
- */
- EClass getConnectorModuleRef();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ApplicationClientFile object
- */
- EClass getApplicationClientFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getApplicationClientFile_DeploymentDescriptor();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return EJBJarFile object
- */
- EClass getEJBJarFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getEJBJarFile_DeploymentDescriptor();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return RARFile object
- */
- EClass getRARFile();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile#getDeploymentDescriptor <em>Deployment Descriptor</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Deployment Descriptor</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile#getDeploymentDescriptor()
- * @see #getRARFile()
- * @generated
- */
- EReference getRARFile_DeploymentDescriptor();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return Archive object
- */
- EClass getArchive();
-
- /**
- * Returns the meta object for the attribute list '
- * {@link org.eclipse.jst.j2ee.internal.commonarchivecore.Archive#getTypes <em>Types</em>}'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute list '<em>Types</em>'.
- * @see org.eclipse.jst.j2ee.internal.commonarchivecore.Archive#getTypes()
- * @see #getArchive()
- * @generated
- */
- EAttribute getArchive_Types();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return File object
- */
- EClass getFile();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EAttribute getFile_URI();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EAttribute getFile_LastModified();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EAttribute getFile_Size();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#isDirectoryEntry <em>Directory Entry</em>}'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Directory Entry</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.File#isDirectoryEntry()
- * @see #getFile()
- * @generated
- */
- EAttribute getFile_DirectoryEntry();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EAttribute getFile_OriginalURI();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getFile_LoadingContainer();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- EReference getFile_Container();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return ReadOnlyDirectory object
- */
- EClass getReadOnlyDirectory();
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- CommonarchiveFactory getCommonarchiveFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl <em>File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getFile()
- * @generated
- */
- EClass FILE = eINSTANCE.getFile();
-
- /**
- * The meta object literal for the '<em><b>URI</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute FILE__URI = eINSTANCE.getFile_URI();
-
- /**
- * The meta object literal for the '<em><b>Last Modified</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute FILE__LAST_MODIFIED = eINSTANCE.getFile_LastModified();
-
- /**
- * The meta object literal for the '<em><b>Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute FILE__SIZE = eINSTANCE.getFile_Size();
-
- /**
- * The meta object literal for the '<em><b>Directory Entry</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute FILE__DIRECTORY_ENTRY = eINSTANCE.getFile_DirectoryEntry();
-
- /**
- * The meta object literal for the '<em><b>Original URI</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute FILE__ORIGINAL_URI = eINSTANCE.getFile_OriginalURI();
-
- /**
- * The meta object literal for the '<em><b>Loading Container</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference FILE__LOADING_CONTAINER = eINSTANCE.getFile_LoadingContainer();
-
- /**
- * The meta object literal for the '<em><b>Container</b></em>' container reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference FILE__CONTAINER = eINSTANCE.getFile_Container();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl <em>Archive</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getArchive()
- * @generated
- */
- EClass ARCHIVE = eINSTANCE.getArchive();
-
- /**
- * The meta object literal for the '<em><b>Types</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute ARCHIVE__TYPES = eINSTANCE.getArchive_Types();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EJBJarFileImpl <em>EJB Jar File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EJBJarFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getEJBJarFile()
- * @generated
- */
- EClass EJB_JAR_FILE = eINSTANCE.getEJBJarFile();
-
- /**
- * The meta object literal for the '<em><b>Deployment Descriptor</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR = eINSTANCE.getEJBJarFile_DeploymentDescriptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl <em>WAR File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getWARFile()
- * @generated
- */
- EClass WAR_FILE = eINSTANCE.getWARFile();
-
- /**
- * The meta object literal for the '<em><b>Deployment Descriptor</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference WAR_FILE__DEPLOYMENT_DESCRIPTOR = eINSTANCE.getWARFile_DeploymentDescriptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl <em>EAR File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getEARFile()
- * @generated
- */
- EClass EAR_FILE = eINSTANCE.getEARFile();
-
- /**
- * The meta object literal for the '<em><b>Module Refs</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference EAR_FILE__MODULE_REFS = eINSTANCE.getEARFile_ModuleRefs();
-
- /**
- * The meta object literal for the '<em><b>Deployment Descriptor</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference EAR_FILE__DEPLOYMENT_DESCRIPTOR = eINSTANCE.getEARFile_DeploymentDescriptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ApplicationClientFileImpl <em>Application Client File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ApplicationClientFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getApplicationClientFile()
- * @generated
- */
- EClass APPLICATION_CLIENT_FILE = eINSTANCE.getApplicationClientFile();
-
- /**
- * The meta object literal for the '<em><b>Deployment Descriptor</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR = eINSTANCE.getApplicationClientFile_DeploymentDescriptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl <em>Module File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getModuleFile()
- * @generated
- */
- EClass MODULE_FILE = eINSTANCE.getModuleFile();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl <em>Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ContainerImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getContainer()
- * @generated
- */
- EClass CONTAINER = eINSTANCE.getContainer();
-
- /**
- * The meta object literal for the '<em><b>Files</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference CONTAINER__FILES = eINSTANCE.getContainer_Files();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ReadOnlyDirectoryImpl <em>Read Only Directory</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ReadOnlyDirectoryImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getReadOnlyDirectory()
- * @generated
- */
- EClass READ_ONLY_DIRECTORY = eINSTANCE.getReadOnlyDirectory();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.RARFileImpl <em>RAR File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.RARFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getRARFile()
- * @generated
- */
- EClass RAR_FILE = eINSTANCE.getRARFile();
-
- /**
- * The meta object literal for the '<em><b>Deployment Descriptor</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference RAR_FILE__DEPLOYMENT_DESCRIPTOR = eINSTANCE.getRARFile_DeploymentDescriptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleRefImpl <em>Module Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleRefImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getModuleRef()
- * @generated
- */
- EClass MODULE_REF = eINSTANCE.getModuleRef();
-
- /**
- * The meta object literal for the '<em><b>Module File</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference MODULE_REF__MODULE_FILE = eINSTANCE.getModuleRef_ModuleFile();
-
- /**
- * The meta object literal for the '<em><b>Ear File</b></em>' container reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference MODULE_REF__EAR_FILE = eINSTANCE.getModuleRef_EarFile();
-
- /**
- * The meta object literal for the '<em><b>Module</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference MODULE_REF__MODULE = eINSTANCE.getModuleRef_Module();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EJBModuleRefImpl <em>EJB Module Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EJBModuleRefImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getEJBModuleRef()
- * @generated
- */
- EClass EJB_MODULE_REF = eINSTANCE.getEJBModuleRef();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WebModuleRefImpl <em>Web Module Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WebModuleRefImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getWebModuleRef()
- * @generated
- */
- EClass WEB_MODULE_REF = eINSTANCE.getWebModuleRef();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ClientModuleRefImpl <em>Client Module Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ClientModuleRefImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getClientModuleRef()
- * @generated
- */
- EClass CLIENT_MODULE_REF = eINSTANCE.getClientModuleRef();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ConnectorModuleRefImpl <em>Connector Module Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ConnectorModuleRefImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl#getConnectorModuleRef()
- * @generated
- */
- EClass CONNECTOR_MODULE_REF = eINSTANCE.getConnectorModuleRef();
-
- }
-
-} //CommonarchivePackage
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ConnectorModuleRef.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ConnectorModuleRef.java
deleted file mode 100644
index 134021a4d..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ConnectorModuleRef.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.jca.Connector;
-
-/**
- * @generated
- */
-public interface ConnectorModuleRef extends ModuleRef {
- Connector getConnector() throws ArchiveWrappedException;
-
-} //ConnectorModuleRef
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Container.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Container.java
deleted file mode 100644
index cea334e92..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Container.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * @generated
- */
-public interface Container extends File {
-
- /**
- * Indicate whether the archive contains a file having a relative path of the parameter; the uri
- * may or may not have a leading separator
- */
- public boolean containsFile(String uri);
-
- /**
- * Return the absolute path of the file from its load strategy, if it is known. Should be used
- * mainly for read-only runtime purposes, as edit-time modifications may make the result
- * undefined.
- *
- * @throws FileNotFoundException
- * if the archive is "virtual", eg, a nested jar
- */
- public String getAbsolutePath() throws FileNotFoundException;
-
- public File getFile(String uri) throws FileNotFoundException;
-
- public InputStream getInputStream(String uri) throws FileNotFoundException, IOException;
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.LoadStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy getLoadStrategy();
-
- /**
- * Indicates whether the archive has ever had its files enumerated; used as an optimization
- */
- public boolean isIndexed();
-
- /**
- * Goes directly to the strategy
- */
- public InputStream primGetInputStream(String uri) throws FileNotFoundException, IOException;
-
- public void rebuildFileIndex();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newLoadStrategy
- * com.ibm.etools.archive.LoadStrategy
- */
- public void setLoadStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy newLoadStrategy);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The list of Files references
- */
- EList getFiles();
-
- /**
- * Clears the list of files in this Container and drops the index
- */
- public void clearFiles();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EARFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EARFile.java
deleted file mode 100644
index 20c7545d5..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EARFile.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.io.FileNotFoundException;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.application.ConnectorModule;
-import org.eclipse.jst.j2ee.application.EjbModule;
-import org.eclipse.jst.j2ee.application.JavaClientModule;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.application.WebModule;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.common.EjbRef;
-import org.eclipse.jst.j2ee.common.SecurityRole;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ObjectNotFoundException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.jca.Connector;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-
-/**
- * @generated
- */
-public interface EARFile extends ModuleFile {
-
- /**
- * Makes a copy of
- *
- * @aModuleFile, using its local deployment descriptor; creates a new Module and adds it to the
- * Application deployment descriptor of this EAR file and adds the copy of the
- * ModuleFile to this EAR.
- *
- * @return The copied module file
- *
- * @exception DuplicateObjectException
- * if this EAR already contains a file with the same uri as
- * @aModuleFile
- */
-
- public ModuleFile addCopy(ModuleFile aModuleFile) throws DuplicateObjectException;
-
-
- /**
- * This is the same as addCopy(ModuleFile) except the return value is the new ModuleRef
- */
- public ModuleRef addCopyRef(ModuleFile aModuleFile) throws DuplicateObjectException;
-
- /**
- * Add a copy of the security role to the dd for the module; if an alt dd is specified, add to
- * that dd; otherwise add to the standard dd of the module; also add a copy of the role to the
- * ear file dd if a role with that name does not already exist
- *
- * @throws DuplicateObjectException
- * if the dd for aModule already contains a role with that name
- */
- public SecurityRole addCopy(SecurityRole aRole, Module aModule) throws DuplicateObjectException;
-
- /**
- * Add a copy of the security role to the ear file's dd, if it does not already contain a role
- * with the same name
- */
- public SecurityRole addCopyIfNotExists(SecurityRole aRole);
-
- EObject getAltDeploymentDescriptor(Module aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- /**
- * Returns a filtered list of ApplicationClientFiles; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getApplicationClientFiles();
-
- /**
- * Returns a filtered list of ClientModuleRefs
- */
- public List getClientModuleRefs();
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
-
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The DeploymentDescriptor reference
- */
- Application getDeploymentDescriptor() throws DeploymentDescriptorLoadException;
-
- Connector getDeploymentDescriptor(ConnectorModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- EJBJar getDeploymentDescriptor(EjbModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- ApplicationClient getDeploymentDescriptor(JavaClientModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- EObject getDeploymentDescriptor(Module aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- WebApp getDeploymentDescriptor(WebModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException;
-
- /**
- * Returns a filtered list of EJBJarFiles; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getEJBJarFiles();
-
- /**
- * Returns a filtered list of EJBModuleRefs
- */
- public List getEJBModuleRefs();
-
-
- /**
- * Return an enterprise bean referenced by the EjbRef, if one exists. The ejb-link value of the
- * ref must equate to a named enterprise bean contained in the jar; otherwise return null.
- * Returns the first hit found; assumption that the ejb names are unique within the scope of the
- * ear file. This will likely be replaced with a better way for dereferencing ejb refs.
- *
- * Can be used with ejb 1.1 references only.
- *
- * @deprecated {@link#getEnterpiseBeanFromRef(EjbRef ref, String moduleUri )
- * @param EjbRef
- * ref - An ejb reference
- * @return EnterpriseBean
- */
- public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref);
-
- /**
- * Return an enterprise bean referenced by the EjbRef and a module uri, if one exists. The
- * ejb-link value of the ref must equate to a named enterprise bean contained in the jar;
- * otherwise return null. Returns the first hit found; assumption that the ejb names are unique
- * within the scope of the ear file. This will likely be replaced with a better way for
- * dereferencing ejb refs.
- *
- * Can be used with ejb 1.1 & ejb 2.0 references.
- *
- * @param EjbRef
- * ref - An ejb reference
- * @param String
- * moduleUri - The module uri
- * @return EnterpriseBean
- */
- public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref, String moduleUri);
-
- public Module getModule(String uri, String altDD);
-
- /**
- * @return the module ref which references
- * @moduleDescriptor
- */
- public ModuleRef getModuleRef(Module moduleDescriptor);
-
- /**
- * @return java.util.List of all module refs in this EAR having a reference to
- * @aModuleFile
- */
- public List getModuleRefs(ModuleFile aModuleFile);
-
- /**
- * Returns a filtered list of ModuleFiles; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getModuleFiles();
-
- /**
- * Returns a filtered list of RarFiles; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getRARFiles();
-
- /**
- * Returns a filtered list of FARFiles; adds will not be reflected; use
- * {@link Archive#add(File)}
- */
- public List getFARFiles();
-
- /**
- * Returns a filtered list of ConnectorModuleRefs
- */
- public List getConnectorModuleRefs();
-
- /**
- * Return all security roles from all existing modules (EjbModule and WebModule)
- */
- public EList getRolesFromAllModules();
-
- /**
- * Return all security roles from an existing module (EjbModule and WebModule)
- */
- public EList getRolesFromModule(Module aModule);
-
- /**
- * Returns a filtered list of WarFiles; adds will not be reflected; use
- *
- * @link Archive#add(File)
- */
- public List getWARFiles();
-
- /**
- * Returns a filtered list of WebModuleRefs
- */
- public List getWebModuleRefs();
-
- /**
- * Copy the role into each ModuleFile in the ear file which does not already contain the role
- * Assumption: a role with the same name as
- *
- * @role exists in the application deployment descriptor
- */
- public void pushDownRole(SecurityRole role);
-
- /**
- * Copy the role into the ModuleFile for the module, if the module does not already contain the
- * role Assumption: a role with the same name as
- *
- * @role exists in the application deployment descriptor
- */
- public void pushDownRole(SecurityRole role, Module aModule);
-
- /**
- * Attempt to remove the module for the parameter from this object's dd, then remove the module
- * file, if it is not referenced from any other ModuleRef, from the list of files
- */
- public void remove(ModuleRef aModuleRef);
-
- /**
- * Rename the security role in the ear file's dd; push this change down to any contained module
- * dd's; if the module specifies an alt-dd, the change will be reflected there; otherwise it
- * will be reflected in the standard dd of the module
- *
- * @throws ObjectNotFoundException
- * if the dd for the ear does not contain a role with the existingRoleName
- *
- * @throws DuplicateObjectException
- * if the dd for the ear file already contains a role with the new name
- */
- public void renameSecurityRole(String existingRoleName, String newRoleName) throws ObjectNotFoundException, DuplicateObjectException;
-
- /**
- * For each security role in the dd for each module, add a copy to the ear file's dd; if an
- * alt-dd is specified for the module, use that dd; otherwise use the standard dd in the module
- * file
- */
- public void rollUpRoles();
-
- /**
- * For each security role in the dd for a module, add a copy to the ear file's dd; if an alt-dd
- * is specified for the module, use that dd; otherwise use the standard dd in the module file
- */
- public void rollUpRoles(Module aModule);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the DeploymentDescriptor reference
- */
- void setDeploymentDescriptor(Application value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The list of ModuleRefs references
- */
- EList getModuleRefs();
-
- public List getArchivesOfType(String type);
-
- /**
- * Return a Map of Modules as keys and a List of EJB References as the values. This will let you
- * know which Modules the references came from. You can filter the list of EJB References
- * returned on the linked attributed of the reference. This means that you can filter linked
- * references, non-linked references, or neither (i.e., return all references).
- */
- Map getEJBReferences(boolean filterLinkedReferences, boolean filterNonLinkedReferences) throws ArchiveWrappedException;
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBJarFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBJarFile.java
deleted file mode 100644
index e7bd0a70a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBJarFile.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-
-
-/**
- * @generated
- */
-public interface EJBJarFile extends ModuleFile {
-
- /**
- * Used for tools performing selective import
- */
- public List getAssociatedFiles(EnterpriseBean ejb);
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
-
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The DeploymentDescriptor reference
- */
- EJBJar getDeploymentDescriptor() throws DeploymentDescriptorLoadException;
-
- public boolean isImportedFrom10();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the DeploymentDescriptor reference
- */
- void setDeploymentDescriptor(EJBJar value);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBModuleRef.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBModuleRef.java
deleted file mode 100644
index 38226fbba..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBModuleRef.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-
-/**
- * @generated
- */
-public interface EJBModuleRef extends ModuleRef {
-
- EJBJar getEJBJar() throws ArchiveWrappedException;
-
-} //EJBModuleRef
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/File.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/File.java
deleted file mode 100644
index fc053ad50..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/File.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.io.InputStream;
-
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-
-/**
- * @generated
- */
-public interface File extends J2EEEObject {
-
- /**
- * Return the path up to the filename; e.g., from com/ibm/foo/bar.class, com/ibm/foo
- */
- public String getDirectoryURI();
-
- public InputStream getInputStream() throws java.io.FileNotFoundException, java.io.IOException;
-
- /**
- * Return the tail of the file path; e.g., from com/ibm/foo/bar.class, return bar.class
- */
- public String getName();
-
- public boolean isApplicationClientFile();
-
- public boolean isArchive();
-
- public boolean isContainer();
-
- public boolean isEARFile();
-
- public boolean isFARFile();
-
- public boolean isEJBJarFile();
-
- public boolean isModuleFile();
-
- public boolean isRARFile();
-
- public boolean isReadOnlyDirectory();
-
- public boolean isWARFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the URI attribute
- */
- String getURI();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the URI attribute
- */
- void setURI(String value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the LastModified attribute
- */
- long getLastModified();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#getLastModified <em>Last Modified</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @param value the new value of the '<em>Last Modified</em>' attribute.
- * @see #isSetLastModified()
- * @see #unsetLastModified()
- * @see #getLastModified()
- * @generated
- */
- void setLastModified(long value);
-
- /**
- * Unsets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#getLastModified <em>Last Modified</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #isSetLastModified()
- * @see #getLastModified()
- * @see #setLastModified(long)
- * @generated
- */
- void unsetLastModified();
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#getLastModified <em>Last Modified</em>}' attribute is set.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @return whether the value of the '<em>Last Modified</em>' attribute is set.
- * @see #unsetLastModified()
- * @see #getLastModified()
- * @see #setLastModified(long)
- * @generated
- */
- boolean isSetLastModified();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the Size attribute
- */
- long getSize();
-
- /**
- * Sets the value of the '
- * {@link org.eclipse.jst.j2ee.internal.commonarchivecore.File#getSize <em>Size</em>}' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Size</em>' attribute.
- * @see #isSetSize()
- * @see #unsetSize()
- * @see #getSize()
- * @generated
- */
- void setSize(long value);
-
- /**
- * Unsets the value of the '
- * {@link org.eclipse.jst.j2ee.internal.commonarchivecore.File#getSize <em>Size</em>}' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #isSetSize()
- * @see #getSize()
- * @see #setSize(long)
- * @generated
- */
- void unsetSize();
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#getSize <em>Size</em>}' attribute is set.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @return whether the value of the '<em>Size</em>' attribute is set.
- * @see #unsetSize()
- * @see #getSize()
- * @see #setSize(long)
- * @generated
- */
- boolean isSetSize();
-
- /**
- * Returns the value of the '<em><b>Directory Entry</b></em>' attribute. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Directory Entry</em>' attribute isn't clear, there really
- * should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Directory Entry</em>' attribute.
- * @see #isSetDirectoryEntry()
- * @see #unsetDirectoryEntry()
- * @see #setDirectoryEntry(boolean)
- * @see org.eclipse.jst.j2ee.internal.commonarchivecore.CommonarchivePackage#getFile_DirectoryEntry()
- * @model unsettable="true"
- * @generated
- */
- boolean isDirectoryEntry();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#isDirectoryEntry <em>Directory Entry</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @param value the new value of the '<em>Directory Entry</em>' attribute.
- * @see #isSetDirectoryEntry()
- * @see #unsetDirectoryEntry()
- * @see #isDirectoryEntry()
- * @generated
- */
- void setDirectoryEntry(boolean value);
-
- /**
- * Unsets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#isDirectoryEntry <em>Directory Entry</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #isSetDirectoryEntry()
- * @see #isDirectoryEntry()
- * @see #setDirectoryEntry(boolean)
- * @generated
- */
- void unsetDirectoryEntry();
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.File#isDirectoryEntry <em>Directory Entry</em>}' attribute is set.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @return whether the value of the '<em>Directory Entry</em>' attribute is set.
- * @see #unsetDirectoryEntry()
- * @see #isDirectoryEntry()
- * @see #setDirectoryEntry(boolean)
- * @generated
- */
- boolean isSetDirectoryEntry();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the OriginalURI attribute
- */
- String getOriginalURI();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the OriginalURI attribute
- */
- void setOriginalURI(String value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The LoadingContainer reference
- */
- Container getLoadingContainer();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the LoadingContainer reference
- */
- void setLoadingContainer(Container value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The Container reference
- */
- Container getContainer();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the Container reference
- */
- void setContainer(Container value);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/GenericArchiveTypeDiscriminator.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/GenericArchiveTypeDiscriminator.java
deleted file mode 100644
index c2acce7f1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/GenericArchiveTypeDiscriminator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-/**
- * @author mdelder
- */
-public interface GenericArchiveTypeDiscriminator {
-
- /**
- * This is a unique identifier that contributors should use to specify the generic type that
- * should be associated with archives. Example: com.yourcompany.j2ee.extension.customModule
- *
- * @return
- */
- public String getTypeKey();
-
- /**
- * If common archive should recognize file extensions other than the standard ones, e.g., .jar,
- * .zip, then these file extensions can be specified here.
- *
- * @return
- */
- public String[] getCustomFileExtensions();
-
- /**
- * Method that individual discriminators can implement to determine if an Archive is of a
- * particular type. Implementers should be sensitive to performance requirments. Usually simple
- * tests should be performed, such as:
- * <code>if (anArchive.containsFile("xxx.xml")<code>. The result will
- * be stored in the Archive's "types" attribute.
- * @param anArchive
- * @return
- */
- public boolean discriminate(Archive anArchive);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleFile.java
deleted file mode 100644
index 5704b827b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleFile.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-
-/**
- * @generated
- */
-public interface ModuleFile extends Archive {
-
- public Resource getDeploymentDescriptorResource() throws java.io.FileNotFoundException, ResourceLoadException;
-
- public String getDeploymentDescriptorUri();
-
- /**
- * Return the container for this archive casted to EARFile; null if this file is not contained
- * in an EARFile
- */
- public EARFile getEARFile();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.ExportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy getExportStrategy();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy getImportStrategy();
-
- /**
- * Returns the specification version of the module file. For example, "2.0"
- *
- * @deprecated, Use getDeploymentDescriptorResource().getModuleVersionID();
- */
- public String getSpecVersion();
-
- /**
- * Return the version ID of the module For example, "20"
- *
- * @return int
- */
- public int getSpecVersionID();
-
- EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException;
-
- /**
- * Answers whether the deployment descriptor is null; used for copy, to determine whether the
- * import strategy needs to be copied or not
- */
- public boolean isDeploymentDescriptorSet();
-
- public Resource makeDeploymentDescriptorResource();
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newExportStrategy
- * com.ibm.etools.archive.ExportStrategy
- */
- public void setExportStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy newExportStrategy);
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newImportStrategy
- * com.ibm.etools.archive.ImportStrategy
- */
- public void setImportStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy newImportStrategy);
-
- /**
- * Sets the J2EE version for this archive
- *
- * @see org.eclipse.jst.j2ee.internal.J2EEVersionConstants
- */
- public void setJ2EEVersion(int versionID);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleRef.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleRef.java
deleted file mode 100644
index 051230a14..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleRef.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-
-/**
- * @generated
- */
-public interface ModuleRef extends J2EEEObject {
-
- /**
- * Return the parsed local deployment descriptor from the ModuleFile
- */
- EObject getStandardDeploymentDescriptor();
-
- /**
- * Return the parsed alt dd, if it exists, from the EAR file containing this module
- */
- EObject getAltDeploymentDescriptor() throws ArchiveWrappedException;
-
- /**
- * Return an alt dd if it exists, otherwise the local dd
- */
- EObject getDeploymentDescriptor() throws ArchiveWrappedException;
-
-
- /**
- * Gets the uri from the {@link Module}referenced by this ref; if there is no module, (eg. a
- * standalone JAR), gets the uri from the {@link ModuleFile}. Assumption: The uri of the
- * {@link Module}and {@link ModuleFile}should stay in sync
- */
- String getUri();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The ModuleFile reference
- */
- ModuleFile getModuleFile();
-
- /**
- * Similar to {@link Archive#getMofResource(String)}, except that alt-dd indirection is
- * considered. If this module uses an alt-dd, then the uri will be prepended with the "alt-root"
- * and the resource will be loaded from the owning EAR file. In this case, all hrefs into and
- * out of this resource should be relative to the root of the EAR. The hrefs are taken care of
- * for free when the client uses {@link #makeAltDescriptorsAndResources()}. The alt root is
- * automatically generated when it does not exist.
- *
- * @see ModuleExtension#getAltRoot()
- */
- Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException;
-
- public InputStream getAltResourceInputStream(String uri) throws IOException;
-
- public InputStream getLocalResourceInputStream(String uri) throws IOException;
-
- /**
- * Return an input stream from the resources path of either the ModuleFile, if the module does
- * not use alt-dd, or from the altRoot of the module, found in the resources path of the EAR
- *
- * @see LoadStrategy#getResourceInputStream(String)
- */
- public InputStream getResourceInputStream(String uri) throws IOException;
-
-
- /**
- * Retrieve a resource from the ModuleFile
- *
- * @see Archive#getMofResource(String)
- */
- Resource getLocalMofResource(String uri) throws FileNotFoundException, ResourceLoadException;
-
- /**
- * The uri will be prepended with the "alt-root" and the resource will be loaded from the owning
- * EAR file.
- */
- Resource getAltMofResource(String uri) throws FileNotFoundException, ResourceLoadException;
-
- /**
- * Create a new mof resource and add it to the resource set of the context of either the module
- * file if this ModuleRef is not an alt, or to the EAR file if it is an alt. If this module is
- * uses an alt-dd, then the uri will be prepended with the "alt-root" The alt root is
- * automatically generated when it does not exist.
- *
- * @throws DuplicateObjectException
- * if a resource already exists in this archive having the uri
- */
- Resource makeMofResource(String uri) throws DuplicateObjectException;
-
- Resource makeLocalMofResource(String uri) throws DuplicateObjectException;
-
- Resource makeAltMofResource(String uri) throws DuplicateObjectException;
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the ModuleFile reference
- */
- void setModuleFile(ModuleFile value);
-
- /**
- * Rename this module; both its ModuleFile and Module element from the Application deployment
- * descriptor.
- */
- public void setURI(String uri);
-
- boolean isEJB();
-
- boolean isWeb();
-
- boolean isClient();
-
- boolean isConnector();
-
- boolean usesAltDD();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The EarFile reference
- */
- EARFile getEarFile();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the EarFile reference
- */
- void setEarFile(EARFile value);
-
- /**
- * Returns the value of the '<em><b>Module</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Module</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Module</em>' reference.
- * @see #setModule(Module)
- * @see org.eclipse.jst.j2ee.commonarchivecore.CommonarchivePackage#getModuleRef_Module()
- * @model required="true"
- * @generated
- */
- Module getModule();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef#getModule <em>Module</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Module</em>' reference.
- * @see #getModule()
- * @generated
- */
- void setModule(Module value);
-
-} //ModuleRef
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RARFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RARFile.java
deleted file mode 100644
index 7df552076..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RARFile.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.jca.Connector;
-
-
-/**
- * @generated
- */
-public interface RARFile extends ModuleFile{
-
- /**
- * Returns the value of the '<em><b>Deployment Descriptor</b></em>' reference. <!--
- * begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Deployment Descriptor</em>' reference list isn't clear, there
- * really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Deployment Descriptor</em>' reference.
- * @see #setDeploymentDescriptor(Connector)
- * @see org.eclipse.jst.j2ee.internal.commonarchivecore.CommonarchivePackage#getRARFile_DeploymentDescriptor()
- * @model required="true"
- * @generated
- */
- Connector getDeploymentDescriptor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile#getDeploymentDescriptor <em>Deployment Descriptor</em>}' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @param value the new value of the '<em>Deployment Descriptor</em>' reference.
- * @see #getDeploymentDescriptor()
- * @generated
- */
- void setDeploymentDescriptor(Connector value);
-
- /**
- * Extracts the RAR file to the specified directory. This method should be used for expanding
- * the RAR file if it is a standalone RAR. If the RAR file is packaged as part of an EAR, this
- * method should not be used. Instead, the expandTo() of the EAR should be used expand the
- * contents of the ear and the nested RAR relative to the EAR's directory (similar to WAR's).
- * Creation date: (2/6/2001 7:44:41 PM)
- *
- * @param dir
- * java.lang.String
- * @param expandFlags
- * int
- */
- void extractToConnectorDirectory(String dir, int expandFlags) throws SaveFailureException;
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ReadOnlyDirectory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ReadOnlyDirectory.java
deleted file mode 100644
index 83ef763a1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ReadOnlyDirectory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.util.List;
-
-/**
- * @generated
- */
-public interface ReadOnlyDirectory extends Container {
-
- public boolean containsFileInSelfOrSubdirectory(String uri);
-
- public File getFileInSelfOrSubdirectory(String uri) throws java.io.FileNotFoundException;
-
- /**
- * Returns a flat list of all the files contained in this directory and subdirectories, with the
- * directories filtered out, as the list would appear in an archive
- */
- public List getFilesRecursive();
-
- /**
- * Return a filtered list on the files with just the instances of ReadOnlyDirectory
- */
- public List getReadOnlyDirectories();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RepairArchiveCommand.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RepairArchiveCommand.java
deleted file mode 100644
index 56dc27bdd..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RepairArchiveCommand.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants;
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.jee.archive.internal.ArchiveUtil;
-
-
-/**
- * Insert the type's description here. Creation date: (02/27/01 2:20:44 PM)
- *
- * @author: Administrator
- */
-public class RepairArchiveCommand extends AbstractCommand {
- protected Archive archive;
- protected static Map directoryNames;
-
- /**
- * RepairMetaInfCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public RepairArchiveCommand(Archive anArchive) {
- super("Repair Archive", CommonArchiveResourceHandler.Repairs_all_entries_in_the); // = "Repairs all entries in the META-INF and/or WEB-INF directories to be the correct case"//$NON-NLS-1$
- archive = anArchive;
- //Ensure Initiailization
- getDirectoryNames();
- }
-
- /**
- * @see com.ibm.etools.common.command.Command
- */
- public void execute() {
- List files = archive.getFiles();
- for (int i = 0; i < files.size(); i++) {
- File aFile = (File) files.get(i);
- if (aFile.isArchive()) {
- new RepairArchiveCommand((Archive) aFile).execute();
- } else {
- String upperUri = aFile.getURI().toUpperCase();
- Iterator keysAndValues = directoryNames.entrySet().iterator();
- while (keysAndValues.hasNext()) {
- String uri = aFile.getURI();
- Map.Entry entry = (Map.Entry) keysAndValues.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- if (upperUri.startsWith(key) && !uri.startsWith(value)) {
- String tail = uri.substring(key.length());
- aFile.setURI(value.concat(tail));
- break;
- }
- }
- }
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (03/14/01 5:55:14 PM)
- *
- * @return java.util.Set
- */
- protected static java.util.Map getDirectoryNames() {
- if (directoryNames == null) {
- directoryNames = new HashMap(6);
- directoryNames.put(J2EEConstants.META_INF.toUpperCase(), J2EEConstants.META_INF);
- directoryNames.put(J2EEConstants.WEB_INF.toUpperCase(), J2EEConstants.WEB_INF);
- directoryNames.put(ArchiveConstants.WEBAPP_LIB_URI.toUpperCase(), ArchiveConstants.WEBAPP_LIB_URI);
- directoryNames.put(ArchiveConstants.WEBAPP_CLASSES_URI.toUpperCase(), ArchiveConstants.WEBAPP_CLASSES_URI);
- }
- return directoryNames;
- }
-
- @Override
- public Collection getResult() {
- return Arrays.asList(new Object[]{archive});
- }
-
- /**
- * Insert the method's description here. Creation date: (03/14/01 6:46:16 PM)
- *
- * @param args
- * java.lang.String[]
- */
- public static void main(String[] args) {
- if (!validateArgs(args))
- return;
- try {
- Archive anArchive = CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().primOpenArchive(args[0]);
- new RepairArchiveCommand(anArchive).execute();
- anArchive.saveAs(args[1]);
- } catch (Exception ex) {
- System.out.println(CommonArchiveResourceHandler.Repair_command_failed___ex_EXC_); // = "Repair command failed - exception stack trace:"
- J2EECorePlugin.logError(ex);
- }
- }
-
- @Override
- protected boolean prepare() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.common.command.Command
- */
- public void redo() {
- //Default
- }
-
- protected static boolean validateArgs(String[] args) {
- if (!(args.length == 2)) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(CommonArchiveResourceHandler.RepairArchiveCommand_usage); // = "RepairArchiveCommand usage: <sourceJarFilePath> <destinationPath>"
- return false;
- }
- java.io.File file = new java.io.File(args[0]);
- boolean isZip = false;
- java.util.zip.ZipFile zip = null;
- try {
- zip = ArchiveUtil.newZipFile(file);
- isZip = true;
- } catch (java.io.IOException ex) {
- isZip = false;
- } finally {
- if (zip != null)
- try {
- zip.close();
- } catch (java.io.IOException ex) {
- //Ignore
- }
- }
- if (!isZip && !file.isDirectory()) {
- System.out.println(CommonArchiveResourceHandler.RepairArchiveCommand_usage1_ERROR_); // = "RepairArchiveCommand usage: sourceJarFilePath must point to a valid archive or directory of an inflated archive"
- return false;
- }
- if (new java.io.File(args[1]).canWrite()) {
- System.out.println(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.repair_usage_ERROR_, (new Object[]{args[1]}))); // = "RepairArchiveCommand usage: cannot write to destinationPath "
- return false;
- }
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ValidateXmlCommand.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ValidateXmlCommand.java
deleted file mode 100644
index 317c8856f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ValidateXmlCommand.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.internal.xml.CollectingErrorHandler;
-import org.eclipse.jst.j2ee.internal.xml.XmlDocumentReader;
-import org.xml.sax.InputSource;
-
-/**
- * Insert the type's description here. Creation date: (03/19/01 10:04:08 AM)
- *
- * @author: Administrator
- */
-public class ValidateXmlCommand extends AbstractCommand {
- protected List results;
- protected ModuleFile archive;
- public boolean validateNested = true;
-
- /**
- * ValidateXmlCommand constructor comment.
- */
- protected ValidateXmlCommand() {
- super();
- }
-
- /**
- * ValidateXmlCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public ValidateXmlCommand(ModuleFile m) {
- super();
- archive = m;
- }
-
- /**
- * ValidateXmlCommand constructor comment.
- *
- * @param label
- * java.lang.String
- */
- protected ValidateXmlCommand(String label) {
- super(label);
- }
-
- /**
- * ValidateXmlCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- protected ValidateXmlCommand(String label, String description) {
- super(label, description);
- }
-
- /**
- * @see Command
- */
- public void execute() {
- results = new ArrayList();
- validatateXml();
- if (isValidateNested()) {
- List archives = archive.getArchiveFiles();
- for (int i = 0; i < archives.size(); i++) {
- Archive a = (Archive) archives.get(i);
- if (!a.isModuleFile())
- continue;
- ModuleFile m = (ModuleFile) a;
- ValidateXmlCommand cmd = new ValidateXmlCommand(m);
- cmd.execute();
- results.addAll(cmd.getResult());
- }
- }
- }
-
- /**
- * @return List of XmlValidationResult; 1 for the archive, and one for each nested module file
- */
- @Override
- public Collection getResult() {
- return results;
- }
-
- /**
- * Insert the method's description here. Creation date: (10/22/2001 1:06:52 PM)
- *
- * @return boolean
- */
- public boolean isValidateNested() {
- return validateNested;
- }
-
- @Override
- protected boolean prepare() {
- return true;
- }
-
- /**
- * @see Command
- */
- public void redo() {
- //Default
- }
-
- /**
- * Insert the method's description here. Creation date: (10/22/2001 1:06:52 PM)
- *
- * @param newValidateNested
- * boolean
- */
- public void setValidateNested(boolean newValidateNested) {
- validateNested = newValidateNested;
- }
-
- protected void validatateXml() {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- Resource res = archive.getStandardDeploymentDescriptor().eResource();
- XmlValidationResult result = new XmlValidationResult();
- result.setArchive(archive);
- try {
- res.save(bos, new java.util.HashMap());
- } catch (Exception ex) {
- throw new org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException(ex);
- }
- ByteArrayInputStream inStream = new ByteArrayInputStream(bos.toByteArray());
- InputSource source = new InputSource(inStream);
- CollectingErrorHandler handler = new CollectingErrorHandler();
- XmlDocumentReader parseAdapter = new XmlDocumentReader(source, null, handler);
-
- // the following try/catch clause is added to handle the case
- // when SAX parser throws a fatal exception (type SAXException)
- // for unmatching end tag that results in a RuntimeException to
- // be thrown. Need to catch it so we can get the parser exceptions
- // and display them to the user.
- try {
- parseAdapter.parseDocument();
- } catch (RuntimeException re) {
-
- if (handler.getCaughtExceptions() != null) {
- result.setArchive(archive);
- result.setCaughtExceptions(handler.getCaughtExceptions());
- results.add(result);
- }
-
- throw re;
- }
-
- result.setArchive(archive);
- result.setCaughtExceptions(handler.getCaughtExceptions());
- results.add(result);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WARFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WARFile.java
deleted file mode 100644
index 577b0849a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WARFile.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-
-/**
- * @generated
- */
-public interface WARFile extends ModuleFile {
-
- /**
- * Copy the file, and swizzle the file uri if necessary by prepending the classes directory
- *
- * @throws DuplicateObjectException
- * of a file with the modified uri already exists in the archive
- *
- * @throws IllegalArgumentException
- * if the parameter is a ReadOnlyDirectory
- */
- public File addCopyClass(File aFile) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- /**
- * Copy the file, and swizzle the file uri if necessary by prepending the libs directory
- *
- * @throws DuplicateObjectException
- * of a file with the modified uri already exists in the archive
- *
- * @throws IllegalArgumentException
- * if the parameter is a ReadOnlyDirectory
- */
- public File addCopyLib(File aFile) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-
- /**
- * getClasses() - filter files to return the class files from \web-inf\classes
- */
- public List getClasses();
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
-
-
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The DeploymentDescriptor reference
- */
- WebApp getDeploymentDescriptor() throws DeploymentDescriptorLoadException;
-
- /**
- * Filter files to return the files from \we-inf\lib
- */
- public List getLibs();
-
- /**
- * Filter files to return the JARs and Zips from \we-inf\lib
- */
- public List getLibArchives();
-
- /**
- * getResources() - filter files to return the Web resources within the WAR (no
- * classes/libs/metadata)
- */
- public List getResources();
-
- /**
- * Return the source file that matches the output file passed in
- *
- * @param aClassFile
- * The .class file or other output file to find the source for
- * @return String The matching source. Null if there is no matching source found
- */
- public File getSourceFile(File aClassFile);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the DeploymentDescriptor reference
- */
- void setDeploymentDescriptor(WebApp value);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WebModuleRef.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WebModuleRef.java
deleted file mode 100644
index 379099231..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WebModuleRef.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-/**
- * @generated
- */
-public interface WebModuleRef extends ModuleRef {
- WebApp getWebApp() throws ArchiveWrappedException;
-
-} //WebModuleRef
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/XmlValidationResult.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/XmlValidationResult.java
deleted file mode 100644
index c55958531..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/XmlValidationResult.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal;
-
-
-
-import java.util.List;
-
-
-
-/**
- * Insert the type's description here. Creation date: (03/19/01 3:31:53 PM)
- *
- * @author: Administrator
- */
-public class XmlValidationResult {
- protected ModuleFile archive;
- protected List caughtExceptions;
-
- /**
- * XmlValidationResult constructor comment.
- */
- public XmlValidationResult() {
- super();
- }
-
- /**
- * Insert the method's description here. Creation date: (03/19/01 3:34:45 PM)
- *
- * @return com.ibm.etools.commonarchive.ModuleFile
- */
- public ModuleFile getArchive() {
- return archive;
- }
-
- /**
- * Insert the method's description here. Creation date: (03/19/01 3:34:45 PM)
- *
- * @return java.util.List
- */
- public java.util.List getCaughtExceptions() {
- return caughtExceptions;
- }
-
- /**
- * Insert the method's description here. Creation date: (03/19/01 3:34:45 PM)
- *
- * @param newArchive
- * com.ibm.etools.commonarchive.ModuleFile
- */
- public void setArchive(ModuleFile newArchive) {
- archive = newArchive;
- }
-
- /**
- * Insert the method's description here. Creation date: (03/19/01 3:34:45 PM)
- *
- * @param newCaughtExceptions
- * java.util.List
- */
- public void setCaughtExceptions(java.util.List newCaughtExceptions) {
- caughtExceptions = newCaughtExceptions;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveException.java
deleted file mode 100644
index 5357b47d3..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Base exception class for non-runtime exceptions occurring with manipulation of archives
- */
-public class ArchiveException extends Exception {
- /**
- *
- */
- private static final long serialVersionUID = 4340145465956505570L;
-
- /**
- *
- */
- public ArchiveException() {
- super();
- }
-
- /**
- *
- */
- public ArchiveException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveRuntimeException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveRuntimeException.java
deleted file mode 100644
index 5788e24be..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveRuntimeException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-import org.eclipse.jst.j2ee.internal.WrappedRuntimeException;
-
-
-
-/**
- * Base exception class for runtime exceptions occurring with manipulation of archives; there are
- * some situations where we can only throw a runtime exception instead of a subtype of exception,
- * because the signatures of etools generated methods cannot be overridden to throw any exception
- * other than runtime.
- */
-public class ArchiveRuntimeException extends WrappedRuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = -4727603215052186958L;
-
- /**
- * Constructor for ArchiveRuntimeException.
- */
- public ArchiveRuntimeException() {
- super();
- }
-
- /**
- * Constructor for ArchiveRuntimeException.
- *
- * @param e
- */
- public ArchiveRuntimeException(Exception e) {
- super(e);
- }
-
- /**
- * Constructor for ArchiveRuntimeException.
- *
- * @param s
- */
- public ArchiveRuntimeException(String s) {
- super(s);
- }
-
- /**
- * Constructor for ArchiveRuntimeException.
- *
- * @param s
- * @param e
- */
- public ArchiveRuntimeException(String s, Exception e) {
- super(s, e);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveWrappedException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveWrappedException.java
deleted file mode 100644
index f290e2444..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveWrappedException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-import org.eclipse.jst.j2ee.internal.WrappedException;
-
-
-
-/**
- * Base exception class for non-runtime exceptions occurring with manipulation of archives, where a
- * caught exception causes this exception to be thrown
- */
-public class ArchiveWrappedException extends WrappedException {
- /**
- *
- */
- private static final long serialVersionUID = 3011655166037300546L;
-
- /**
- * Constructor for ArchiveWrappedException.
- */
- public ArchiveWrappedException() {
- super();
- }
-
- /**
- * Constructor for ArchiveWrappedException.
- *
- * @param e
- */
- public ArchiveWrappedException(Exception e) {
- super(e);
- }
-
- /**
- * Constructor for ArchiveWrappedException.
- *
- * @param s
- */
- public ArchiveWrappedException(String s) {
- super(s);
- }
-
- /**
- * Constructor for ArchiveWrappedException.
- *
- * @param s
- * @param e
- */
- public ArchiveWrappedException(String s, Exception e) {
- super(s, e);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DeploymentDescriptorLoadException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DeploymentDescriptorLoadException.java
deleted file mode 100644
index d7b8e6228..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DeploymentDescriptorLoadException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which can occur if an error/exception occurs while loading a deployment descriptor
- */
-public class DeploymentDescriptorLoadException extends ArchiveRuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = -3870314481148871665L;
-
- /**
- * ResourceLoadException constructor comment.
- */
- public DeploymentDescriptorLoadException() {
- super();
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public DeploymentDescriptorLoadException(Exception e) {
- super(e);
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public DeploymentDescriptorLoadException(String s) {
- super(s);
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public DeploymentDescriptorLoadException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DuplicateObjectException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DuplicateObjectException.java
deleted file mode 100644
index 9c8be7893..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DuplicateObjectException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which can occur when an attemp is made to add to a list an object equaling, or having
- * the same name, id, etc, as another object in the list.
- */
-public class DuplicateObjectException extends ArchiveException {
- /**
- *
- */
- private static final long serialVersionUID = 7269139518957826130L;
- protected Object duplicate;
-
- /**
- * DuplicateObjectException constructor comment.
- */
- public DuplicateObjectException() {
- super();
- }
-
- /**
- * DuplicateObjectException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public DuplicateObjectException(String s) {
- super(s);
- }
-
- /**
- * DuplicateObjectException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public DuplicateObjectException(String s, Object o) {
- super(s);
- setDuplicate(o);
- }
-
- /**
- * Insert the method's description here. Creation date: (04/16/01 9:43:00 AM)
- *
- * @return java.lang.Object
- */
- public java.lang.Object getDuplicate() {
- return duplicate;
- }
-
- /**
- * Insert the method's description here. Creation date: (04/16/01 9:43:00 AM)
- *
- * @param newDuplicate
- * java.lang.Object
- */
- protected void setDuplicate(java.lang.Object newDuplicate) {
- duplicate = newDuplicate;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/EmptyResourceException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/EmptyResourceException.java
deleted file mode 100644
index 4d39f86b3..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/EmptyResourceException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which occurs when a mof resource's extent contains zero elements and an attempt is made
- * to access an elememt from the resource.
- */
-public class EmptyResourceException extends ArchiveException {
- /**
- *
- */
- private static final long serialVersionUID = -6482393304280160585L;
-
- /**
- * EmptyResourceException constructor comment.
- */
- public EmptyResourceException() {
- super();
- }
-
- /**
- * EmptyResourceException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public EmptyResourceException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/IArchiveWrappedException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/IArchiveWrappedException.java
deleted file mode 100644
index aa97248eb..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/IArchiveWrappedException.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-import org.eclipse.jst.j2ee.internal.IWrappedException;
-
-/**
- * @deprecated
- * @see org.eclipse.jst.j2ee.internal.exception.IWrappedException
- */
-public interface IArchiveWrappedException extends IWrappedException {
- //Default
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ManifestException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ManifestException.java
deleted file mode 100644
index 93fe20594..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ManifestException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-public class ManifestException extends ArchiveRuntimeException {
-
- /**
- *
- */
- private static final long serialVersionUID = 1045140899078192019L;
-
- /**
- * Constructor for ManifestException.
- */
- public ManifestException() {
- super();
- }
-
- /**
- * Constructor for ManifestException.
- *
- * @param e
- */
- public ManifestException(Exception e) {
- super(e);
- }
-
- /**
- * Constructor for ManifestException.
- *
- * @param s
- */
- public ManifestException(String s) {
- super(s);
- }
-
- /**
- * Constructor for ManifestException.
- *
- * @param s
- * @param e
- */
- public ManifestException(String s, Exception e) {
- super(s, e);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NestedJarException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NestedJarException.java
deleted file mode 100644
index 5828f5790..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NestedJarException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Runtime exception thrown when an error occurs reading a jar within a jar
- */
-public class NestedJarException extends ArchiveRuntimeException {
-
- /**
- *
- */
- private static final long serialVersionUID = -559954723242646381L;
-
- public NestedJarException() {
- super();
- }
-
- public NestedJarException(Exception e) {
- super(e);
- }
-
- public NestedJarException(String s, Exception e) {
- super(s, e);
- }
-
- public NestedJarException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoEJB10DescriptorsException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoEJB10DescriptorsException.java
deleted file mode 100644
index d9973e5b6..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoEJB10DescriptorsException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Insert the type's description here. Creation date: (06/05/01 7:31:27 PM)
- *
- * @author: Administrator
- */
-public class NoEJB10DescriptorsException extends RuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = 7222290886333179223L;
-
- /**
- * NoEJB10DescriptorsException constructor comment.
- */
- public NoEJB10DescriptorsException() {
- super();
- }
-
- /**
- * NoEJB10DescriptorsException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public NoEJB10DescriptorsException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleElementException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleElementException.java
deleted file mode 100644
index 68bc7ecc1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleElementException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * @deprecated No Longer used; check for null instead Exception which occurs if an attempt is made
- * to access a non-existent module dd element from an ear file
- */
-public class NoModuleElementException extends ArchiveException {
- /**
- *
- */
- private static final long serialVersionUID = 3781813351160222774L;
-
- /**
- * NoModuleElementException constructor comment.
- */
- public NoModuleElementException() {
- super();
- }
-
- /**
- * NoModuleElementException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public NoModuleElementException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleFileException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleFileException.java
deleted file mode 100644
index e1f435a4e..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleFileException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-public class NoModuleFileException extends ArchiveRuntimeException {
-
- /**
- *
- */
- private static final long serialVersionUID = -7261084646147362776L;
-
- /**
- * Constructor for NoModuleFileException.
- */
- public NoModuleFileException() {
- super();
- }
-
- /**
- * Constructor for NoModuleFileException.
- *
- * @param e
- */
- public NoModuleFileException(Exception e) {
- super(e);
- }
-
- /**
- * Constructor for NoModuleFileException.
- *
- * @param s
- */
- public NoModuleFileException(String s) {
- super(s);
- }
-
- /**
- * Constructor for NoModuleFileException.
- *
- * @param s
- * @param e
- */
- public NoModuleFileException(String s, Exception e) {
- super(s, e);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotADeploymentDescriptorException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotADeploymentDescriptorException.java
deleted file mode 100644
index 418974546..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotADeploymentDescriptorException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Insert the type's description here. Creation date: (06/06/01 9:26:43 AM)
- *
- * @author: Administrator
- */
-public class NotADeploymentDescriptorException extends Exception {
- /**
- *
- */
- private static final long serialVersionUID = -9072252417343910963L;
-
- /**
- * NotADeploymentDescriptorException constructor comment.
- */
- public NotADeploymentDescriptorException() {
- super();
- }
-
- /**
- * NotADeploymentDescriptorException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public NotADeploymentDescriptorException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotSupportedException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotSupportedException.java
deleted file mode 100644
index 435d13e4f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotSupportedException.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-public class NotSupportedException extends ArchiveWrappedException {
- /**
- *
- */
- private static final long serialVersionUID = -6690631631593101382L;
-
- /**
- * NotSupportedException constructor comment.
- */
- public NotSupportedException() {
- super();
- }
-
- /**
- * NotSupportedException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public NotSupportedException(Exception e) {
- super(e);
- }
-
- /**
- * NotSupportedException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public NotSupportedException(String s) {
- super(s);
- }
-
- /**
- * NotSupportedException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public NotSupportedException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ObjectNotFoundException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ObjectNotFoundException.java
deleted file mode 100644
index 1c266b007..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ObjectNotFoundException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Insert the type's description here. Creation date: (02/08/01 8:33:51 PM)
- *
- * @author: Administrator
- */
-public class ObjectNotFoundException extends ArchiveException {
- /**
- *
- */
- private static final long serialVersionUID = 3539317762510485699L;
-
- /**
- * ObjectNotFoundException constructor comment.
- */
- public ObjectNotFoundException() {
- super();
- }
-
- /**
- * ObjectNotFoundException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public ObjectNotFoundException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/OpenFailureException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/OpenFailureException.java
deleted file mode 100644
index c78d4a496..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/OpenFailureException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which occurs while opening an archive; could occur for a variety of reasons, eg, io
- * failure, deployment descriptor errors, etc. Check the nested exception for more info.
- */
-public class OpenFailureException extends ArchiveWrappedException {
- /**
- *
- */
- private static final long serialVersionUID = -1786924156051091340L;
-
- /**
- * OpenFailureException constructor comment.
- */
- public OpenFailureException() {
- super();
- }
-
- /**
- * OpenFailureException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public OpenFailureException(Exception e) {
- super(e);
- }
-
- /**
- * OpenFailureException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public OpenFailureException(String s) {
- super(s);
- }
-
- /**
- * OpenFailureException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public OpenFailureException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ReopenException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ReopenException.java
deleted file mode 100644
index be479db6f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ReopenException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which can be thrown as a result of an IO exception which may occur while "re-syncing"
- * an archive after it has been saved. For example, if 10 files are copied from Archive A to Archive
- * B, then archive b is saved, its contents will be loaded from a new source, the newly saved jar
- * file. Therefore, the archive will be reopened after saving, which could result in an IOException.
- */
-public class ReopenException extends ArchiveWrappedException {
- /**
- *
- */
- private static final long serialVersionUID = -2797595721842336360L;
-
- /**
- * ReopenException constructor comment.
- */
- public ReopenException() {
- super();
- }
-
- /**
- * ReopenException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public ReopenException(Exception e) {
- super(e);
- }
-
- /**
- * ReopenException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public ReopenException(String s) {
- super(s);
- }
-
- /**
- * ReopenException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public ReopenException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ResourceLoadException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ResourceLoadException.java
deleted file mode 100644
index 394c836bd..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ResourceLoadException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception thrown if in exception other than java.io.FileNotFoundException is caught while
- * attempting to load a mof resource.
- */
-public class ResourceLoadException extends ArchiveRuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = -3337225489102635339L;
-
- /**
- * ResourceLoadException constructor comment.
- */
- public ResourceLoadException() {
- super();
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param e
- * java.lang.Exception
- */
- public ResourceLoadException(Exception e) {
- super(e);
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public ResourceLoadException(String s) {
- super(s);
- }
-
- /**
- * ResourceLoadException constructor comment.
- *
- * @param s
- * java.lang.String
- * @param e
- * java.lang.Exception
- */
- public ResourceLoadException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SaveFailureException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SaveFailureException.java
deleted file mode 100644
index b2bd5562b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SaveFailureException.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-/**
- * Exception which occurs while saving an archive; could occur for a variety of reasons, eg, io
- * failure, etc. Check the nested exception for more info.
- */
-public class SaveFailureException extends ArchiveWrappedException {
- /**
- *
- */
- private static final long serialVersionUID = 8593253339847650246L;
-
- /**
- * SaveFailureException constructor comment.
- */
- public SaveFailureException() {
- super();
- }
-
- /**
- * SaveFailureException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public SaveFailureException(Exception e) {
- super(e);
- }
-
- /**
- * SaveFailureException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public SaveFailureException(String s) {
- super(s);
- }
-
- /**
- * SaveFailureException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public SaveFailureException(String s, Exception e) {
- super(s, e);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SubclassResponsibilityException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SubclassResponsibilityException.java
deleted file mode 100644
index 2c1ef6ee0..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SubclassResponsibilityException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-
-/**
- * Runtime exception used as a way to enforce abstract behavior without declaring the methods
- * abstract. Necessary because impl classes in the etools generated hierarchy cannot be abstract if
- * they have subtypes.
- */
-public class SubclassResponsibilityException extends ArchiveRuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = -6815673671775564354L;
-
- /**
- * SubclassResponsibilityException constructor comment.
- */
- public SubclassResponsibilityException() {
- super();
- }
-
- /**
- * SubclassResponsibilityException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public SubclassResponsibilityException(String methodName) {
- super(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.subclass_responsibilty_EXC_, (new Object[]{methodName}))); // = " must be implemented in subclass"
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/UncontainedModuleFileException.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/UncontainedModuleFileException.java
deleted file mode 100644
index 61ed8253f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/UncontainedModuleFileException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.exception;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-
-
-/**
- * @deprecated Exception no longer thrown; check for null instead. Exception which may be thrown
- * whenever a {@link ModuleFile}is expected to be contained within an ear file but it
- * is not
- */
-public class UncontainedModuleFileException extends ArchiveRuntimeException {
- /**
- *
- */
- private static final long serialVersionUID = 7311775746549718190L;
-
- /**
- * UncontainedModuleException constructor comment.
- */
- public UncontainedModuleFileException() {
- super();
- }
-
- /**
- * UncontainedModuleException constructor comment.
- *
- * @param s
- * java.lang.String
- */
- public UncontainedModuleFileException(String s) {
- super(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveConstants.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveConstants.java
deleted file mode 100644
index 47418eeb1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveConstants.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-
-/**
- * This is a catalog of useful constants for the archive support. Can be used to store relative
- * paths to specific xml and xmi resources.
- */
-public interface ArchiveConstants extends J2EEConstants {
- //Standard Jar info
- /** "com" */
- String RAR_CLASSES_URI = "com"; //$NON-NLS-1$
-
- /**
- * Relative path in a war file with no leading slash "WEB-INF/lib/"
- */
- String WEBAPP_LIB_URI = "WEB-INF/lib/"; //$NON-NLS-1$
-
- /**
- * Relative path in a war file with no leading slash "WEB-INF/classes/"
- */
- String WEBAPP_CLASSES_URI = "WEB-INF/classes/"; //$NON-NLS-1$
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveInit.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveInit.java
deleted file mode 100644
index 9da4d46f9..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveInit.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-import org.eclipse.jst.j2ee.internal.J2EEInit;
-import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil;
-
-
-/**
- * Initializer class to preregister packages
- */
-public class ArchiveInit {
- protected static boolean initialized = false;
- protected static boolean plugin_initialized = false;
-
- public static void init() {
- init(true);
- }
-
- public static void init(boolean shouldPreRegisterPackages) {
- if (!initialized) {
- initialized = true;
- invokePrereqInits(shouldPreRegisterPackages);
- if (shouldPreRegisterPackages)
- preRegisterPackages();
- }
- }
-
- private static void preRegisterPackages() {
- //CommonarchivePackage reg
- ExtendedEcoreUtil.preRegisterPackage("commonarchive.xmi", new EPackage.Descriptor() { //$NON-NLS-1$
- public EPackage getEPackage() {
- return CommonarchivePackage.eINSTANCE;
- }
- public EFactory getEFactory() {
- return CommonarchiveFactory.eINSTANCE;
- }
- });
- ExtendedEcoreUtil.preRegisterPackage("commonarchive.looseconfig.xmi", new EPackage.Descriptor() { //$NON-NLS-1$
- public EPackage getEPackage() {
- return LooseconfigPackage.eINSTANCE;
- }
- public EFactory getEFactory() {
- return LooseconfigFactory.eINSTANCE;
- }
- });
- }
-
- public static void invokePrereqInits(boolean shouldPreRegisterPackages) {
- J2EEInit.init(shouldPreRegisterPackages);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifest.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifest.java
deleted file mode 100644
index cb5cc2e5f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-/**
- * Contains the API of
- *
- * @link java.util.jar.Manifest, along with added helpers
- * @deprecated - see org.eclipse.jst.common.internal.modulecore.ArchiveManifest
- */
-public interface ArchiveManifest extends org.eclipse.jst.common.internal.modulecore.util.ArchiveManifest {
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifestImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifestImpl.java
deleted file mode 100644
index 27643bac9..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifestImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-/**
- * Helper class for manifest files
- * @deprecated
- */
-public class ArchiveManifestImpl extends org.eclipse.jst.common.internal.modulecore.util.ArchiveManifestImpl
- implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest {
- /**
- * ArchiveManifest constructor comment.
- * @deprecated
- */
- public ArchiveManifestImpl() {
- super();
- }
-
- /**
- * ArchiveManifest constructor comment.
- *
- * @param is
- * java.io.InputStream
- * @throws java.io.IOException
- * The exception description.
- * @deprecated
- */
- public ArchiveManifestImpl(java.io.InputStream is) throws java.io.IOException {
- super(is);
- }
-
- /**
- * @deprecated
- * @param man
- */
- public ArchiveManifestImpl(java.util.jar.Manifest man) {
- super(man);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveOptions.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveOptions.java
deleted file mode 100644
index 7f927ea32..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveOptions.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-
-
-/**
- * Insert the type's description here. Creation date: (05/02/01 2:58:48 PM)
- *
- * @author: Administrator
- */
-public class ArchiveOptions implements Cloneable {
-
- public static final int SAX = 1;
- public static final int DOM = 2;
- public static final int DEFAULT = 3;
-
- private int rendererType = DEFAULT;
-
- public static final int LOAD_MODE_COMPAT = 0;
- public static final int LOAD_MODE_SPEC = 1;
-
- private int classLoadingMode = LOAD_MODE_COMPAT;
-
-
- /**
- * Load strategy for opening/reading the archive; optional - if null a load strategy will be
- * created when the archive is opened
- */
- private LoadStrategy loadStrategy;
- /**
- * Indicator for whether auto java reflection should be turned on in the archive - defaults to
- * true
- */
- private boolean useJavaReflection = true;
- /**
- * Indicator for whether the archive will be modified after opening or if it is just being
- * opened, read, saved to a new location; this is an optimization to avoid temp file creation
- * and saving of individual files within a nested archive if the nested archive will not change -
- * defaults to false
- */
- private boolean isReadOnly;
-
- /**
- * Indicator for whether a libary nested in another archive (eg, utility JARs in an EAR) will be
- * saved out as an ordinary file or as a nested Archive. When loaded into memory these files are
- * treated as Archives, to support dynamic class loading for Java reflection of classes in
- * EJBJarFiles and dependent JARs. An archive opened for edit, either by adding or removing
- * files or changning the Manifest or a deployment descriptor, will be saved as a new file one
- * file at a time. The default for this flag is true; it only applies to library Archives, not
- * instances of ModuleFile. If you wish to edit a nested library, set this flag to false
- */
- private boolean saveLibrariesAsFiles = true;
-
-
- private boolean saveOnlyDirtyMofResources = true;
-
- /**
- * By default, nested archives are treated as primitive archives and are not piped through the
- * discriminator tree on the archive factory; module files in an EAR are opened using the
- * specific open methods on the factory; change this flag if you'd like nested archives to be
- * discriminated
- */
- private boolean discriminateNestedArchives = false;
-
- private Map readOnlyFlags;
-
- /**
- * ArchiveOptions constructor comment.
- */
- public ArchiveOptions() {
- super();
- }
-
- /**
- * Make a copy of the reciever, setting the loadStrategy to null
- */
- @Override
- public Object clone() {
- return cloneWith(null);
- }
-
- /**
- * Make a copy of the reciever, setting the loadStrategy to null
- */
- public ArchiveOptions cloneWith(LoadStrategy aLoadStrategy) {
- try {
- ArchiveOptions result = (ArchiveOptions) super.clone();
- result.setLoadStrategy(aLoadStrategy);
- result.readOnlyFlags = null;
- return result;
- } catch (CloneNotSupportedException ignore) {
- return null;
- }
- }
-
- public ArchiveOptions cloneWith(LoadStrategy aLoadStrategy, String uri) {
- ArchiveOptions result = cloneWith(aLoadStrategy);
- result.setIsReadOnly(isReadOnly(uri));
- return result;
- }
-
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy getLoadStrategy() {
- return loadStrategy;
- }
-
- public boolean isReadOnly() {
- return isReadOnly;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/18/2001 2:42:11 PM)
- *
- * @return boolean
- */
- public boolean saveOnlyDirtyMofResources() {
- return saveOnlyDirtyMofResources;
- }
-
- public void setIsReadOnly(boolean newIsReadOnly) {
- isReadOnly = newIsReadOnly;
- }
-
- public void setIsReadOnly(boolean readOnly, String uri) {
- if (readOnlyFlags == null)
- readOnlyFlags = new HashMap();
- readOnlyFlags.put(uri, new Boolean(readOnly));
- }
-
- public boolean isReadOnly(String uri) {
- if (readOnlyFlags != null) {
- Boolean bool = (Boolean) readOnlyFlags.get(uri);
- if (bool != null)
- return bool.booleanValue();
- }
- return isReadOnly;
- }
-
- public void setLoadStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy newLoadStrategy) {
- loadStrategy = newLoadStrategy;
- loadStrategy.setReadOnly(isReadOnly());
- loadStrategy.setRendererType(getRendererType());
- }
-
- /**
- * Insert the method's description here. Creation date: (7/18/2001 2:42:11 PM)
- *
- * @param newSaveOnlyDirtyMofResources
- * boolean
- */
- public void setSaveOnlyDirtyMofResources(boolean newSaveOnlyDirtyMofResources) {
- saveOnlyDirtyMofResources = newSaveOnlyDirtyMofResources;
- }
-
- public void setUseJavaReflection(boolean newUseJavaReflection) {
- useJavaReflection = newUseJavaReflection;
- }
-
- public boolean useJavaReflection() {
- return useJavaReflection;
- }
-
- /**
- * Gets the saveLibrariesAsFiles.
- *
- * @return Returns a boolean
- */
- public boolean isSaveLibrariesAsFiles() {
- return saveLibrariesAsFiles;
- }
-
- /**
- * Sets the saveLibrariesAsFiles.
- *
- * @param saveLibrariesAsFiles
- * The saveLibrariesAsFiles to set
- */
- public void setSaveLibrariesAsFiles(boolean saveLibrariesAsFiles) {
- this.saveLibrariesAsFiles = saveLibrariesAsFiles;
- }
-
-
- /**
- * Gets the discriminateNestedArchives.
- *
- * @return Returns a boolean
- */
- public boolean shouldDiscriminateNestedArchives() {
- return discriminateNestedArchives;
- }
-
- /**
- * Sets the discriminateNestedArchives.
- *
- * @param discriminateNestedArchives
- * The discriminateNestedArchives to set
- */
- public void setDiscriminateNestedArchives(boolean discriminateNestedArchives) {
- this.discriminateNestedArchives = discriminateNestedArchives;
- }
-
- /**
- * @return Returns the rendererType.
- */
- public int getRendererType() {
- return rendererType;
- }
-
- /**
- * The rendererType allows a user to override the renderer used by Common Archive for special
- * cases in the UI where you really want to use a non-synchronizing renderer.
- *
- * @param rendererType
- * The rendererType to set.
- */
- public void setRendererType(int rendererType) {
- this.rendererType = rendererType;
- }
-
- public int getClassLoadingMode() {
- return classLoadingMode;
- }
-
- /**
- * Valid values are LOAD_MODE_COMPAT or LOAD_MODE_SPEC. The default is LOAD_MODE_COMPAT. This
- * flag is to set the class loading mode; the default is LOAD_MODE_COMPAT for backwards
- * compatibility, while LOAD_MODE_SPEC will enforce spec defined class loading.
- *
- * @param classLoadingMode
- */
- public void setClassLoadingMode(int classLoadingMode) {
- this.classLoadingMode = classLoadingMode;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminator.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminator.java
deleted file mode 100644
index 9236586fd..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy;
-
-
-/**
- * An interface that defines an API for opening archives. The {@link CommonArchiveFactory}
- * implementation uses a root level discriminator to open an archive. The main benefit of this api
- * is it allows extended teams or third parties to plug in to the framework to allow specialized
- * kinds of jar files do be discerned at creation/open time without the client having to provide a
- * lot of logic. For example, a client would simply write
- * <code>((CommonArchivePackage)EPackage.Registry.INSTANCE.getEPackage(CommonArchivePackage.eNS_URI)).getCommonArchiveFactory().open(aString)<code>, and get back
- * the correct kind of archive instance. A discriminator contains children, which is an ordered list of discriminators, each of which
- * can have its turn to determine if it can open an archive. The first one to succeed wins. Once a discriminator determines that it
- * can open an archive, it gives each of its children the opportuntity to do something more specific, and so on. In the base
- * implementation, discriminators are defined as single instances of an inner class for each import strategy. The following code shows
- * how to register a discriminator for a specialized EJBJarFile:
- * <code>EjbJar11ImportStrategyImpl.getDiscriminator().addChild(aDiscriminator);</code>
- * This would be done as an initialization at startup time. If the child discriminator is ever invoked, the parent will have already
- * determined that the archive is an EJBJarFile and will have converted it to that type.
- */
-public interface ArchiveTypeDiscriminator {
- public void addChild(ArchiveTypeDiscriminator child);
-
- /**
- * @throws java.util.NoSuchElementException
- * if the predecessor is not included in the list of children
- */
- public void addChildAfter(ArchiveTypeDiscriminator child, ArchiveTypeDiscriminator predecessor) throws java.util.NoSuchElementException;
-
- /**
- * @throws java.util.NoSuchElementException
- * if the successor is not included in the list of children
- */
- public void addChildBefore(ArchiveTypeDiscriminator child, ArchiveTypeDiscriminator successor) throws java.util.NoSuchElementException;
-
- /**
- * Performs tests on the archive to determine if it is the kind this discriminator is interested
- * in
- */
- public boolean canImport(Archive anArchive);
-
- /**
- * Factory method to create the import strategy for a converted archive
- */
- public ImportStrategy createImportStrategy(Archive old, Archive newArchive);
-
- /**
- * Return a string to be presented either through an exception or error message when a specific
- * kind of archive is expected and this discriminator can't open it.
- */
- public String getUnableToOpenMessage();
-
- public boolean hasChild(ArchiveTypeDiscriminator disc);
-
- public boolean hasChildren();
-
- /**
- * Point of entry for attempting to open an archive
- *
- * @return a converted archive or null if this discriminator can't convert it
- */
- public Archive openArchive(Archive anArchive) throws OpenFailureException;
-
- public void removeChild(ArchiveTypeDiscriminator child);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminatorImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminatorImpl.java
deleted file mode 100644
index 9046b3c7b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveTypeDiscriminatorImpl.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy;
-
-
-/**
- * @see ArchiveTypeDiscriminator
- */
-public abstract class ArchiveTypeDiscriminatorImpl implements ArchiveTypeDiscriminator {
- protected List children;
-
- public ArchiveTypeDiscriminatorImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public void addChild(ArchiveTypeDiscriminator child) {
- if (hasChild(child))
- return;
- getChildren().add(child);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public void addChildAfter(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator child, org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator predecessor) throws java.util.NoSuchElementException {
- if (hasChild(child))
- return;
- int index = getChildren().indexOf(predecessor);
- if (index >= 0) {
- index++;
- getChildren().add(index, child);
- } else {
- throw new java.util.NoSuchElementException(predecessor.toString());
- }
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public void addChildBefore(ArchiveTypeDiscriminator child, ArchiveTypeDiscriminator successor) throws java.util.NoSuchElementException {
- if (hasChild(child))
- return;
- int index = getChildren().indexOf(successor);
- if (index >= 0) {
- getChildren().add(index, child);
- } else {
- throw new java.util.NoSuchElementException(successor.toString());
- }
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public abstract boolean canImport(Archive anArchive);
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public Archive convert(Archive anArchive) throws OpenFailureException {
- Archive destination = createConvertedArchive();
-
- //turn of notifications
- destination.eSetDeliver(false);
- destination.eSetDeliver(false);
-
- //Copy the relevant attributes
- destination.setURI(anArchive.getURI());
- destination.setOriginalURI(anArchive.getURI());
- destination.setSize(anArchive.getSize());
- destination.setLastModified(anArchive.getLastModified());
-
- destination.setLoadStrategy(anArchive.getLoadStrategy());
- destination.setOptions(anArchive.getOptions());
- destination.setExtraClasspath(anArchive.getExtraClasspath());
- if (destination.isModuleFile()) {
- ImportStrategy importStrategy = createImportStrategy(anArchive, destination);
- ((ModuleFile) destination).setImportStrategy(importStrategy);
- }
-
-
-
- //turn notifications back on
- destination.eSetDeliver(true);
- destination.eSetDeliver(true);
-
- return destination;
- }
-
- public abstract Archive createConvertedArchive();
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public abstract ImportStrategy createImportStrategy(Archive old, Archive newArchive);
-
- public java.util.List getChildren() {
- if (children == null)
- children = new java.util.ArrayList();
- return children;
- }
-
- /**
- * Iterate through each child and attempt to convert the archive to the child's type; return the
- * converted archive from the first child that succeeds, or null if no child succeeds or no
- * child exists
- */
- protected Archive getImportableArchiveFromChild(Archive anArchive) throws OpenFailureException {
- if (!hasChildren()) {
- return null;
- }
- List theChildren = getChildren();
- Archive childConvertedArchive = null;
- for (int i = 0; i < theChildren.size(); i++) {
- ArchiveTypeDiscriminator child = (ArchiveTypeDiscriminator) theChildren.get(i);
- childConvertedArchive = child.openArchive(anArchive);
- if (childConvertedArchive != null) {
- return childConvertedArchive;
- }
- }
- return null;
- }
-
- protected String getXmlDDMessage(String archiveType, String ddUri) {
- return CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.invalid_archive_EXC_, (new Object[]{archiveType, ddUri})); // = "Archive is not a valid {0} because the deployment descriptor can not be found (case sensitive): {1}"
- }
-
- public boolean hasChild(ArchiveTypeDiscriminator disc) {
- return hasChildren() && getChildren().contains(disc);
- }
-
- public boolean hasChildren() {
- return children != null && children.size() > 0;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public Archive openArchive(Archive anArchive) throws OpenFailureException {
- if (!canImport(anArchive)) {
- return null;
- }
- Archive convertedArchive = convert(anArchive);
- Archive childConvertedArchive = getImportableArchiveFromChild(convertedArchive);
- if (childConvertedArchive != null)
- return childConvertedArchive;
- return convertedArchive;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- public void removeChild(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator child) {
- getChildren().remove(child);
- }
-
- public void setChildren(java.util.List newChildren) {
- children = newChildren;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveURIConverterImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveURIConverterImpl.java
deleted file mode 100644
index a5b3a4229..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveURIConverterImpl.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import com.ibm.icu.util.StringTokenizer;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.jee.archive.internal.ArchiveUtil;
-
-
-/**
- * Helper class used for loading of mof resources contained within an archive; knows how to retrieve
- * an input stream for a given uri
- */
-public class ArchiveURIConverterImpl extends URIConverterImpl {
- protected static final String fileProtocol = "file"; //$NON-NLS-1$
- protected static final String platformProtocol = "platform"; //$NON-NLS-1$
- private String inFilepath, outFilepath;
-
- public ArchiveURIConverterImpl(org.eclipse.jst.j2ee.commonarchivecore.internal.Archive anArchive, String resourcesPath) {
- setArchive(anArchive);
- this.resourcesPath = resourcesPath;
- setInputFilepath(resourcesPath);
- String outpath = resourcesPath;
- if (outpath == null) {
- LoadStrategy l = anArchive.getLoadStrategy();
- if (l != null && l.isDirectory()) {
- try {
- outpath = l.getAbsolutePath();
- } catch (FileNotFoundException ignore) {
- //Ignore
- }
- }
- }
- setOutputFilepath(outpath);
- }
-
- /** The archive from which resources will be loaded */
- protected org.eclipse.jst.j2ee.commonarchivecore.internal.Archive archive;
- protected String resourcesPath;
-
- public org.eclipse.jst.j2ee.commonarchivecore.internal.Archive getArchive() {
- return archive;
- }
-
- @Override
- public InputStream createInputStream(URI uri) throws IOException {
- InputStream in = null;
- if (resourcesPath != null)
- in = makeInputStream(uri);
- if (in != null)
- return in;
- return getArchive().getInputStream(uri.toString());
- }
-
- public void setArchive(org.eclipse.jst.j2ee.commonarchivecore.internal.Archive newArchive) {
- archive = newArchive;
- }
-
- /**
- * Gets the resourcesPath.
- *
- * @return Returns a String
- */
- public String getResourcesPath() {
- return resourcesPath;
- }
-
- /**
- * Sets the resourcesPath.
- *
- * @param resourcesPath
- * The resourcesPath to set
- */
- public void setResourcesPath(String resourcesPath) {
- this.resourcesPath = resourcesPath;
- setInputFilepath(resourcesPath);
- setOutputFilepath(resourcesPath);
- }
-
- @Override
- public URI normalize(URI uri) {
- return ((URIConverterImpl.URIMap)getURIMap()).getURI(uri);
- }
-
- /**
- * The input file path consists of a string of directories or zip files separated by semi-colons
- * that are searched when an input stream is constructed.
- *
- * @return The file path
- */
- public String getInputFilepath() {
- return inFilepath;
- }
-
- /**
- * @param filepath
- * The file path
- */
- public void setInputFilepath(String filepath) {
- inFilepath = filepath;
- }
-
- /**
- * @return The output file path
- */
- public String getOutputFilepath() {
- return outFilepath;
- }
-
- /**
- * The output file path is the path name of a directory to prepend to relative file path names
- * when an output stream is constructed.
- *
- * @param filepath
- * The output file path
- */
- public void setOutputFilepath(String filepath) {
- outFilepath = filepath;
- }
-
- /**
- * Convert the URI to an input stream.
- *
- * @param uri
- * The uri
- */
- public InputStream makeInputStream(URI uri) throws IOException {
- URI converted = uri;
-
- if ((fileProtocol.equals(converted.scheme()) || converted.scheme() == null) && inFilepath != null) {
- return searchFilePath(converted.toString());
- }
- URL url = createURL(converted.toString());
- URLConnection urlConnection = url.openConnection();
- return urlConnection.getInputStream();
- }
-
- /**
- * Search the file path if the file portion of the URL is not absolute (does not begin with "/";
- * otherwise, attempt to create an input stream for the file.
- */
- protected InputStream searchFilePath(String filename) throws IOException {
- File file = new File(filename);
- if (file.isAbsolute())
- return new FileInputStream(file);
- StringTokenizer st = new StringTokenizer(inFilepath, ";"); //$NON-NLS-1$
- while (st.hasMoreTokens()) {
- String f = st.nextToken();
- ZipFile zf = null;
- try {
- zf = ArchiveUtil.newZipFile(f);
- } catch (Exception e) {
- //Ignore
- }
- InputStream in = null;
- if (zf != null) {
- in = searchZipFile(zf, filename);
- if (in == null)
- try {
- zf.close();
- } catch (Exception e) {
- //Ignore
- }
- } else {
- in = searchDirectory(f, filename);
- }
- if (in != null)
- return in;
- }
- return null;
- }
-
- /**
- * This method determines whether the file with the relative path name of filename exists in the
- * given directory. If not, it returns null; otherwise, it opens the file up and returns the
- * input source.
- *
- * @param dir
- * java.lang.String
- * @return java.io.InputSource
- */
- protected InputStream searchDirectory(String dir, String filename) throws IOException {
- if (dir.equals(".")) //$NON-NLS-1$
- dir = System.getProperty("user.dir"); //$NON-NLS-1$
- File f = new File(dir + System.getProperty("file.separator") + filename.replace('/', File.separatorChar)); //$NON-NLS-1$
- if (!f.exists())
- return null;
- return new FileInputStream(f);
- }
-
- /**
- * This method determines whether there is a ZipEntry whose name is filename in the given
- * ZipFile. If not, it returns null; otherwise, it returns an input source to read from the
- * ZipEntry.
- *
- * @param zip
- * java.util.zip.ZipFile
- * @return java.io.InputSource
- */
- protected InputStream searchZipFile(ZipFile zip, String filename) throws IOException {
- ZipEntry entry = zip.getEntry(filename);
- if (entry == null)
- return null;
- return zip.getInputStream(entry);
- }
-
- /**
- * Make a URL from the uri; if the attempt fails, attempt to append "file:" to the URI; if the
- * attempt still fails, attempt to replace the protocol with the file protocol.
- *
- * @param uri
- * The string uri
- */
- public URL createURL(String uri) throws MalformedURLException {
- MalformedURLException m = null;
- if (uri == null)
- return null;
- URL url = null;
- try {
- url = new URL(uri);
- } catch (Exception e) {
- m = (MalformedURLException) e;
- }
- if (url != null)
- return url;
- // Either treat the URI as a filepath (if there are no : or
- // a : in position 1) or replace the given protocol with the
- // file protocol.
- int index = uri.indexOf(":"); //$NON-NLS-1$
- if (index == -1 || index == 1)
- uri = fileProtocol + ":" + uri; //$NON-NLS-1$
- else if (index > 0)
- uri = fileProtocol + ":" + uri.substring(index + 1); //$NON-NLS-1$
- try {
- url = new URL(uri);
- } catch (Exception e) {
- //Ignore
- }
- if (url != null)
- return url;
- else if(m != null)
- throw m;
- else
- throw new MalformedURLException();
- }
-
- /**
- * Convert the URI to an output stream.
- *
- * @param uri
- * The uri
- */
- @Override
- public OutputStream createOutputStream(URI uri) throws IOException {
- URI converted = uri;
- if (platformProtocol.equals(converted.scheme())) {
- URL resolvedURL = resolvePlatform(new URL(converted.toString()));
- if (resolvedURL != null) {
- converted = URI.createFileURI(resolvedURL.getFile());
- }
- }
- if (fileProtocol.equals(converted.scheme()) || converted.scheme() == null) {
- return openFileOutputStream(converted);
- }
- URL url = createURL(converted.toString());
- URLConnection urlConnection = url.openConnection();
- urlConnection.setDoOutput(true);
- return urlConnection.getOutputStream();
- }
-
- protected URL resolvePlatform(URL url) throws IOException {
- // let WorkbenchURIConverter implement this one.
- return null;
- }
-
- /**
- * Open a file output stream for the given uri (the uri has file protocol). If an output file
- * path is specified and the file name is relative, prepend the output file path to the file
- * name. Make the directories that contain the file if they do not exist.
- */
- protected OutputStream openFileOutputStream(URI uri) throws IOException {
- File file = new File(uri.toFileString());
- if (!file.isAbsolute() && outFilepath != null) {
- file = new File(outFilepath + File.separator + uri.toFileString());
- }
- String parent = file.getParent();
- if (parent != null) {
- new File(parent).mkdirs();
- }
- OutputStream outputStream = new FileOutputStream(file);
- return outputStream;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ExportStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ExportStrategy.java
deleted file mode 100644
index 89b080090..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ExportStrategy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ArchiveStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-
-
-
-/**
- * ExportStrategy knows what to do just before a dump of an archive is about to occur, typically
- * adding items such as deployment descriptors and such. This provides a delegation model for
- * archive/version/platform specific rules about which resources etc need to be exported. Clients
- * can implement this interface, and "plug in" to an instance of an archive.
- */
-public interface ExportStrategy extends ArchiveStrategy {
- /**
- * Returns whether this strategy has already saved a file entry having a uri named by the
- * parameter
- */
- public boolean hasSaved(String uri);
-
- /**
- * The archive is saving itself, and giving the export strategy the opportunity to do whatever
- * it needs to do. The export strategy may write entries directly to the SaveStrategy, but if it
- * does, it should remember the names of these entries so the archive does not attempt to
- * duplicate by saving an entry with the same name
- */
- public void preSave(SaveStrategy aSaveStrategy) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileExtensionsFilterImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileExtensionsFilterImpl.java
deleted file mode 100644
index 563aeb907..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileExtensionsFilterImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-
-
-/**
- * Insert the type's description here. Creation date: (02/28/01 1:20:09 PM)
- *
- * @author: Administrator
- */
-public class FileExtensionsFilterImpl extends SaveFilterImpl {
- protected Set excludedExtensions;
- protected boolean isCaseSensitive = false;
- protected Set excludedExtensionsAsUppercase;
-
- /**
- * FileExtensionsFilterImpl constructor comment.
- */
- public FileExtensionsFilterImpl(String[] extensionsToExclude, boolean caseSensitive) {
- super();
- Set extensions = new java.util.HashSet();
- for (int i = 0; i < extensionsToExclude.length; i++) {
- extensions.add(extensionsToExclude[i]);
- }
- setExcludedExtensions(extensions);
- setIsCaseSensitive(caseSensitive);
- initialize();
- }
-
- /**
- * FileExtensionsFilterImpl constructor comment.
- */
- public FileExtensionsFilterImpl(String extension, boolean caseSensitive) {
- super();
- Set extensions = new java.util.HashSet(1);
- extensions.add(extension);
- setExcludedExtensions(extensions);
- setIsCaseSensitive(caseSensitive);
- initialize();
- }
-
- /**
- * FileExtensionsFilterImpl constructor comment.
- */
- public FileExtensionsFilterImpl(Set extensionsToExclude, boolean caseSensitive) {
- super();
- setExcludedExtensions(extensionsToExclude);
- setIsCaseSensitive(caseSensitive);
- initialize();
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 1:24:28 PM)
- *
- * @return java.util.Set
- */
- public java.util.Set getExcludedExtensions() {
- return excludedExtensions;
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 2:42:20 PM)
- *
- * @return java.util.Set
- */
- protected java.util.Set getExcludedExtensionsAsUppercase() {
- return excludedExtensionsAsUppercase;
- }
-
- protected void initialize() {
- if (isCaseSensitive())
- return;
-
- java.util.HashSet aSet = new java.util.HashSet();
- java.util.Iterator it = getExcludedExtensions().iterator();
- while (it.hasNext()) {
- aSet.add(((String) it.next()).toUpperCase());
- }
- setExcludedExtensionsAsUppercase(aSet);
- }
-
- public boolean isCaseSensitive() {
- return isCaseSensitive;
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 1:24:28 PM)
- *
- * @param newExcludedExtensions
- * java.util.Set
- */
- protected void setExcludedExtensions(java.util.Set newExcludedExtensions) {
- excludedExtensions = newExcludedExtensions;
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 2:42:20 PM)
- *
- * @param newExcludedExtensionsAsUppercase
- * java.util.Set
- */
- protected void setExcludedExtensionsAsUppercase(java.util.Set newExcludedExtensionsAsUppercase) {
- excludedExtensionsAsUppercase = newExcludedExtensionsAsUppercase;
- }
-
- protected void setIsCaseSensitive(boolean value) {
- isCaseSensitive = value;
- }
-
- /**
- * @see com.ibm.etools.archive.SaveFilter
- */
- @Override
- public boolean shouldSave(String uri, Archive anArchive) {
- String extension = org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getFileNameExtension(uri);
- if (extension.equals(""))//$NON-NLS-1$
- return true;
-
- Set excluded;
- if (isCaseSensitive()) {
- excluded = getExcludedExtensions();
- } else {
- excluded = getExcludedExtensionsAsUppercase();
- extension = extension.toUpperCase();
- }
-
- return !excluded.contains(extension);
-
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIterator.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIterator.java
deleted file mode 100644
index 9502b6165..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIterator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.io.InputStream;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-
-
-/**
- * Insert the type's description here. Creation date: (05/02/01 5:20:00 PM)
- *
- * @author: Administrator
- */
-public interface FileIterator {
- public InputStream getInputStream(File aFile) throws java.io.IOException, java.io.FileNotFoundException;
-
- public boolean hasNext();
-
- public File next();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIteratorImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIteratorImpl.java
deleted file mode 100644
index b1f4641e5..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileIteratorImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.io.InputStream;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-
-
-public class FileIteratorImpl implements FileIterator {
- protected List files;
- protected int position = 0;
-
- /**
- * Insert the method's description here. Creation date: (05/02/01 6:16:52 PM)
- */
- public FileIteratorImpl() {
- //Default
- }
-
- public FileIteratorImpl(List theFiles) {
- super();
- files = theFiles;
- }
-
- public InputStream getInputStream(File aFile) throws java.io.IOException, java.io.FileNotFoundException {
- return aFile.getInputStream();
- }
-
- public boolean hasNext() {
- return position < files.size();
- }
-
- public File next() {
- if (!hasNext())
- throw new NoSuchElementException(CommonArchiveResourceHandler.End_of_list_reached_EXC_); // = "End of list reached"
- return (File) files.get(position++);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ManifestPackageEntryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ManifestPackageEntryImpl.java
deleted file mode 100644
index a3ef827a1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ManifestPackageEntryImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-
-/**
- * Used for manifest support.
- */
-public class ManifestPackageEntryImpl extends java.util.jar.Attributes {
- static final String NAME = "Name";//$NON-NLS-1$
- static final String SPECIFICATION_TITLE = "Specification-Title";//$NON-NLS-1$
- static final String SPECIFICATION_VERSION = "Specification-Version";//$NON-NLS-1$
- static final String SPECIFICATION_VENDOR = "Specification-Vendor";//$NON-NLS-1$
- static final String IMPLEMENTATION_TITLE = "Implementation-Title";//$NON-NLS-1$
- static final String IMPLEMENTATION_VERSION = "Implementation-Version";//$NON-NLS-1$
- static final String IMPLEMENTATION_VENDOR = "Implementation-Vendor";//$NON-NLS-1$
-
- /**
- * ManifestPackageEntry constructor comment.
- */
- public ManifestPackageEntryImpl() {
- super();
- }
-
- /**
- * ManifestPackageEntry constructor comment.
- *
- * @param size
- * int
- */
- public ManifestPackageEntryImpl(int size) {
- super(size);
- }
-
- /**
- * ManifestPackageEntry constructor comment.
- *
- * @param attr
- * java.util.jar.Attributes
- */
- public ManifestPackageEntryImpl(java.util.jar.Attributes attr) {
- super(attr);
- }
-
- public String getImplementationTitle() {
- return (String) get(IMPLEMENTATION_TITLE);
- }
-
- public String getImplementationVendor() {
- return (String) get(IMPLEMENTATION_VENDOR);
- }
-
- public String getImplementationVersion() {
- return (String) get(IMPLEMENTATION_VERSION);
- }
-
- public String getName() {
- return (String) get(NAME);
- }
-
- public String getSpecificationTitle() {
- return (String) get(SPECIFICATION_TITLE);
- }
-
- public String getSpecificationVendor() {
- return (String) get(SPECIFICATION_VENDOR);
- }
-
- public String getSpecificationVersion() {
- return (String) get(SPECIFICATION_VERSION);
- }
-
- public void setImplementationTitle(String value) {
- put(IMPLEMENTATION_TITLE, value);
- }
-
- public void setImplementationVendor(String value) {
- put(IMPLEMENTATION_VENDOR, value);
- }
-
- public void setImplementationVersion(String value) {
- put(IMPLEMENTATION_VERSION, value);
- }
-
- public void setName(String value) {
- put(NAME, value);
- }
-
- public void setSpecificationTitle(String value) {
- put(SPECIFICATION_TITLE, value);
- }
-
- public void setSpecificationVendor(String value) {
- put(SPECIFICATION_VENDOR, value);
- }
-
- public void setSpecificationVersion(String value) {
- put(SPECIFICATION_VERSION, value);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/NestedArchiveIterator.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/NestedArchiveIterator.java
deleted file mode 100644
index b42c9672c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/NestedArchiveIterator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-
-
-public class NestedArchiveIterator extends FileIteratorImpl {
- protected ZipInputStream zipInputStream;
- protected ZipEntry currentEntry;
-
- static class WrapperInputStream extends FilterInputStream {
- /**
- * @param in
- */
- public WrapperInputStream(InputStream in) {
- super(in);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.FilterInputStream#close()
- */
- @Override
- public void close() throws IOException {
- //do nothing because we want to prevent the clients from closing the zip
- }
- }
-
- /**
- * NestedArchiveIterator constructor comment.
- */
- public NestedArchiveIterator(List theFiles, ZipInputStream stream) {
- super(theFiles);
- zipInputStream = stream;
- }
-
- @Override
- public InputStream getInputStream(File aFile) throws java.io.IOException, java.io.FileNotFoundException {
- if (!aFile.getURI().equals(currentEntry.getName()))
- throw new java.io.IOException(CommonArchiveResourceHandler.Internal_Error__Iterator_o_EXC_); // = "Internal Error: Iterator out of sync with zip entries"
- return new WrapperInputStream(zipInputStream);
- }
-
- @Override
- public File next() {
- File next = super.next();
- try {
- do {
- currentEntry = zipInputStream.getNextEntry();
- } while (currentEntry.isDirectory());
- } catch (java.io.IOException ex) {
- throw new ArchiveRuntimeException(CommonArchiveResourceHandler.Error_iterating_the_archiv_EXC_, ex); // = "Error iterating the archive"
- }
- return next;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ResourceProxyValidator.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ResourceProxyValidator.java
deleted file mode 100644
index b71ce65bf..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ResourceProxyValidator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jun 11, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * @author cbridgha
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-final class ResourceProxyValidator {
- static HashMap resourceURIMap = new HashMap();
-
- private static void resolveContainedProxies(EObject refObject) {
- List contained = refObject.eContents();
- EObject mofObject;
- for (int i = 0; i < contained.size(); i++) {
- mofObject = (EObject) contained.get(i);
- resolveProxies(mofObject);
- }
- }
-
- private static void resolveNonContainedProxies(EObject refObject) {
- List references = refObject.eClass().getEAllReferences();
- EReference reference;
- EObject proxyOrObject;
- for (int i = 0; i < references.size(); i++) {
- reference = (EReference) references.get(i);
- if (!reference.isContainment() && !reference.isTransient()) {
- if (reference.isMany()) {
- Iterator value = ((List) refObject.eGet(reference)).iterator();
- while (value.hasNext()) {
- proxyOrObject = (EObject) value.next();
- if (proxyOrObject.eIsProxy())
- value.remove();
- }
- } else {
- proxyOrObject = (EObject) refObject.eGet(reference, false);
- if (proxyOrObject != null && proxyOrObject.eIsProxy()) {
- URI resourceURI = ((EObjectImpl) proxyOrObject).eProxyURI().trimFragment();
- String protocol = resourceURI.scheme();
- if (protocol == null || !protocol.equals("java")) { //$NON-NLS-1$
- String id = ((EObjectImpl) proxyOrObject).eProxyURI().fragment();
- if (resourceURIMap.get(resourceURI) != null) {
- Resource cachedResource = (Resource) resourceURIMap.get(resourceURI);
- proxyOrObject = ((XMLResource) cachedResource).getIDToEObjectMap().get(id);
- } else {
- proxyOrObject = (EObject) refObject.eGet(reference);
- resourceURIMap.put(resourceURI, proxyOrObject.eResource());
- }
- if (proxyOrObject == null || proxyOrObject.eIsProxy())
- refObject.eSet(reference, null);
- }
- }
- }
- }
- }
- }
-
- private static void resolveProxies(EObject refObject) {
- if (refObject != null) {
- resolveNonContainedProxies(refObject);
- resolveContainedProxies(refObject);
- }
- }
-
- /**
- * Force all of the proxies with <code>resource</code> to be resolved.
- */
- static void checkForUnresolvableProxies(Resource resource) {
- resourceURIMap = new HashMap(); //Reset hashmap on each call
- if (resource != null) {
- List topLevels = resource.getContents();
- EObject mofObject;
- for (int i = 0; i < topLevels.size(); i++) {
- mofObject = (EObject) topLevels.get(i);
- resolveProxies(mofObject);
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntry.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntry.java
deleted file mode 100644
index 3281c6716..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntry.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-
-public interface RuntimeClasspathEntry {
-
-
- /**
- * The resolved absolute path of the entry
- */
- String getAbsolutePath();
-
- void setAbsolutePath(String absolutePath);
-
- /**
- * A single token from the Class-Path: attrbute
- */
- String getManifestValue();
-
- void setManifestValue(String manifestValue);
-
- /**
- * valid only if this entry is a library in a WARFile, under WEB-INF/lib
- */
- WARFile getWarFile();
-
- void setWarFile(WARFile aWarFile);
-
- /**
- * true if this entry is a library in a WAR file
- */
- boolean isWebLib();
-
- /**
- * The resolved archive inside an EAR that this entry points to; Note that this is NOT the
- * Archive that has the entry in the manifest, but rather the referenced archive/
- */
- Archive getReferencedArchive();
-
- void setReferencedArchive(Archive anArchive);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntryImpl.java
deleted file mode 100644
index 408797ed6..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntryImpl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-
-public class RuntimeClasspathEntryImpl implements RuntimeClasspathEntry {
-
- /** A single token from the Class-Path: attrbute */
- protected String manifestValue;
- /** The resolved absolute path of the entry */
- protected String absolutePath;
- /** valid only if this entry is a library in a WARFile, under WEB-INF/lib */
- protected WARFile warFile;
-
- protected Archive referencedArchive;
-
- /**
- * Constructor for ManifestClasspathEntryImpl.
- */
- public RuntimeClasspathEntryImpl() {
- super();
- }
-
- /**
- * Gets the absolutePath.
- *
- * @return Returns a String
- */
- public String getAbsolutePath() {
- return absolutePath;
- }
-
- /**
- * Sets the absolutePath.
- *
- * @param absolutePath
- * The absolutePath to set
- */
- public void setAbsolutePath(String absolutePath) {
- this.absolutePath = absolutePath;
- }
-
- /**
- * Gets the manifestValue.
- *
- * @return Returns a String
- */
- public String getManifestValue() {
- return manifestValue;
- }
-
- /**
- * Sets the manifestValue.
- *
- * @param manifestValue
- * The manifestValue to set
- */
- public void setManifestValue(String manifestValue) {
- this.manifestValue = manifestValue;
- }
-
-
-
- /**
- * Gets the warFile.
- *
- * @return Returns a WARFile
- */
- public WARFile getWarFile() {
- return warFile;
- }
-
- /**
- * Sets the warFile.
- *
- * @param warFile
- * The warFile to set
- */
- public void setWarFile(WARFile warFile) {
- this.warFile = warFile;
- }
-
- @Override
- public String toString() {
- return getAbsolutePath();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof RuntimeClasspathEntry)
- return getAbsolutePath().equals(((RuntimeClasspathEntry) o).getAbsolutePath());
- return false;
- }
-
- @Override
- public int hashCode() {
- return getAbsolutePath().hashCode();
- }
-
-
- /**
- * @see RuntimeClasspathEntry#isWebLib()
- */
- public boolean isWebLib() {
- return warFile != null;
- }
-
- /**
- * Gets the referencedArchive.
- *
- * @return Returns a Archive
- */
- public Archive getReferencedArchive() {
- return referencedArchive;
- }
-
- /**
- * Sets the referencedArchive.
- *
- * @param referencedArchive
- * The referencedArchive to set
- */
- public void setReferencedArchive(Archive referencedArchive) {
- this.referencedArchive = referencedArchive;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilter.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilter.java
deleted file mode 100644
index 8ee945038..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-
-/**
- * Object used for saving an archive with only a subset of its files. By default all files are
- * saved. Clients can create a custom filter and set it on a save strategy, and call
- * {@link Archive#save(SaveStrategy)}
- */
-public interface SaveFilter {
- /**
- * Answer whether an element in the archive having the uri should be saved; the uri may be for a
- * file, a nested archive, or a loaded mof resource
- */
- public boolean shouldSave(String uri, Archive anArchive);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilterImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilterImpl.java
deleted file mode 100644
index de041ecf4..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilterImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-
-
-
-/**
- * Default filter which allows all elememts to save
- */
-public class SaveFilterImpl implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter {
- /**
- * SaveFilterImpl constructor comment.
- */
- public SaveFilterImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.SaveFilter
- */
- public boolean shouldSave(java.lang.String uri, Archive anArchive) {
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SelectedFilesFilterImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SelectedFilesFilterImpl.java
deleted file mode 100644
index 38c3035a4..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SelectedFilesFilterImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.helpers;
-
-
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-
-
-/**
- * Insert the type's description here. Creation date: (03/23/01 11:04:52 AM)
- *
- * @author: Administrator
- */
-public class SelectedFilesFilterImpl extends SaveFilterImpl {
- /** Set of file uris to be saved */
- protected Set selectedFileNames;
-
- /**
- * SelectedFilesFilterImpl constructor comment.
- */
- public SelectedFilesFilterImpl() {
- super();
- }
-
- /**
- * Constructor with a preselected subset of the files in the archive to be saved; each element
- * in the list must be an instance of {@link com.ibm.etools.commonarchive.File}
- */
- public SelectedFilesFilterImpl(List archiveFiles) {
- super();
- Set fileNames = new HashSet();
- for (int i = 0; i < archiveFiles.size(); i++) {
- File aFile = (File) archiveFiles.get(i);
- fileNames.add(aFile.getURI());
- }
- setSelectedFileNames(fileNames);
- }
-
- /**
- * Parameter must be a set of valid uris in the archive
- */
- public SelectedFilesFilterImpl(Set fileNames) {
- super();
- setSelectedFileNames(fileNames);
- }
-
- /**
- * Insert the method's description here. Creation date: (03/23/01 11:19:01 AM)
- *
- * @return java.util.Set
- */
- public java.util.Set getSelectedFileNames() {
- return selectedFileNames;
- }
-
- /**
- * Insert the method's description here. Creation date: (03/23/01 11:19:01 AM)
- *
- * @param newSelectedFileNames
- * java.util.Set
- */
- public void setSelectedFileNames(java.util.Set newSelectedFileNames) {
- selectedFileNames = newSelectedFileNames;
- }
-
- @Override
- public boolean shouldSave(java.lang.String uri, Archive anArchive) {
- return getSelectedFileNames().contains(uri);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/AltResourceRegister.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/AltResourceRegister.java
deleted file mode 100644
index 253d7a181..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/AltResourceRegister.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-public class AltResourceRegister {
- protected static Set registeredURIs = new HashSet();
-
- protected AltResourceRegister() {
- //Default
- }
-
-
- /**
- * Registers an Archive relative path for the resource which can be copied up as an alt in an
- * EAR file. The uri should be in cananonical form and use the forward slash, eg,
- * "META-INF/vendor-extensions.xmi"
- */
- public static void registerURI(String uri) {
- registeredURIs.add(uri);
- }
-
- public static void deRegisterURI(String uri) {
- registeredURIs.remove(uri);
- }
-
- public static boolean isRegistered(String uri) {
- return registeredURIs.contains(uri);
- }
-
- public static Set getRegisteredURIs() {
- return Collections.unmodifiableSet(registeredURIs);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ApplicationClientFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ApplicationClientFileImpl.java
deleted file mode 100644
index 7a2420774..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ApplicationClientFileImpl.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.client.ClientPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-
-
-/**
- * @generated
- */
-public class ApplicationClientFileImpl extends ModuleFileImpl implements ApplicationClientFile {
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected ApplicationClient deploymentDescriptor = null;
-
- public ApplicationClientFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.APPLICATION_CLIENT_FILE;
- }
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
- public ApplicationClient getDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- ApplicationClient dd = this.getDeploymentDescriptorGen();
- if (dd == null && canLazyInitialize()) {
- try {
- getImportStrategy().importMetaData();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(getDeploymentDescriptorUri(), e);
- }
- }
-
- return this.getDeploymentDescriptorGen();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public java.lang.String getDeploymentDescriptorUri() {
- return J2EEConstants.APP_CLIENT_DD_URI;
- }
-
- /**
- * Return the DeployementDescriptor.
- */
- public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- return getDeploymentDescriptor();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isApplicationClientFile() {
- return true;
- }
-
- @Override
- public boolean isDeploymentDescriptorSet() {
- return deploymentDescriptor != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public org.eclipse.emf.ecore.EObject makeDeploymentDescriptor(XMLResource resource) {
- ApplicationClient aClient = ((ClientPackage) EPackage.Registry.INSTANCE.getEPackage(ClientPackage.eNS_URI)).getClientFactory().createApplicationClient();
- resource.setID(aClient, J2EEConstants.APP_CLIENT_ID);
- setDeploymentDescriptorGen(aClient);
- resource.getContents().add(aClient);
- return aClient;
- }
-
- public void setDeploymentDescriptor(ApplicationClient l) {
- this.setDeploymentDescriptorGen(l);
- replaceRoot(getMofResourceMakeIfNecessary(getDeploymentDescriptorUri()), l);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public ApplicationClient getDeploymentDescriptorGen() {
- if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) {
- InternalEObject oldDeploymentDescriptor = (InternalEObject)deploymentDescriptor;
- deploymentDescriptor = (ApplicationClient)eResolveProxy(oldDeploymentDescriptor);
- if (deploymentDescriptor != oldDeploymentDescriptor) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
- }
- return deploymentDescriptor;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public ApplicationClient basicGetDeploymentDescriptor() {
- return deploymentDescriptor;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDeploymentDescriptorGen(ApplicationClient newDeploymentDescriptor) {
- ApplicationClient oldDeploymentDescriptor = deploymentDescriptor;
- deploymentDescriptor = newDeploymentDescriptor;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR:
- if (resolve) return getDeploymentDescriptor();
- return basicGetDeploymentDescriptor();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((ApplicationClient)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((ApplicationClient)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR:
- return deploymentDescriptor != null;
- }
- return super.eIsSet(featureID);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopySessionUtility.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopySessionUtility.java
deleted file mode 100644
index bb34c5755..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopySessionUtility.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import java.util.List;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.CMPAttribute;
-import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity;
-import org.eclipse.jst.j2ee.ejb.internal.impl.ContainerManagedEntityImpl;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopySession;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-/**
- * OverRide class to use the proper copying of XMLResource doctypes. Had to create this class Due to
- * the way it's handled in the copy commands of EtoolsCopyUtility
- *
- * Creation date: (11/18/01 88888888:48 PM)
- *
- * @author: Jared Jurkiewicz
- */
-public class ArchiveCopySessionUtility extends EtoolsCopySession {
- @Override
- public EObject copy(EObject aRefObject, String idSuffix) {
- EObject copied = super.copy(aRefObject, idSuffix);
- if (copied instanceof ContainerManagedEntity)
- copyPrimKeyInfo((ContainerManagedEntity) aRefObject, (ContainerManagedEntity) copied);
- return copied;
- }
-
- @Override
- public EObject primCopy(EObject aRefObject, String idSuffix) {
- EObject copied = super.primCopy(aRefObject, idSuffix);
- if (copied instanceof ContainerManagedEntity)
- copyPrimKeyInfo((ContainerManagedEntity) aRefObject, (ContainerManagedEntity) copied);
- return copied;
- }
-
- public ArchiveCopySessionUtility(EtoolsCopyUtility aCopyUtility) {
- super(aCopyUtility);
- }
-
- /**
- * @see com.ibm.etools.emf.ecore.utilities.copy.EtoolsCopySession#newInstance(Resource, String)
- */
- @Override
- public Resource newInstance(Resource aResource, String newUri) {
- Resource copyResource = super.newInstance(aResource, newUri);
-
- if (aResource instanceof XMLResource)
- ((XMLResource) copyResource).setVersionID(((XMLResource) aResource).getVersionID());
- return copyResource;
- }
-
- @Override
- public EObject getCopyIfFound(EObject anObject) {
- EObject copiedObject = super.getCopyIfFound(anObject);
- if ((anObject instanceof JavaClass) && (anObject == copiedObject)) {
- copiedObject = newInstance(anObject);
- URI uri = EcoreUtil.getURI(anObject);
- ((InternalEObject) copiedObject).eSetProxyURI(uri);
- }
- return copiedObject;
- }
-
- @Override
- public EObject copyObject(EObject aRefObject, String idSuffix) {
- EObject copied = super.copyObject(aRefObject, idSuffix);
- if (copied instanceof ContainerManagedEntity)
- copyPrimKeyInfo((ContainerManagedEntity) aRefObject, (ContainerManagedEntity) copied);
- return copied;
- }
-
- public void copyPrimKeyInfo(ContainerManagedEntity source, ContainerManagedEntity copied) {
- CMPAttribute primKeyField = source.getPrimKeyField();
- if (primKeyField != null)
- copied.setPrimKeyField(primKeyField);
- }
-
- /*
- * Super class override to handle unresolvable proxies (JavaClass)
- */
-
- @Override
- protected void copyReference(EReference aReference, EObject aRefObject, String idSuffix, EObject copyRef) {
- if (aReference.isMany()) {
- if (shouldCopyReference(aReference, aRefObject)) { // Bugzilla 177397
- List value = (List) aRefObject.eGet(aReference);
- if (value != null)
- copyManyReference(aReference, value, aRefObject, idSuffix, copyRef);
- }
- } else if (aRefObject.eIsSet(aReference)) {
- Object value = aRefObject.eGet(aReference);
- if (value == null)
- value = ((InternalEObject) aRefObject).eGet(aReference, false);
- copySingleReference(aReference, (EObject) value, aRefObject, idSuffix, copyRef);
- }
- }
-
- /**
- * <p>Constant introduced for bugzilla 177397: The name of the CMP 'keyAttributes'
- * attribute, which is not to be copied if in an uninitialized state.</p>
- */
-
- public static final String CMP_KEY_ATTRIBUTES_NAME = "keyAttributes"; //$NON-NLS-1$
-
- /**
- * <p>Test introduced for bugzilla 177397: Tell if a specified reference
- * should be copied. This implementation checks for a CMP Bean, and for
- * the key attributes attribute, and answers false when this attribute
- * is in an uninitialized state.</p>
- *
- * <p>This attribute is initialized using reflection; there are copy cases
- * where the parent EJB Jar does not have its full classpath environment
- * available, which prevents the loading of dependent classes. Since the
- * initialization is lazy, there is no need to resolve this when copying;
- * access to the copy target can perform the initialization.</p>
- *
- * @param aReference The reference attribute being copied.
- * @param aRefObject The model object being copied.
- *
- * @return True if the reference attribute is to be copied.
- * False if the reference attribute is not to be copied.
- */
-
- protected boolean shouldCopyReference(EReference aReference, EObject aRefObject)
- {
- if ( !(aRefObject instanceof ContainerManagedEntityImpl) ||
- !aReference.getName().equals(CMP_KEY_ATTRIBUTES_NAME) )
- return true;
-
- ContainerManagedEntityImpl cmpBean = (ContainerManagedEntityImpl) aRefObject;
-
- return cmpBean.getIsInitializedKeyAttributes();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopyUtility.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopyUtility.java
deleted file mode 100644
index a58eeae95..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopyUtility.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.common.internal.util.Defaultable;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.webapplication.FilterMapping;
-import org.eclipse.wst.common.internal.emf.utilities.CopyGroup;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopySession;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-
-/**
- * Insert the type's description here. Creation date: (12/18/00 6:26:48 PM)
- *
- * @author: Administrator
- */
-public class ArchiveCopyUtility extends EtoolsCopyUtility {
- /**
- * ModuleFileCopyUtiltity constructor comment.
- */
- public ArchiveCopyUtility() {
- super();
- setCopyAdapters(true);
- }
-
- /*
- * End of code pulled from EtoolsCopyUtility to over-ride the primCopy method.
- */
-
- @Override
- protected void addDeferredSingleReferenceCopy(EReference reference, EObject aValue, String idSuffix, EObject aCopyContainer) {
- if (((Defaultable) aValue).isDefault())
- return;
- super.addDeferredSingleReferenceCopy(reference, aValue, idSuffix, aCopyContainer);
- }
-
- public ArchiveManifest copy(ArchiveManifest mf) {
- try {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- mf.write(out);
- InputStream in = new ByteArrayInputStream(out.toByteArray());
- return new ArchiveManifestImpl(in);
- } catch (IOException iox) {
- //This should almost never happen, unless there is an issure with memory allocation
- throw new ArchiveRuntimeException(CommonArchiveResourceHandler.IOException_occurred_while_EXC_, iox); // = "IOException occurred while copying manifest"
- }
- }
-
- public Archive copy(Archive anArchive) {
-
- //First create a copy group and copy util; copy the archive and all its resources
- CopyGroup copyGroup = new CopyGroup();
- copyGroup.setPreserveIds(true);
- prepareResourcesForCopy(anArchive, copyGroup);
- copyGroup.add(anArchive);
- this.copy(copyGroup);
-
- Archive copiedArchive = (Archive) getCopy(anArchive);
-
- finishCopy(anArchive, copiedArchive, copyGroup);
- return copiedArchive;
- }
-
- public ModuleFile copy(ModuleFile aModuleFile) {
- /**
- * Timing issue; if the resources containing the bindings, extensions, and dd have not yet
- * be loaded, force that before the copy occurs; otherwise, they will get loaded as the
- * accessors are invoked during copy. Because they will be loaded but not copied into the
- * new archive's context, then changes will not get saved. By forcing the load before the
- * copy commences, the loaded resources will also be copied to the new archive
- */
- aModuleFile.getStandardDeploymentDescriptor();
-
- /*
- * RLS-8/12/2002 Hack to fix botp defect "141640-failed to install .war file with
- * filter-mapping" The problem is that there is a transient field on the filter mapping
- * class for the servlet name the relationship to the servlet is lazily populated the first
- * time it is requested. If we don't trip it, then it won't get copied.
- */
-
- if (aModuleFile.isWARFile()) {
- List filterMappings = ((WARFile) aModuleFile).getDeploymentDescriptor().getFilterMappings();
- for (int i = 0; i < filterMappings.size(); i++) {
- ((FilterMapping) filterMappings.get(i)).getServlet();
- }
- }
- ModuleFile copied = (ModuleFile) copy((Archive) aModuleFile);
-
- return copied;
- }
-
- /*
- * The following methods were pulled out of EtoolsCopyUtility so we can over-ride the
- * EtoolsCopySession object with our own such that doictypes do get preserved with XML
- * Resources.
- */
- @Override
- public void copy(CopyGroup aGroup) {
- if (aGroup != null) {
- EtoolsCopySession session = new ArchiveCopySessionUtility(this);
- session.setPreserveIds(aGroup.getPreserveIds());
- session.copy(aGroup);
- session.flush();
- }
- }
-
- @Override
- public EObject copy(EObject aRefObject, String idSuffix) {
- EtoolsCopySession session = new ArchiveCopySessionUtility(this);
- EObject copied = session.copy(aRefObject, idSuffix);
- session.flush();
- return copied;
- }
-
- @Override
- public Resource copy(Resource aResource, String newUri) {
- EtoolsCopySession session = new ArchiveCopySessionUtility(this);
- Resource copied = session.copy(aResource, newUri);
- session.flush();
- return copied;
- }
-
- protected void copyImportStrategyIfNecessary(ModuleFile aModuleFile, ModuleFile copy) {
- if (!aModuleFile.isDeploymentDescriptorSet())
- copy.setImportStrategy(aModuleFile.getImportStrategy().createImportStrategy(aModuleFile, copy));
- }
-
- @Override
- public EObject copyObject(EObject aRefObject, String idSuffix) {
- EtoolsCopySession session = new ArchiveCopySessionUtility(this);
- EObject copied = session.copyObject(aRefObject, idSuffix);
- session.flush();
- return copied;
- }
-
- public static void createCopy(CopyGroup aGroup) {
- ArchiveCopyUtility utility = new ArchiveCopyUtility();
- utility.copy(aGroup);
- }
-
- protected void finishCopy(Archive source, Archive copy, CopyGroup group) {
-
- copy.setLoadStrategy(getCommonarchiveFactory().createEmptyLoadStrategy());
- copy.setExtraClasspath(source.getExtraClasspath());
- copy.setXmlEncoding(source.getXmlEncoding());
- if (source.isManifestSet()) {
- copy.setManifest(copy(source.getManifest()));
- } else {
- try {
- File manifestToCopy = source.getFile(J2EEConstants.MANIFEST_URI);
- if (manifestToCopy != null) {
- File copiedManifest = (File) getCopy(manifestToCopy);
- copiedManifest.setLoadingContainer(manifestToCopy.getLoadingContainer());
- copy.addCopy(copiedManifest);
- }
- } catch (FileNotFoundException e) {
- //Ignore
- } catch (DuplicateObjectException e) {
- //Ignore
- }
- }
- retrieveResourcesFromCopy(copy, group);
-
- if (source.isModuleFile())
- copyImportStrategyIfNecessary((ModuleFile) source, (ModuleFile) copy);
-
- List files = source.getFiles();
- for (int i = 0; i < files.size(); i++) {
- File aFile = (File) files.get(i);
- File copiedFile = (File) getCopy(aFile);
- copiedFile.setLoadingContainer(aFile.getLoadingContainer());
- if (aFile.isArchive())
- finishNestedCopy((Archive) aFile, (Archive) copiedFile);
- }
- //Notification was suspended during copy; therefore we need to make sure the files
- //In the archive get indexed
- copy.rebuildFileIndex();
- }
-
- protected void finishNestedCopy(Archive source, Archive copy) {
-
- CopyGroup group = new CopyGroup();
- prepareResourcesForCopy(source, group);
- copy(group);
- finishCopy(source, copy, group);
- }
-
- private CommonarchiveFactory getCommonarchiveFactory() {
- return CommonarchivePackage.eINSTANCE.getCommonarchiveFactory();
- }
-
- protected void prepareResourcesForCopy(Archive anArchive, CopyGroup copyGroup) {
- Iterator iter = anArchive.getLoadedMofResources().iterator();
- while (iter.hasNext()) {
- Resource resource = (Resource) iter.next();
- if (!ArchiveUtil.isJavaResource(resource))
- copyGroup.add(resource);
- }
- }
-
- protected void retrieveResourcesFromCopy(Archive copiedArchive, CopyGroup copyGroup) {
-
- List resources = copyGroup.getCopiedResources();
- for (int i = 0; i < resources.size(); i++) {
- Resource copiedResource = (Resource) resources.get(i);
- copiedArchive.addOrReplaceMofResource(copiedResource);
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveImpl.java
deleted file mode 100644
index 596d663c4..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveImpl.java
+++ /dev/null
@@ -1,1491 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jem.internal.java.adapters.ReadAdaptor;
-import org.eclipse.jem.internal.java.adapters.jdk.JavaJDKAdapterFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ArchiveTypeDiscriminatorRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ManifestException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ReopenException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntryImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectorySaveStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipStreamSaveStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveFileDynamicClassLoader;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ClasspathUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil;
-
-
-/**
- * @generated
- */
-public class ArchiveImpl extends ContainerImpl implements Archive {
-
- /**
- * The cached value of the '{@link #getTypes() <em>Types</em>}' attribute list. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getTypes()
- * @generated
- * @ordered
- */
- protected EList types = null;
-
- /** Our specialized manifest */
- protected ArchiveManifest manifest;
-
- /** Implementer for saving this archive */
- protected SaveStrategy saveStrategy;
-
- /**
- * Optional filter for saving a subset of files; filter will be applied for all save and extract
- * invokations
- */
- protected SaveFilter saveFilter;
-
- /** Encoding to be used for all xmi resources and xml dds; defaults to UTF-8 */
- protected String xmlEncoding = J2EEConstants.DEFAULT_XML_ENCODING;
-
- /** Custom class loader used to load classes from the archive */
- protected ClassLoader archiveClassLoader;
-
- /**
- * path of the standard classpath format where the archive may look for classes not found in the
- * system classpath or in the archive - used for java reflection
- */
- protected String extraClasspath;
-
- protected ArchiveOptions options;
-
- public ArchiveImpl() {
- super();
- getCommonArchiveFactory().archiveOpened(this);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.ARCHIVE;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EList getTypes() {
- if (types == null) {
- types = new EDataTypeUniqueEList(String.class, this, CommonarchivePackage.ARCHIVE__TYPES);
- }
- return types;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.ARCHIVE__TYPES:
- return getTypes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.ARCHIVE__TYPES:
- getTypes().clear();
- getTypes().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.ARCHIVE__TYPES:
- getTypes().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.ARCHIVE__TYPES:
- return types != null && !types.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (types: "); //$NON-NLS-1$
- result.append(types);
- result.append(')');
- return result.toString();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public Archive addCopy(Archive anArchive) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException {
- checkAddValid(anArchive);
- Archive copy = getCommonArchiveFactory().copy(anArchive);
- getFiles().add(copy);
- return copy;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive Adds a copy of the parameter to this archive
- * @throws com.ibm.etools.archive.exception.DuplicateObjectException
- * if the archive already contains a file with the specified uri
- */
- public File addCopy(File aFile) throws DuplicateObjectException {
- if (aFile.isReadOnlyDirectory()) {
- addCopy((ReadOnlyDirectory) aFile);
- return null;
- }
- checkAddValid(aFile);
- File copy = copy(aFile);
- getFiles().add(copy);
- return copy;
- }
-
- /**
- * Get a flattened list from the directory, then addCopy the list
- *
- * @throws com.ibm.etools.archive.exception.DuplicateObjectException
- * if a file with a uri that equals one of the nested files in the directory exists
- *
- * @return java.util.List the copied files that were added to the archive
- */
- public java.util.List addCopy(ReadOnlyDirectory dir) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException {
- return addCopyFiles(dir.getFilesRecursive());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public List addCopyFiles(java.util.List list) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException {
- //Optimization - make sure the fileIndex is already built to speed up
- // containsFile
- getFiles();
- List copyList = new ArrayList();
- for (int i = 0; i < list.size(); i++) {
- File aFile = (File) list.get(i);
- checkAddValid(aFile);
- copyList.add(copy(aFile));
- }
- getFiles().addAll(copyList);
- return copyList;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void addOrReplaceMofResource(org.eclipse.emf.ecore.resource.Resource aResource) {
- getLoadStrategy().addOrReplaceMofResource(aResource);
- }
-
- /**
- * @deprecated Use {@link #getDependentOpenArchives()}
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean canClose() {
- return !getCommonArchiveFactory().getOpenArchivesDependingOn(this).isEmpty();
- }
-
- protected void checkAddValid(File aFile) throws DuplicateObjectException {
- checkAddValid(aFile.getURI());
- }
-
- protected void checkAddValid(String aUri) throws DuplicateObjectException {
- try {
- File f = getFile(aUri);
- if (f != null)
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.duplicate_file_EXC_, (new Object[]{getURI(), aUri})), f); // = "The archive named {0} already contains a file named {1}"
- } catch (FileNotFoundException ok) {
- //Ignore
- }
- }
-
- protected void cleanupAfterTempSave(String aUri, java.io.File original, java.io.File destinationFile) throws SaveFailureException {
-
- checkWriteable(original);
- boolean deleteWorked = false;
- if (original.isDirectory() && !isRenameable(original)) {
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.unable_replace_EXC_, (new Object[]{original.getAbsolutePath()}))); // = "Unable to replace original archive "
- }
-
- for (int i = 0; i < 10; i++) {
- if (ArchiveUtil.delete(original)) {
- deleteWorked = true;
- break;
- }
- try {
- // TODO Major hack here; the problem is that a previous call
- // to close the source file may not yet have
- //been reflected in the os/vm; therefore a subsequent call
- // to delete fails. To get around this,
- //wait for a bit and retry; if it continues to fail, then
- // time out and throw an exception
- Thread.sleep(250);
- } catch (InterruptedException e) {
- //Ignore
- }
- }
- if (deleteWorked) {
- for (int i = 0; i < 10; i++) {
- if (destinationFile.renameTo(original))
- return;
- try {
- Thread.sleep(250);
- } catch (InterruptedException e) {
- //Ignore
- }
- }
- }
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.unable_replace_EXC_, (new Object[]{original.getAbsolutePath()}))); // = "Unable to replace original archive "
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void close() {
- getLoadStrategy().close();
- releaseClassLoader();
- getCommonArchiveFactory().archiveClosed(this);
- if (isIndexed()) {
- List archives = getArchiveFiles();
- for (int i = 0; i < archives.size(); i++) {
- ((Archive) archives.get(i)).close();
- }
- }
- }
-
- protected File copy(File aFile) {
- File copy = null;
- if (aFile.isArchive())
- copy = getCommonArchiveFactory().copy((Archive) aFile);
- else
- copy = (File) EtoolsCopyUtility.createCopy(aFile);
- return copy;
- }
-
- protected LoadStrategy createLoadStrategyForReopen(Archive parent) throws IOException {
- LoadStrategy aLoadStrategy = null;
- LooseArchive loose = getLoadStrategy().getLooseArchive();
-
- if (loose != null) {
- aLoadStrategy = getCommonArchiveFactory().createLoadStrategy(loose.getBinariesPath());
- aLoadStrategy.setLooseArchive(loose);
- } else if (parent == null)
- aLoadStrategy = getCommonArchiveFactory().createLoadStrategy(getURI());
- else
- aLoadStrategy = getCommonArchiveFactory().createChildLoadStrategy(getURI(), parent.getLoadStrategy());
-
- return aLoadStrategy;
- }
-
- protected RuntimeClasspathEntry createRuntimeClasspathEntry(String absolutePath) {
- RuntimeClasspathEntry entry = new RuntimeClasspathEntryImpl();
- entry.setAbsolutePath(absolutePath);
- return entry;
- }
-
- /**
- * Convert all the classpath entries to absolute paths
- */
- protected List createRuntimeClasspathEntries(String[] entries, String parentPath) {
-
- List aList = new ArrayList(entries.length);
- for (int i = 0; i < entries.length; i++) {
- String entry = entries[i];
- /*
- * Added for loose module support - if the cananonicalized entry resolves to an archive
- * in the containing ear, then add the absolute path of that archive
- */
- Archive dependentJar = resolveClasspathEntryInEAR(entry);
- if (dependentJar != null) {
- try {
- RuntimeClasspathEntry runEntry = createRuntimeClasspathEntry(dependentJar.getBinariesPath(), entry);
- runEntry.setReferencedArchive(dependentJar);
- aList.add(runEntry);
- continue;
- } catch (FileNotFoundException shouldntHappenInRuntime) {
- //Ignore
- }
- }
- //Otherwise, compute the absolute path of the entry relative to
- // this jar
- java.io.File aFile = new java.io.File(entry);
- String absPath = null;
- if (aFile.isAbsolute())
- absPath = aFile.getAbsolutePath();
- else {
- absPath = ArchiveUtil.getOSUri(parentPath, entry);
- absPath = ClasspathUtil.normalizePath(absPath);
- }
- aList.add(createRuntimeClasspathEntry(absPath, entry));
- }
-
- return aList;
- }
-
- protected RuntimeClasspathEntry createRuntimeClasspathEntry(String absolutePath, String manifestValue) {
- RuntimeClasspathEntry entry = createRuntimeClasspathEntry(absolutePath);
- entry.setManifestValue(manifestValue);
- return entry;
- }
-
- protected SaveStrategy createSaveStrategyForDirectory(java.io.File dir, int expansionFlags) {
- return new DirectorySaveStrategyImpl(dir.getAbsolutePath(), expansionFlags);
- }
-
- protected SaveStrategy createSaveStrategyForDirectory(String aUri, int expansionFlags) {
- return new DirectorySaveStrategyImpl(aUri, expansionFlags);
- }
-
- protected SaveStrategy createSaveStrategyForJar(java.io.File aFile) throws java.io.IOException {
- if (aFile.exists() && aFile.isDirectory())
- throw new IOException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_exist_as_dir_EXC_, (new Object[]{aFile.getAbsolutePath()})));// = "A file named {0} exists and is a directory"
- java.io.File parent = aFile.getParentFile();
- if (parent != null)
- parent.mkdirs();
- java.io.OutputStream out = new java.io.FileOutputStream(aFile);
- return new ZipStreamSaveStrategyImpl(out);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void extract(int expansionFlags) throws SaveFailureException, ReopenException {
- extractNoReopen(expansionFlags);
- reopen();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void extractNoReopen(int expansionFlags) throws SaveFailureException {
- String aUri = getURI();
- java.io.File aDir = new java.io.File(aUri);
- boolean inUse = getLoadStrategy().isUsing(aDir);
-
- try {
- java.io.File destinationDir = inUse ? ArchiveUtil.createTempDirectory(aUri, aDir.getCanonicalFile().getParentFile()) : aDir;
- SaveStrategy aSaveStrategy = createSaveStrategyForDirectory(destinationDir, expansionFlags);
- save(aSaveStrategy);
- aSaveStrategy.close();
- close();
- if (inUse) {
- cleanupAfterTempSave(aUri, aDir, destinationDir);
- }
- } catch (java.io.IOException ex) {
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.error_saving_EXC_, (new Object[]{uri})), ex); // = "Error saving "
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void extractTo(java.lang.String aUri, int expansionFlags) throws SaveFailureException {
- java.io.File aDir = new java.io.File(aUri);
- if (getLoadStrategy().isUsing(aDir))
- throw new SaveFailureException(CommonArchiveResourceHandler.Extract_destination_is_the_EXC_); // = "Extract destination is the same path as source file"
-
- try {
- SaveStrategy aSaveStrategy = createSaveStrategyForDirectory(aDir, expansionFlags);
- save(aSaveStrategy);
- aSaveStrategy.close();
- } catch (java.io.IOException ex) {
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.error_saving_EXC_, (new Object[]{aUri})), ex); // = "Error saving "
- }
-
- }
-
- public java.util.List filterFilesByPrefix(String prefix) {
- return filterFiles(prefix, null);
- }
-
- public java.util.List filterFiles(String prefix, String[] suffixes) {
- List subset = new ArrayList();
- List theFiles = getFiles();
- for (int i = 0; i < theFiles.size(); i++) {
- File aFile = (File) theFiles.get(i);
- if (!aFile.isDirectoryEntry() && aFile.getURI().startsWith(prefix))
- if (suffixes == null || hasSuffix(aFile.getURI(), suffixes))
- subset.add(aFile);
- }
- return subset;
- }
-
- /**
- * @param uri
- * @param suffixes
- * @return
- */
- private boolean hasSuffix(String aUri, String[] suffixes) {
- for (int i = 0; i < suffixes.length; i++) {
- if (aUri.endsWith(suffixes[i]))
- return true;
- }
- return false;
- }
-
- public java.util.List filterFilesWithoutPrefix(String[] prefixes) {
- List subset = new ArrayList();
- List theFiles = getFiles();
- for (int i = 0; i < theFiles.size(); i++) {
- File aFile = (File) theFiles.get(i);
- if (aFile.isDirectoryEntry())
- continue;
- boolean shouldAdd = true;
- for (int j = 0; j < prefixes.length; j++) {
- if (aFile.getURI().startsWith(prefixes[j])) {
- shouldAdd = false;
- break;
- }
- }
- if (shouldAdd)
- subset.add(aFile);
- }
- return subset;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.ClassLoader
- */
- public java.lang.ClassLoader getArchiveClassLoader() {
- if (archiveClassLoader == null)
- initializeClassLoader();
- return archiveClassLoader;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public java.util.List getArchiveFiles() {
- List archives = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isArchive()) {
- archives.add(aFile);
- }
- }
- return archives;
- }
-
- /**
- * Parse the manifest class path and the extra class path, and instantiate a URL classloader,
- * with a parent of the archiveClassLoader
- */
- protected ClassLoader getClassPathClassLoader(ClassLoader parentCl) {
-
- List classPathComponents = new ArrayList();
- if (getManifest() != null)
- classPathComponents.addAll(Arrays.asList(getManifest().getClassPathTokenized()));
- String extraCp = getExtraClasspath();
- if (extraCp != null)
- classPathComponents.addAll(Arrays.asList(ArchiveUtil.getTokens(extraCp, ";")));//$NON-NLS-1$
-
- java.net.URL[] urlArray = ArchiveUtil.toLocalURLs(classPathComponents, getRootForRelativeDependentJars());
- return new java.net.URLClassLoader(urlArray, parentCl);
- }
-
- public ResourceSet getResourceSet() {
- return getLoadStrategy().getResourceSet();
- }
-
- /**
- * Helper method to determine the parent for the custom class loader used by this archive
- */
- protected ClassLoader getDefaultClassLoader() {
- ClassLoader pluginClassLoader = getClass().getClassLoader();
- return pluginClassLoader == null ? ClassLoader.getSystemClassLoader() : pluginClassLoader;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public java.util.Set getDependentOpenArchives() {
- return getCommonArchiveFactory().getOpenArchivesDependingOn(this);
- }
-
- /**
- * Convert all the classpath entries to absolute paths
- */
- protected List getEntriesAsAbsolutePaths(String[] entries, String parentPath) {
-
- List aList = new ArrayList(entries.length);
- for (int i = 0; i < entries.length; i++) {
- String entry = entries[i];
- /*
- * Added for loose module support - if the cananonicalized entry resolves to an archive
- * in the containing ear, then add the absolute path of that archive
- */
- Archive dependentJar = resolveClasspathEntryInEAR(entry);
- if (dependentJar != null) {
- try {
- aList.add(dependentJar.getAbsolutePath());
- continue;
- } catch (FileNotFoundException shouldntHappenInRuntime) {
- //Ignore
- }
- }
- //Otherwise, compute the absolute path of the entry relative to
- // this jar
- java.io.File aFile = new java.io.File(entry);
- if (aFile.isAbsolute())
- aList.add(aFile.getAbsolutePath());
- else
- aList.add(ArchiveUtil.getOSUri(parentPath, entry));
- }
-
- return aList;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.String
- */
- public String getExtraClasspath() {
- return extraClasspath;
- }
-
- /**
- * Used internally by the framework, specifically as an optimization when saving/exploding
- * archives with nested archives
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator getFilesForSave() throws IOException {
- return getLoadStrategy().getFileIterator();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public java.io.InputStream getInputStream() throws java.io.FileNotFoundException, java.io.IOException {
- if (getLoadingContainer() != null || getLoadStrategy() == null || getLoadStrategy().isDirectory())
- return super.getInputStream();
-
- //This archive was copied in; this operation is not supported for
- // module files
- if (isModuleFile() || !getOptions().isSaveLibrariesAsFiles())
- throw new IOException("Undefined state of nested archive"); //$NON-NLS-1$
-
- //We have to find the absolute path of the original archive from which
- // this was copied,
- //if it is known
-
- List list = getFiles();
-
- String absolutePath = null;
- for (int i = 0; i < list.size(); i++) {
- File aFile = (File) list.get(i);
- if (aFile.isArchive())
- continue;
- absolutePath = aFile.getLoadingContainer().getAbsolutePath();
- }
-
- return new FileInputStream(absolutePath);
- }
-
- /**
- * @see LoadStrategy#getResourceInputStream(String)
- */
- public InputStream getResourceInputStream(String aUri) throws IOException {
- return getLoadStrategy().getResourceInputStream(aUri);
- }
-
- protected JavaJDKAdapterFactory getJavaAdapterFactory() {
- return (JavaJDKAdapterFactory) EcoreUtil.getAdapterFactory(getLoadStrategy().getResourceSet().getAdapterFactories(), ReadAdaptor.TYPE_KEY);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive returns an immutable collection of the loaded
- * resources in the resource set
- */
- public Collection getLoadedMofResources() {
- return getLoadStrategy().getLoadedMofResources();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- */
- public ArchiveManifest getManifest() {
- if (manifest == null) {
- InputStream in = null;
- try {
- in = getInputStream(J2EEConstants.MANIFEST_URI);
- makeManifest(in);
- } catch (FileNotFoundException ex) {
- makeManifest();
- } catch (Resource.IOWrappedException ex) {
- WrappedException wrapEx = new WrappedException((ex).getWrappedException());
- if (ExtendedEcoreUtil.getFileNotFoundDetector().isFileNotFound(wrapEx))
- makeManifest();
- else
- throw new ManifestException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.io_ex_manifest_EXC_, (new Object[]{getURI()})), ex); // = "An IOException occurred reading the manifest: "
- } catch (IOException ex) {
- throw new ManifestException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.io_ex_manifest_EXC_, (new Object[]{getURI()})), ex); // = "An IOException occurred reading the manifest: "
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (IOException iox) {
- //Ignore
- }
- }
- }
- //This is a hack because of the fact that the manifest does not
- // serialize correctly if
- //The version is not set. In addition to saves, the serialization is
- // used for copy
- if (manifest.getManifestVersion() == null || manifest.getManifestVersion().equals("")) //$NON-NLS-1$
- manifest.setManifestVersion("1.0");//$NON-NLS-1$
- return manifest;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public org.eclipse.emf.ecore.resource.Resource getMofResource(java.lang.String aUri) throws FileNotFoundException, ResourceLoadException {
- return getLoadStrategy().getMofResource(aUri);
- }
-
- protected Resource getMofResourceMakeIfNecessary(String aUri) {
- if (getLoadStrategy() == null)
- return null;
- Resource resource = null;
- try {
- resource = getMofResource(aUri);
- } catch (java.io.FileNotFoundException ex) {
- try {
- resource = makeMofResource(aUri);
- } catch (DuplicateObjectException dox) {
- //We just checked for this; it won't happen
- }
- }
- return resource;
- }
-
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions getOptions() {
- if (options == null) {
- options = new ArchiveOptions();
- }
- return options;
- }
-
- /**
- * When looking at the class path of this jar (from the manifest), some of the elements may have
- * a relative path, thus we need to determine the install location of this jar. If the absolute
- * path from which the archive was loaded, return the parent directory of that path; otherwise,
- * see if the containing archive has an absolute path; if neither work, default to the current
- * working directory
- */
- public String getRootForRelativeDependentJars() {
- String path = null;
- Container theContainer = this;
- while (theContainer != null && path == null) {
- try {
- path = theContainer.getAbsolutePath();
- } catch (FileNotFoundException ex) {
- //Ignore
- }
- theContainer = theContainer.getLoadingContainer();
- }
- if (path == null) {
- path = System.getProperty("user.dir");//$NON-NLS-1$
- if (path == null)
- //At this point what else can we do?
- return "";//$NON-NLS-1$
- return new java.io.File(path).getAbsolutePath();
- }
- return new java.io.File(path).getParentFile().getAbsolutePath();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public java.lang.String[] getRuntimeClassPath() {
-
- String absolutePath;
- try {
- absolutePath = getBinariesPath();
- } catch (IOException ex) {
- return new String[0];
- }
-
- List entries = new ArrayList();
- entries.add(absolutePath);
-
- String parentPath = new java.io.File(absolutePath).getParentFile().getAbsolutePath();
- String[] mfEntries = getManifest().getClassPathTokenized();
- entries.addAll(getEntriesAsAbsolutePaths(mfEntries, parentPath));
-
- return (String[]) entries.toArray(new String[entries.size()]);
- }
-
- /**
- * Optional filter for saving a subset of files; filter will be applied for all save and extract
- * invokations
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter getSaveFilter() {
- return saveFilter;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/04/00 3:31:32 PM)
- *
- * @return com.ibm.etools.archive.SaveStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy getSaveStrategy() {
- return saveStrategy;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return java.lang.String
- */
- public java.lang.String getXmlEncoding() {
- return xmlEncoding;
- }
-
- /**
- * The default is to do nothing; subclasses may override as necessary
- *
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void initializeAfterOpen() {
- //Default
- }
-
- public void initializeClassLoader() {
- //Some load strategies may provide a mof context for which
- //an alternate class loader is not necessary
- if (!shouldUseJavaReflection())
- return;
- ClassLoader extraCl = null;
- ClassLoader defaultCl = getDefaultClassLoader();
- if (getContainer() == null || !getContainer().isEARFile())
- extraCl = getClassPathClassLoader(defaultCl);
- ClassLoader cl = createDynamicClassLoader(defaultCl, extraCl);
- setArchiveClassLoader(cl);
- JavaJDKAdapterFactory factory = getJavaAdapterFactory();
- factory.setContextClassLoader(cl);
- factory.flushAll();
- }
-
- public ClassLoader createDynamicClassLoader(ClassLoader parentCl, ClassLoader extraCl) {
- return new ArchiveFileDynamicClassLoader(this, parentCl, extraCl);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isArchive() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean isDuplicate(java.lang.String aUri) {
- return containsFile(aUri) || isMofResourceLoaded(aUri) || J2EEConstants.MANIFEST_URI.equals(aUri);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean isManifestSet() {
- return manifest != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean isMofResourceLoaded(java.lang.String aUri) {
- return getLoadStrategy().isMofResourceLoaded(aUri);
- }
-
- /**
- * By default just test the extension of the uri for one of the known archive types; subclasses
- * may which to override.
- *
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean isNestedArchive(java.lang.String aUri) {
- //110390.3 Error loading alt-bindings
- /*
- * Don't infer that a folder which ends with .jar is an exploded archive; EAR file will do
- * that IF the folder is declared as a module in the EAR
- */
- if (getLoadStrategy().isDirectory()) {
- try {
- String path = ArchiveUtil.getOSUri(getAbsolutePath(), aUri);
- java.io.File ioFile = new java.io.File(path);
- if (!ioFile.exists() || (ioFile.isDirectory() && aUri.startsWith(J2EEConstants.ALT_INF)))
- return false;
- } catch (IOException ex) {
- return false;
- }
- }
- return ArchiveTypeDiscriminatorRegistry.INSTANCE.isKnownArchiveType(aUri);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean isOpen() {
- return getLoadStrategy() != null && getLoadStrategy().isOpen();
- }
-
- public ArchiveManifest makeManifest() {
- ArchiveManifest mf = new ArchiveManifestImpl();
- setManifest(mf);
- return mf;
- }
-
- public ArchiveManifest makeManifest(InputStream in) throws IOException {
- ArchiveManifest mf = new ArchiveManifestImpl(in);
- setManifest(mf);
- return mf;
- }
-
- public Resource makeMofResource(String aUri) throws DuplicateObjectException {
- return makeMofResource(aUri, null);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive#makeMofResource(String, EList)
- */
- public Resource makeMofResource(String aUri, EList extent) throws DuplicateObjectException {
- if (isDuplicate(aUri))
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.duplicate_entry_EXC_, (new Object[]{aUri, getURI()}))); // = "A file or resource with uri {0} already exists in the archive named {1}"
- return getLoadStrategy().makeMofResource(aUri, extent);
- }
-
- /**
- * @see Archive
- */
- public Archive openNestedArchive(String aUri) throws OpenFailureException {
- return getCommonArchiveFactory().openNestedArchive(aUri, this);
- }
-
- /**
- * @see Archive
- */
- public Archive openNestedArchive(LooseArchive loose) throws OpenFailureException {
- return getCommonArchiveFactory().openNestedArchive(loose, this);
- }
-
- /**
- * Set the value of the extra class path with no refresh of the class loader
- */
- public void primSetExtraClasspath(java.lang.String newExtraClasspath) {
- extraClasspath = newExtraClasspath;
- }
-
- /**
- * Remove references to the archive class loader to prevent gc problems or problems with temp
- * files not getting deleted
- */
- public void releaseClassLoader() {
- if (archiveClassLoader != null) {
- setArchiveClassLoader(null);
- getJavaAdapterFactory().setContextClassLoader(null);
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void remove(File aFile) {
- getFiles().remove(aFile);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void reopen() throws ReopenException {
- reopen(null);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void reopen(Archive parent) throws ReopenException {
- LoadStrategy aLoadStrategy = null;
- try {
- aLoadStrategy = createLoadStrategyForReopen(parent);
- } catch (IOException ex) {
- throw new ReopenException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.io_ex_reopen_EXC_, (new Object[]{getURI()})), ex); // = "IOException occurred while reopening "
- }
- //PQ54572
- LoadStrategy current = getLoadStrategy();
- if (current != null) {
- aLoadStrategy.setResourceSet(current.primGetResourceSet());
- /*
- * fixing problem with orphaned load strategy listening to the resource set
- */
- current.setResourceSet(null);
- }
-
- setLoadStrategy(aLoadStrategy);
- initializeClassLoader();
- if (!isIndexed())
- return;
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File f = (File) fileList.get(i);
- f.setOriginalURI(f.getURI());
- f.setLoadingContainer(this);
- if (f.isArchive())
- ((Archive) f).reopen(this);
- }
- getCommonArchiveFactory().archiveOpened(this);
- }
-
- protected void replaceRoot(Resource aResource, EObject root) {
- if (aResource == null)
- return;
- EList extent = aResource.getContents();
- EObject existingRoot = null;
- if (!extent.isEmpty()) {
- existingRoot = (EObject) extent.get(0);
- if (existingRoot == root)
- return;
- extent.remove(0);
- }
- if (root != null)
- extent.add(0, root);
- }
-
- protected Archive resolveClasspathEntryInEAR(String entry) {
- /*
- * Added to support runtime classpath for loose modules
- */
- Container parent = getContainer();
- if (parent == null || !parent.isEARFile())
- return null;
-
- String aUri = ArchiveUtil.deriveEARRelativeURI(entry, this);
- if (aUri == null)
- return null;
-
- File aFile = null;
- try {
- aFile = parent.getFile(aUri);
- } catch (FileNotFoundException ex) {
- return null;
- }
-
- return aFile.isArchive() ? (Archive) aFile : null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void save() throws SaveFailureException, ReopenException {
- saveAs(getURI());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy aStrategy) throws SaveFailureException {
- setSaveStrategy(aStrategy);
- SaveFilter existingFilter = aStrategy.getFilter();
- boolean oldDelivery = eDeliver();
- try {
- if (getOptions().isReadOnly())
- eSetDeliver(false);
- aStrategy.setFilter(getSaveFilter());
- aStrategy.save();
- try {
- aStrategy.finish();
- } catch (java.io.IOException iox) {
- throw new SaveFailureException(getURI(), iox);
- }
- } finally {
- //We have to leave the file index if we are a directory because we
- // might have
- //open file handles to archives
- if (getOptions().isReadOnly() && !getLoadStrategy().isDirectory()) {
- files.clear();
- //((BasicEList)files).setListImplementation(new ArrayList(0));
- eSetDeliver(oldDelivery);
- eAdapters().remove(getFileIndexAdapter());
- fileIndexAdapter = null;
- fileIndex = null;
- }
- setSaveStrategy(null);
- aStrategy.setFilter(existingFilter);
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void saveAs(String aUri) throws SaveFailureException, ReopenException {
- saveAsNoReopen(aUri);
- reopen();
- }
-
- /**
- * If we can rename it then we can delete it
- */
- protected boolean isRenameable(java.io.File orig) {
- java.io.File origCopy1 = null;
- java.io.File origCopy2 = null;
- try {
- origCopy1 = orig.getCanonicalFile();
- origCopy2 = orig.getCanonicalFile();
- } catch (java.io.IOException ex) {
- return false;
- }
- String name = null;
- String baseName = "save.tmp"; //$NON-NLS-1$
- try {
- if (orig.getParent() != null)
- baseName = new java.io.File(orig.getParent(), baseName).getCanonicalPath();
- } catch (java.io.IOException ex) {
- return false;
- }
-
- java.io.File temp = null;
- int index = 0;
- do {
- name = baseName + index;
- temp = new java.io.File(name);
- index++;
- } while (temp.exists());
- return origCopy1.renameTo(temp) && temp.renameTo(origCopy2);
- }
-
- protected void checkWriteable(java.io.File dest) throws SaveFailureException {
- List locked = ArchiveUtil.getWriteProtectedFiles(dest, null);
- if (locked.isEmpty())
- return;
-
- StringBuffer msg = new StringBuffer();
- msg.append("Cannot write to file: "); //$NON-NLS-1$
- msg.append(dest.getAbsolutePath());
- msg.append('\n');
- msg.append("One or more files is write protected or locked:"); //$NON-NLS-1$
- msg.append('\n');
- for (int i = 0; i < locked.size(); i++) {
- java.io.File aFile = (java.io.File) locked.get(i);
- msg.append(aFile.getAbsolutePath());
- msg.append('\n');
- }
- throw new SaveFailureException(msg.toString());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void saveAsNoReopen(String aUri) throws SaveFailureException {
- java.io.File aFile = new java.io.File(aUri);
- checkWriteable(aFile);
- boolean fileExisted = aFile.exists();
- //botp 142149
- //boolean inUse = getLoadStrategy().isUsing(aFile);
- SaveStrategy aSaveStrategy = null;
- try {
- try {
- java.io.File destinationFile = fileExisted ? ArchiveUtil.createTempFile(aUri, aFile.getCanonicalFile().getParentFile()) : aFile;
- aSaveStrategy = createSaveStrategyForJar(destinationFile);
- save(aSaveStrategy);
- aSaveStrategy.close();
- this.close();
- if (fileExisted) {
- cleanupAfterTempSave(aUri, aFile, destinationFile);
- }
- } catch (java.io.IOException ex) {
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.error_saving_EXC_, (new Object[]{aUri})), ex); // = "Error saving "
- }
- } catch (SaveFailureException failure) {
- try {
- if (aSaveStrategy != null)
- aSaveStrategy.close();
- } catch (IOException weTried) {
- //Ignore
- }
- if (!fileExisted)
- aFile.delete();
- throw failure;
- }
-
- setURI(aUri);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void saveNoReopen() throws SaveFailureException {
- saveAsNoReopen(getURI());
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newArchiveClassLoader
- * java.lang.ClassLoader
- */
- public void setArchiveClassLoader(java.lang.ClassLoader newArchiveClassLoader) {
- archiveClassLoader = newArchiveClassLoader;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newExtraClasspath
- * java.lang.String
- */
- public void setExtraClasspath(java.lang.String newExtraClasspath) {
- primSetExtraClasspath(newExtraClasspath);
- //Optimization - only re init if a cl exists; otherwise it will init on
- // demand
- if (archiveClassLoader != null)
- initializeClassLoader();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- */
- public void setManifest(ArchiveManifest newManifest) {
- manifest = newManifest;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void setManifest(java.util.jar.Manifest aManifest) {
- setManifest((ArchiveManifest) new org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl(aManifest));
- }
-
- /**
- * Sets the Class-path manifest entry, rebuilds the class loader, and refreshes any reflected
- * java classes
- */
- public void setManifestClassPathAndRefresh(String classpath) {
- ArchiveManifest mf = getManifest();
- if (manifest == null) {
- makeManifest();
- }
- mf.setClassPath(classpath);
- //Optimization - only re init if a cl exists; otherwise it will init on
- // demand
- if (archiveClassLoader != null)
- initializeClassLoader();
- }
-
- public void setOptions(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions newOptions) {
- options = newOptions;
- }
-
- /**
- * Optional filter for saving a subset of files; filter will be applied for all save and extract
- * invokations
- */
- public void setSaveFilter(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter newSaveFilter) {
- saveFilter = newSaveFilter;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/04/00 3:31:32 PM)
- *
- * @param newSaveStrategy
- * com.ibm.etools.archive.SaveStrategy
- */
- public void setSaveStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy newSaveStrategy) {
- saveStrategy = newSaveStrategy;
- if (newSaveStrategy != null) {
- newSaveStrategy.setArchive(this);
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newXmlEncoding
- * java.lang.String
- */
- public void setXmlEncoding(java.lang.String newXmlEncoding) {
- xmlEncoding = newXmlEncoding;
- }
-
- /**
- * Determine whether java reflection should be set up for this archive
- */
- public boolean shouldUseJavaReflection() {
- return getOptions().useJavaReflection() && getLoadStrategy().isClassLoaderNeeded();
- }
-
- protected void throwResourceLoadException(String resourceUri, Exception ex) throws ResourceLoadException {
- throw new ResourceLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.load_resource_EXC_, (new Object[]{resourceUri, getURI()})), ex); // = "Could not load resource "{0}" in archive "{1}""
- }
-
- public String getResourcesPath() throws FileNotFoundException {
- return getLoadStrategy().getResourcesPath();
- }
-
- public String getBinariesPath() throws FileNotFoundException {
- return getLoadStrategy().getBinariesPath();
- }
-
- protected RuntimeClasspathEntry[] emptyClasspath() {
- return new RuntimeClasspathEntry[0];
- }
-
- protected String internalGetBinariesPath() {
- try {
- return getBinariesPath();
- } catch (FileNotFoundException ex) {
- return null;
- }
- }
-
- /**
- * By default return just the contents of this archive
- */
- public RuntimeClasspathEntry[] getLocalRuntimeClassPath() {
-
- String absolutePath = internalGetBinariesPath();
- if (absolutePath == null)
- return emptyClasspath();
- return new RuntimeClasspathEntry[]{createRuntimeClasspathEntry(absolutePath)};
- }
-
-
- protected RuntimeClasspathEntry[] getDependencyClassPathAtThisLevel() {
- // BZ 170532: Don't use the archive's absolute path when the
- // archive is loosely mapped. The current archive's absolute
- // path, generally, will not be in a fixed location relative
- // to the path of the parent application.
- String parentPath = getParentPath();
- if ( parentPath == null )
- return emptyClasspath();
-
- String[] mfEntries = getManifest().getClassPathTokenized();
- if ( mfEntries.length == 0 )
- return emptyClasspath();
-
- List entries = new ArrayList();
- entries.addAll( createRuntimeClasspathEntries(mfEntries, parentPath) );
-
- return (RuntimeClasspathEntry[]) entries.toArray( new RuntimeClasspathEntry[ entries.size() ] );
- }
-
- /**
- * <p>Answer a parent path for use by the receiver. Take into
- * account wehther the receiver is a loose application or not.
- *
- * <p>Answer null in case an error is encountered while determining
- * the parent path.</p>
- *
- * <p>Added for BZ 170532.</p>
- *
- * @return A parent path for use by the receiver. Null in case of an error.
- *
- * @see getDependencyClassPathAtThisLevel()
- */
- protected String getParentPath() {
- try {
- if ( (getLoadStrategy().getLooseArchive() != null) && getContainer().isEARFile() ) {
- return getEARFile().getBinariesPath();
- }
- return new java.io.File(getBinariesPath()).getParentFile().getAbsolutePath();
- } catch (FileNotFoundException e) {
- return null;
- }
- }
-
-
- public RuntimeClasspathEntry[] getFullRuntimeClassPath() {
- return concat(getLocalRuntimeClassPath(), getDependencyClassPath());
- }
-
- protected RuntimeClasspathEntry[] concat(RuntimeClasspathEntry[] array1, RuntimeClasspathEntry[] array2) {
- List temp = new ArrayList();
- temp.addAll(Arrays.asList(array1));
- temp.addAll(Arrays.asList(array2));
- return (RuntimeClasspathEntry[]) temp.toArray(new RuntimeClasspathEntry[temp.size()]);
- }
-
- public RuntimeClasspathEntry[] getDependencyClassPath() {
- List entries = new ArrayList();
- Set visited = new HashSet();
- Set processedEntries = new HashSet();
- visited.add(this);
- getDependencyClassPath(visited, entries, processedEntries, this);
- return (RuntimeClasspathEntry[]) entries.toArray(new RuntimeClasspathEntry[entries.size()]);
- }
-
- protected void getDependencyClassPath(Set visitedArchives, List entries, Set processedEntries, Archive current) {
-
- RuntimeClasspathEntry[] local = ((ArchiveImpl) current).getDependencyClassPathAtThisLevel();
- for (int i = 0; i < local.length; i++) {
- RuntimeClasspathEntry entry = local[i];
- if (!processedEntries.contains(entry)) {
- entries.add(entry);
- processedEntries.add(entry);
- }
- Archive resolved = entry.getReferencedArchive();
- if (resolved == null)
- ClasspathUtil.processManifest(entry.getAbsolutePath(), entries, processedEntries);
- else if (!visitedArchives.contains(resolved)) {
- visitedArchives.add(resolved);
- getDependencyClassPath(visitedArchives, entries, processedEntries, resolved);
- }
-
- }
- }
-
- protected EARFile getEARFile() {
- Container parent = getContainer();
- if (parent == null || !(parent instanceof EARFile))
- return null;
- return (EARFile) parent;
- }
-
- protected Archive getResolvedArchive(String mfValue, EARFile ear) {
- String aUri = ArchiveUtil.deriveEARRelativeURI(mfValue, this);
- if (aUri == null)
- return null;
- try {
- return (Archive) ear.getFile(aUri);
- } catch (FileNotFoundException ex) {
- return null;
- } catch (ClassCastException ex2) {
- return null;
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive#hasClasspathVisibilityTo(Archive)
- */
- public boolean hasClasspathVisibilityTo(Archive other) {
- if (other == null)
- return false;
- EARFile ear = getEARFile();
- if (ear == null)
- return false;
- Set visited = new HashSet();
- return hasClasspathVisibilityTo(other, visited, ear);
- }
-
- public boolean hasClasspathVisibilityTo(Archive other, Set visited, EARFile ear) {
- if (this == other)
- return true;
- if (visited.contains(this))
- return false;
- visited.add(this);
- String[] mfEntries = getManifest().getClassPathTokenized();
- for (int i = 0; i < mfEntries.length; i++) {
- Archive anArchive = getResolvedArchive(mfEntries[i], ear);
- if (anArchive != null && anArchive.hasClasspathVisibilityTo(other, visited, ear))
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.commonarchivecore.Archive#isType(java.lang.String)
- */
- public boolean isType(String type) {
-
- return (types != null && getTypes().contains(type));
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ClientModuleRefImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ClientModuleRefImpl.java
deleted file mode 100644
index 14c3bc525..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ClientModuleRefImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ClientModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-
-/**
- * @generated
- */
-public class ClientModuleRefImpl extends ModuleRefImpl implements ClientModuleRef {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected ClientModuleRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.CLIENT_MODULE_REF;
- }
-
- public ApplicationClient getApplicationClient() throws ArchiveWrappedException {
- return (ApplicationClient) getDeploymentDescriptor();
- }
-
-
- /*
- * @see ModuleRef#isClient()
- */
- @Override
- public boolean isClient() {
- return true;
- }
-
-} //ClientModuleRefImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchiveFactoryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchiveFactoryImpl.java
deleted file mode 100644
index 2786f2fe3..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchiveFactoryImpl.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ArchiveTypeDiscriminatorRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ClientModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ConnectorModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WebModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.AppClient12ImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryArchiveLoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.DirectoryArchiveLoadStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Ear12ImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.EjbJar11ImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.NestedArchiveLoadStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.NullLoadStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.RarImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ReadOnlyDirectoryLoadStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.TempZipFileLoadStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.DeleteOnExitUtility;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-
-
-/**
- * @generated
- */
-public class CommonarchiveFactoryImpl extends EFactoryImpl implements CommonarchiveFactory {
-
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CommonarchiveFactory init() {
- try {
- CommonarchiveFactory theCommonarchiveFactory = (CommonarchiveFactory)EPackage.Registry.INSTANCE.getEFactory("commonarchive.xmi"); //$NON-NLS-1$
- if (theCommonarchiveFactory != null) {
- return theCommonarchiveFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new CommonarchiveFactoryImpl();
- }
-
- protected Map openArchives;
- private static boolean delegateNeedsInit = true;
- private CommonarchiveFactory delegate = null;
-
- static {
- initPrereqs();
- }
-
- /**
- *
- */
- public CommonarchiveFactoryImpl() {
- super();
- initDelegate();
- }
-
- /**
- *
- */
- private void initDelegate() {
- if (delegateNeedsInit) {
- delegateNeedsInit = false;
- delegate = new CommonarchiveFactoryImpl() {
-
- @Override
- public ApplicationClientFile createApplicationClientFile() {
- return createApplicationClientFileGen();
- }
-
-
- @Override
- public ClientModuleRef createClientModuleRef() {
- return createClientModuleRefGen();
- }
-
- @Override
- public ConnectorModuleRef createConnectorModuleRef() {
- return createConnectorModuleRefGen();
- }
-
- @Override
- public EARFile createEARFile() {
- return createEARFileGen();
- }
-
- @Override
- public EJBJarFile createEJBJarFile() {
- return createEJBJarFileGen();
- }
-
- @Override
- public EJBModuleRef createEJBModuleRef() {
- return createEJBModuleRefGen();
- }
-
- @Override
- public RARFile createRARFile() {
- return createRARFileGen();
- }
-
- @Override
- public WARFile createWARFile() {
- return createWARFileGen();
- }
-
- @Override
- public WebModuleRef createWebModuleRef() {
- return createWebModuleRefGen();
- }
- };
- }
-
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case CommonarchivePackage.FILE: return createFile();
- case CommonarchivePackage.ARCHIVE: return createArchive();
- case CommonarchivePackage.EJB_JAR_FILE: return createEJBJarFile();
- case CommonarchivePackage.WAR_FILE: return createWARFile();
- case CommonarchivePackage.EAR_FILE: return createEARFile();
- case CommonarchivePackage.APPLICATION_CLIENT_FILE: return createApplicationClientFile();
- case CommonarchivePackage.READ_ONLY_DIRECTORY: return createReadOnlyDirectory();
- case CommonarchivePackage.RAR_FILE: return createRARFile();
- case CommonarchivePackage.EJB_MODULE_REF: return createEJBModuleRef();
- case CommonarchivePackage.WEB_MODULE_REF: return createWebModuleRef();
- case CommonarchivePackage.CLIENT_MODULE_REF: return createClientModuleRef();
- case CommonarchivePackage.CONNECTOR_MODULE_REF: return createConnectorModuleRef();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public void archiveClosed(Archive aClosedArchive) {
- getOpenArchives().remove(aClosedArchive);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public void archiveOpened(Archive anOpenArchive) {
- getOpenArchives().put(anOpenArchive, null);
- }
-
- /**
- * @deprecated Use {@link #getOpenArchivesDependingOn(Archive)}
- */
- public boolean canClose(Archive anArchive) {
- return !getOpenArchivesDependingOn(anArchive).isEmpty();
- }
-
- public void closeOpenArchives() {
- if (getOpenArchives().isEmpty())
- return;
- synchronized (getOpenArchives()) {
- List opened = new ArrayList(getOpenArchives().size());
- Iterator it = getOpenArchives().keySet().iterator();
- while (it.hasNext()) {
- opened.add(it.next());
- }
- for (int i = 0; i < opened.size(); i++) {
- Archive anArchive = (Archive) opened.get(i);
- anArchive.close();
- }
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Archive copy(Archive anArchive) {
- return new ArchiveCopyUtility().copy(anArchive);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public ModuleFile copy(ModuleFile aModuleFile) {
- return new ArchiveCopyUtility().copy(aModuleFile);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public ApplicationClientFile createApplicationClientFileInitialized(java.lang.String uri) {
- ApplicationClientFile clientFile = createApplicationClientFile();
- initializeNewApplicationClientFile(clientFile, uri);
- return clientFile;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Archive createArchiveInitialized(java.lang.String uri) {
- Archive anArchive = createArchive();
- initializeNewArchive(anArchive, uri);
- return anArchive;
-
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Archive createArchiveInitialized(ArchiveOptions options, java.lang.String uri) {
- Archive anArchive = createArchive();
- initializeNewArchive(anArchive, uri, options);
- return anArchive;
-
- }
-
- public LoadStrategy createChildLoadStrategy(String uri, LoadStrategy parent) throws java.io.IOException, java.io.FileNotFoundException {
-
- LoadStrategy childStrategy = null;
- if (parent.isDirectory()) {
- String dirName = ((DirectoryArchiveLoadStrategy) parent).getDirectoryUri();
- String qualifiedUri = ArchiveUtil.getOSUri(dirName, uri);
- childStrategy = createLoadStrategy(qualifiedUri);
- } else {
- childStrategy = createNestedLoadStrategy(uri, parent);
- }
- return childStrategy;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EARFile createEARFileInitialized(java.lang.String uri) {
- EARFile earFile = createEARFile();
- initializeNewEARFile(earFile, uri);
- return earFile;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EARFile createEARFileInitialized(ArchiveOptions options, java.lang.String uri) {
- EARFile earFile = createEARFile();
- initializeNewEARFile(earFile, uri, options);
- return earFile;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile createEJBJarFileInitialized(java.lang.String uri) {
- EJBJarFile ejbJarFile = createEJBJarFile();
- initializeNewEJBJarFile(ejbJarFile, uri);
- return ejbJarFile;
-
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile createEJBJarFileInitialized(ArchiveOptions options, java.lang.String uri) {
- EJBJarFile ejbJarFile = createEJBJarFile();
- initializeNewEJBJarFile(ejbJarFile, uri, options);
- return ejbJarFile;
-
- }
-
- /**
- * Returns a NullLoadStrategyImpl; used for new archives
- */
- public LoadStrategy createEmptyLoadStrategy() {
- return new NullLoadStrategyImpl();
- }
-
- /**
- * Helper method to dynamically build a load strategy from the file system. Determines whether
- * the uri points to a jar file or directory and returns the appropriate strategy
- */
- public LoadStrategy createLoadStrategy(String uri) throws FileNotFoundException, IOException {
- String filename = uri.replace('/', java.io.File.separatorChar);
- java.io.File file = new java.io.File(filename);
- if (!file.exists()) {
- throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.file_not_found_EXC_, (new Object[]{uri, file.getAbsolutePath()}))); // = "URI Name: {0}; File name: {1}"
- }
- if (file.isDirectory()) {
- return new DirectoryArchiveLoadStrategyImpl(uri);
- }
- return new org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl(file);
- }
-
- /**
- * Create a load strategy for a nested archive; by default will extract the nested archive to a
- * temp file for performance reasons. This is because random access to the zip entries in a
- * nested archive is not supported by the java.util.zip package, and if the archive's contents
- * are being modified, copied, etc, this is much faster. If a temp file can not be created, or
- * if the archive is opened read only (for runtime), then use a NestedArchiveLoadStrategy, which
- * retrieves the contents of a zip entry by sequentially searching a zip input stream
- */
- public LoadStrategy createNestedLoadStrategy(String uri, LoadStrategy parent) {
- LoadStrategy loadStrategy = null;
- ArchiveOptions options = ((Archive) parent.getContainer()).getOptions();
-
- if (!options.isReadOnly(uri))
- loadStrategy = createTempZipFileStrategyIfPossible(uri, parent);
-
- if (loadStrategy == null)
- return new NestedArchiveLoadStrategyImpl(parent);
- return loadStrategy;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile createRARFileInitialized(java.lang.String uri) {
- RARFile rarFile = createRARFile();
- initializeNewRARFile(rarFile, uri);
- return rarFile;
- }
-
- public LoadStrategy createTempZipFileStrategyIfPossible(String uri, LoadStrategy parent) {
-
- if (!ArchiveUtil.shouldUseTempDirectoryForRead())
- return null;
-
- try {
- java.io.File tempFile = ArchiveUtil.createTempFile(uri);
- DeleteOnExitUtility.markForDeletion(tempFile);
- InputStream in = parent.getInputStream(uri);
- OutputStream out = new FileOutputStream(tempFile);
- ArchiveUtil.copy(in, out);
- return new TempZipFileLoadStrategyImpl(tempFile);
- } catch (IOException ex) {
- ArchiveUtil.inform(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.make_temp_file_WARN_, (new Object[]{uri})) + ex.getLocalizedMessage()); // = "Warning: Unable to create temp file for {0}. This will impact performance."
- }
- return null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public WARFile createWARFileInitialized(java.lang.String uri) {
- WARFile warFile = createWARFile();
- initializeNewWARFile(warFile, uri);
- return warFile;
- }
-
- protected ArchiveOptions defaultOptions(LoadStrategy aLoadStrategy) {
- ArchiveOptions options = new ArchiveOptions();
- options.setLoadStrategy(aLoadStrategy);
- return options;
- }
-
- public static CommonarchiveFactory getActiveFactory() {
- CommonarchivePackage pkg = getPackage();
- if (pkg != null)
- return pkg.getCommonarchiveFactory();
- return null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public java.lang.String[] getManifestClassPathValues(java.lang.String uri) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- String[] result = anArchive.getManifest().getClassPathTokenized();
- anArchive.close();
- return result;
- }
-
- /**
- * Insert the method's description here. Creation date: (02/23/01 2:35:55 PM)
- *
- * @return java.util.Map
- */
- public java.util.Map getOpenArchives() {
- if (openArchives == null)
- openArchives = Collections.synchronizedMap(new WeakHashMap());
- return openArchives;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Set getOpenArchivesDependingOn(Archive anArchive) {
- Set dependents = new HashSet();
- synchronized (getOpenArchives()) {
- Iterator opened = getOpenArchives().keySet().iterator();
- while (opened.hasNext()) {
- Archive openedArchive = (Archive) opened.next();
- if (openedArchive == anArchive)
- continue;
- if (!openedArchive.isIndexed())
- // **********Optimization***********
- // If the file list has never been built for the archive, we
- // don't want to trigger
- // it now,
- // and we are sure that the archive is not preventing the
- // parameter from closing
- continue;
- List files = openedArchive.getFiles();
- for (int i = 0; i < files.size(); i++) {
- File aFile = (File) files.get(i);
- if (aFile.getLoadingContainer() == anArchive) {
- Archive outermost = openedArchive;
- org.eclipse.jst.j2ee.commonarchivecore.internal.Container c = openedArchive.getContainer();
- while (c != null && c.isArchive()) {
- outermost = (Archive) c;
- c = c.getContainer();
- }
- dependents.add(outermost);
- }
- }
- }
- }
- //Elements from one of the children (e.g., a module file in an ear) may have been copied to
- //another archive
- List nestedArchives = anArchive.getArchiveFiles();
- for (int i = 0; i < nestedArchives.size(); i++) {
- dependents.addAll(getOpenArchivesDependingOn((Archive) nestedArchives.get(i)));
- }
- return dependents;
- }
-
- protected static void initPrereqs() {
- org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveInit.invokePrereqInits(true);
- ArchiveTypeDiscriminator disc = RootArchiveTypeDescriminatorImpl.singleton();
- disc.addChild(Ear12ImportStrategyImpl.getDiscriminator());
- disc.addChild(War22ImportStrategyImpl.getDiscriminator());
- disc.addChild(AppClient12ImportStrategyImpl.getDiscriminator());
- disc.addChild(RarImportStrategyImpl.getDiscriminator());
- disc.addChild(RootEJBJarDescriminatorImpl.singleton());
- }
-
- public void initializeNewApplicationClientFile(ApplicationClientFile anArchive, String uri) {
- initializeNewModuleFile(anArchive, uri);
- }
-
- public void initializeNewArchive(Archive anArchive, String uri) {
- anArchive.setURI(uri);
- anArchive.setSize(0);
- anArchive.setLastModified(System.currentTimeMillis());
- anArchive.setDirectoryEntry(false);
- anArchive.setLoadStrategy(createEmptyLoadStrategy());
- }
-
- public void initializeNewEARFile(EARFile anArchive, String uri) {
- initializeNewModuleFile(anArchive, uri);
- }
-
- public void initializeNewEJBJarFile(EJBJarFile anArchive, String uri) {
- initializeNewModuleFile(anArchive, uri);
- }
-
- public void initializeNewModuleFile(ModuleFile anArchive, String uri) {
- initializeNewArchive(anArchive, uri);
- anArchive.makeDeploymentDescriptorResource();
- }
-
- public void initializeNewRARFile(RARFile anArchive, String uri) {
- initializeNewModuleFile(anArchive, uri);
- }
-
- public void initializeNewWARFile(WARFile anArchive, String uri) {
- initializeNewModuleFile(anArchive, uri);
- }
-
- public void initializeNewApplicationClientFile(ApplicationClientFile anArchive, String uri, ArchiveOptions options) {
- initializeNewModuleFile(anArchive, uri, options);
- }
-
- public void initializeNewArchive(Archive anArchive, String uri, ArchiveOptions options) {
- if (options.getLoadStrategy() == null) {
- try {
- options.setLoadStrategy(createEmptyLoadStrategy());
- } catch (Exception ex) {
- Logger.getLogger().logError(ex);
- }
- }
-
- anArchive.setURI(uri);
- anArchive.setSize(0);
- anArchive.setLastModified(System.currentTimeMillis());
- anArchive.setDirectoryEntry(false);
- anArchive.setLoadStrategy(options.getLoadStrategy());
- anArchive.setOptions(options);
-
- }
-
- public void initializeNewEARFile(EARFile anArchive, String uri, ArchiveOptions options) {
- initializeNewModuleFile(anArchive, uri, options);
- }
-
- public void initializeNewEJBJarFile(EJBJarFile anArchive, String uri, ArchiveOptions options) {
- initializeNewModuleFile(anArchive, uri, options);
- }
-
- public void initializeNewModuleFile(ModuleFile anArchive, String uri, ArchiveOptions options) {
- initializeNewArchive(anArchive, uri, options);
- anArchive.makeDeploymentDescriptorResource();
- }
-
- public void initializeNewRARFile(RARFile anArchive, String uri, ArchiveOptions options) {
- initializeNewModuleFile(anArchive, uri, options);
- }
-
- public void initializeNewWARFile(WARFile anArchive, String uri, ArchiveOptions options) {
- initializeNewModuleFile(anArchive, uri, options);
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public ApplicationClientFile openApplicationClientFile(ArchiveOptions options, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- ArchiveTypeDiscriminator disc = AppClient12ImportStrategyImpl.getDiscriminator();
- return (ApplicationClientFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public ApplicationClientFile openApplicationClientFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- ArchiveTypeDiscriminator disc = AppClient12ImportStrategyImpl.getDiscriminator();
- return (ApplicationClientFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public ApplicationClientFile openApplicationClientFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- ArchiveTypeDiscriminator disc = AppClient12ImportStrategyImpl.getDiscriminator();
- return (ApplicationClientFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive openArchive(ArchiveOptions options, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- return openSpecificArchive(anArchive, RootArchiveTypeDescriminatorImpl.singleton());
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive openArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- return openSpecificArchive(anArchive, RootArchiveTypeDescriminatorImpl.singleton());
- }
-
- /**
- * openArchive(String uri) - open the archive by the passed name, setting up the appropriate
- * strategies. Name may be a path to a jar, a zip, or a directory return the appropriate Archive
- * type
- */
- public Archive openArchive(java.lang.String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- return openSpecificArchive(anArchive, RootArchiveTypeDescriminatorImpl.singleton());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Archive openArchive(String uri, String extraClassPath) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- anArchive.setExtraClasspath(extraClassPath);
- return openSpecificArchive(anArchive, RootArchiveTypeDescriminatorImpl.singleton());
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EARFile openEARFile(ArchiveOptions options, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- ArchiveTypeDiscriminator disc = Ear12ImportStrategyImpl.getDiscriminator();
- return (EARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EARFile openEARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- ArchiveTypeDiscriminator disc = Ear12ImportStrategyImpl.getDiscriminator();
- return (EARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EARFile openEARFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- ArchiveTypeDiscriminator disc = Ear12ImportStrategyImpl.getDiscriminator();
- return (EARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJB11JarFile(ArchiveOptions options, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- ArchiveTypeDiscriminator disc = EjbJar11ImportStrategyImpl.getDiscriminator();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJB11JarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- ArchiveTypeDiscriminator disc = EjbJar11ImportStrategyImpl.getDiscriminator();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJB11JarFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- ArchiveTypeDiscriminator disc = EjbJar11ImportStrategyImpl.getDiscriminator();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public EJBJarFile openEJBJarFile(ArchiveOptions options, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- RootEJBJarDescriminatorImpl disc = (RootEJBJarDescriminatorImpl) RootEJBJarDescriminatorImpl.singleton();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- RootEJBJarDescriminatorImpl disc = (RootEJBJarDescriminatorImpl) RootEJBJarDescriminatorImpl.singleton();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri, String extraClassPath) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- anArchive.setExtraClasspath(extraClassPath);
- RootEJBJarDescriminatorImpl disc = (RootEJBJarDescriminatorImpl) RootEJBJarDescriminatorImpl.singleton();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJBJarFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- RootEJBJarDescriminatorImpl disc = (RootEJBJarDescriminatorImpl) RootEJBJarDescriminatorImpl.singleton();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public EJBJarFile openEJBJarFile(String uri, String extraClassPath) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- anArchive.setExtraClasspath(extraClassPath);
- RootEJBJarDescriminatorImpl disc = (RootEJBJarDescriminatorImpl) RootEJBJarDescriminatorImpl.singleton();
- return (EJBJarFile) openSpecificArchive(anArchive, disc);
- }
-
- public Archive openNestedArchive(LooseArchive loose, Archive parent) throws OpenFailureException {
- String uri = loose.getUri();
- try {
- if(loose.getBinariesPath() == null){
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.open_nested_EXC_, (new Object[] {uri,parent.getURI()})), null); // = "Could not open the nested archive "{0}" in "{1}""
- }
- LoadStrategy childStrategy = createLoadStrategy(loose.getBinariesPath());
- childStrategy.setLooseArchive(loose);
- ArchiveOptions options = parent.getOptions().cloneWith(childStrategy, loose.getUri());
- return primOpenArchive(options, uri);
- } catch (IOException ex) {
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.open_nested_EXC_, (new Object[]{uri, parent.getURI()})), ex); // = "Could not open the nested archive "{0}" in "{1}""
- }
- }
-
- /**
- * @see CommonarchiveFactory
- */
- public Archive openNestedArchive(String uri, Archive parent) throws OpenFailureException {
- try {
- LoadStrategy childStrategy = createChildLoadStrategy(uri, parent.getLoadStrategy());
- ArchiveOptions options = parent.getOptions().cloneWith(childStrategy, uri);
- if (options.shouldDiscriminateNestedArchives())
- return openArchive(options, uri);
- return primOpenArchive(options, uri);
- } catch (IOException ex) {
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.open_nested_EXC_, (new Object[]{uri, parent.getURI()})), ex); // = "Could not open the nested archive "{0}" in "{1}""
- }
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public RARFile openRARFile(ArchiveOptions options, java.lang.String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- ArchiveTypeDiscriminator disc = RarImportStrategyImpl.getDiscriminator();
- return (RARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile openRARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- ArchiveTypeDiscriminator disc = RarImportStrategyImpl.getDiscriminator();
- return (RARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public RARFile openRARFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- ArchiveTypeDiscriminator disc = RarImportStrategyImpl.getDiscriminator();
- return (RARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * openReadOnlyDirectory method comment.
- */
- public ReadOnlyDirectory openReadOnlyDirectory(java.lang.String uri) throws java.io.IOException {
- java.io.File aFile = new java.io.File(uri);
- if (!aFile.exists())
- throw new FileNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.could_not_find_dir_EXC_, (new Object[]{uri}))); // = "Unable to open directory "
- if (!aFile.isDirectory())
- throw new IOException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.not_a_dir_EXC_, (new Object[]{uri}))); // = "Unable to open directory because file is not a directory :"
- LoadStrategy strategy = new ReadOnlyDirectoryLoadStrategyImpl(uri);
- ReadOnlyDirectory container = createReadOnlyDirectory();
- container.setURI(uri);
- container.setLoadStrategy(strategy);
- container.setLastModified(aFile.lastModified());
- return container;
- }
-
- /**
- * Take the primitive archive and run it through the list of discriminators to convert it to the
- * correct specialized type; after after conversion, tell the archive to initalize itself if
- * necessary.
- */
- protected Archive openSpecificArchive(Archive anArchive, ArchiveTypeDiscriminator disc) throws OpenFailureException {
- if (!disc.canImport(anArchive)) {
- anArchive.close();
- throw new OpenFailureException(disc.getUnableToOpenMessage());
- }
- Archive specificArchive = disc.openArchive(anArchive);
- specificArchive.initializeAfterOpen();
- return specificArchive;
- }
-
- /**
- * Special case for ejb jar files, because of the need to support non-compliant 1.0 jars
- */
- protected Archive openSpecificArchive(Archive anArchive, RootEJBJarDescriminatorImpl disc) throws OpenFailureException {
- Archive specific = openSpecificArchive(anArchive, (ArchiveTypeDiscriminator) disc);
- if (specific == anArchive) {
- //The discriminator failed to convert the archve to an ejb jar file
- anArchive.close();
- throw new OpenFailureException(disc.getUnableToOpenMessage());
- }
- return specific;
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public WARFile openWARFile(ArchiveOptions options, java.lang.String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(options, uri);
- ArchiveTypeDiscriminator disc = War22ImportStrategyImpl.getDiscriminator();
- return (WARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public WARFile openWARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(aLoadStrategy, uri);
- ArchiveTypeDiscriminator disc = War22ImportStrategyImpl.getDiscriminator();
- return (WARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public WARFile openWARFile(String uri) throws OpenFailureException {
- Archive anArchive = primOpenArchive(uri);
- ArchiveTypeDiscriminator disc = War22ImportStrategyImpl.getDiscriminator();
- return (WARFile) openSpecificArchive(anArchive, disc);
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive primOpenArchive(ArchiveOptions options, String uri) throws OpenFailureException {
- if (options.getLoadStrategy() == null) {
- try {
- options.setLoadStrategy(createLoadStrategy(uri));
- } catch (IOException ex) {
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.could_not_open_EXC_, (new Object[]{uri})), ex); // = "Could not open "
- }
- }
- Archive anArchive = createArchive();
- anArchive.setURI(uri);
- anArchive.setOriginalURI(uri);
- anArchive.setLoadStrategy(options.getLoadStrategy());
- anArchive.setOptions(options);
- ArchiveTypeDiscriminatorRegistry.getInstance().contributeTypes(anArchive);
- return anArchive;
- }
-
- /**
- * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
- * URI still necessary so the archive has a name, but it will not be used for io.
- */
- public Archive primOpenArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException {
- return primOpenArchive(defaultOptions(aLoadStrategy), uri);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.CommonarchiveFactory
- */
- public Archive primOpenArchive(String uri) throws OpenFailureException {
- return primOpenArchive(new ArchiveOptions(), uri);
- }
-
- protected void setOpenArchives(java.util.Map newOpenArchives) {
- openArchives = newOpenArchives;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public WARFile createWARFileGen() {
- WARFileImpl warFile = new WARFileImpl();
- return warFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EJBJarFile createEJBJarFileGen() {
- EJBJarFileImpl ejbJarFile = new EJBJarFileImpl();
- return ejbJarFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public ApplicationClientFile createApplicationClientFileGen() {
- ApplicationClientFileImpl applicationClientFile = new ApplicationClientFileImpl();
- return applicationClientFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EARFile createEARFileGen() {
- EARFileImpl earFile = new EARFileImpl();
- return earFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public RARFile createRARFileGen() {
- RARFileImpl rarFile = new RARFileImpl();
- return rarFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public File createFile() {
- FileImpl file = new FileImpl();
- return file;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public ReadOnlyDirectory createReadOnlyDirectory() {
- ReadOnlyDirectoryImpl readOnlyDirectory = new ReadOnlyDirectoryImpl();
- return readOnlyDirectory;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public CommonarchivePackage getCommonarchivePackage() {
- return (CommonarchivePackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static CommonarchivePackage getPackage() {
- return CommonarchivePackage.eINSTANCE;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EJBModuleRef createEJBModuleRefGen() {
- EJBModuleRefImpl ejbModuleRef = new EJBModuleRefImpl();
- return ejbModuleRef;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public WebModuleRef createWebModuleRefGen() {
- WebModuleRefImpl webModuleRef = new WebModuleRefImpl();
- return webModuleRef;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public ClientModuleRef createClientModuleRefGen() {
- ClientModuleRefImpl clientModuleRef = new ClientModuleRefImpl();
- return clientModuleRef;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public ConnectorModuleRef createConnectorModuleRefGen() {
- ConnectorModuleRefImpl connectorModuleRef = new ConnectorModuleRefImpl();
- return connectorModuleRef;
- }
-
- public ClientModuleRef createClientModuleRef(ApplicationClientFile clientFile) {
- ClientModuleRef ref = createClientModuleRef();
- ref.setModuleFile(clientFile);
- return ref;
- }
-
- /*
- * @see CommonarchiveFactory#createConnectorModuleRef(RARFile)
- */
- public ConnectorModuleRef createConnectorModuleRef(RARFile rarFile) {
- ConnectorModuleRef ref = createConnectorModuleRef();
- ref.setModuleFile(rarFile);
- return ref;
-
- }
-
- /*
- * @see CommonarchiveFactory#createEJBModuleRef(EJBJarFile)
- */
- public EJBModuleRef createEJBModuleRef(EJBJarFile ejbJarFile) {
- EJBModuleRef ref = createEJBModuleRef();
- ref.setModuleFile(ejbJarFile);
- return ref;
- }
-
- /*
- * @see CommonarchiveFactory#createWebModuleRef(WARFile)
- */
- public WebModuleRef createWebModuleRef(WARFile warFile) {
- WebModuleRef ref = createWebModuleRef();
- ref.setModuleFile(warFile);
- return ref;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Archive createArchive() {
- ArchiveImpl archive = new ArchiveImpl();
- return archive;
- }
-
- public ApplicationClientFile createApplicationClientFile() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createApplicationClientFile();
- }
-
-
- public ClientModuleRef createClientModuleRef() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createClientModuleRef();
- }
-
- public ConnectorModuleRef createConnectorModuleRef() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createConnectorModuleRef();
- }
-
- public EARFile createEARFile() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createEARFile();
- }
-
- public EJBJarFile createEJBJarFile() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createEJBJarFile();
- }
-
- public EJBModuleRef createEJBModuleRef() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createEJBModuleRef();
- }
-
- public RARFile createRARFile() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createRARFile();
- }
-
- public WARFile createWARFile() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createWARFile();
- }
-
- public WebModuleRef createWebModuleRef() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory().createWebModuleRef();
- }
-
- /**
- * @return
- */
- public CommonarchiveFactory getDelegate() {
- return delegate;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchivePackageImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchivePackageImpl.java
deleted file mode 100644
index 9dd0ba976..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchivePackageImpl.java
+++ /dev/null
@@ -1,623 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
-import org.eclipse.jst.j2ee.application.ApplicationPackage;
-import org.eclipse.jst.j2ee.client.ClientPackage;
-import org.eclipse.jst.j2ee.common.CommonPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ClientModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ConnectorModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WebModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl;
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-import org.eclipse.jst.j2ee.ejb.EjbPackage;
-import org.eclipse.jst.j2ee.internal.J2EEInit;
-import org.eclipse.jst.j2ee.jca.JcaPackage;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage;
-
-
-/**
- * @lastgen class CommonarchivePackageImpl extends EPackageImpl implements CommonarchivePackage,
- * EPackage {}
- */
-public class CommonarchivePackageImpl extends EPackageImpl implements CommonarchivePackage {
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass fileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass archiveEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass ejbJarFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass warFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass earFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass applicationClientFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass moduleFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass containerEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass readOnlyDirectoryEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass rarFileEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass moduleRefEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass ejbModuleRefEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass webModuleRefEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass clientModuleRefEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass connectorModuleRefEClass = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- private CommonarchivePackageImpl() {
- super(eNS_URI, CommonarchiveFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public static CommonarchivePackage init() {
- if (isInited) return (CommonarchivePackage)EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI);
-
- // Obtain or create and register package
- CommonarchivePackageImpl theCommonarchivePackage =
- (CommonarchivePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof
- CommonarchivePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new
- CommonarchivePackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- J2EEInit.initEMFModels();
- JavaRefPackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- LooseconfigPackageImpl theLooseconfigPackage = (LooseconfigPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI) instanceof LooseconfigPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI) : LooseconfigPackage.eINSTANCE);
-
- // Create package meta-data objects
- theCommonarchivePackage.createPackageContents();
- theLooseconfigPackage.createPackageContents();
-
- // Initialize created meta-data
- theCommonarchivePackage.initializePackageContents();
- theLooseconfigPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theCommonarchivePackage.freeze();
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(CommonarchivePackage.eNS_URI, theCommonarchivePackage);
-
- return theCommonarchivePackage;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getContainer() {
- return containerEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getContainer_Files() {
- return (EReference)containerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getWARFile() {
- return warFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getWARFile_DeploymentDescriptor() {
- return (EReference)warFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getModuleFile() {
- return moduleFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getEARFile() {
- return earFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getEARFile_DeploymentDescriptor() {
- return (EReference)earFileEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getEARFile_ModuleRefs() {
- return (EReference)earFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getModuleRef() {
- return moduleRefEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getModuleRef_ModuleFile() {
- return (EReference)moduleRefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getModuleRef_EarFile() {
- return (EReference)moduleRefEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getModuleRef_Module() {
- return (EReference)moduleRefEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getEJBModuleRef() {
- return ejbModuleRefEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getWebModuleRef() {
- return webModuleRefEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getClientModuleRef() {
- return clientModuleRefEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getConnectorModuleRef() {
- return connectorModuleRefEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getApplicationClientFile() {
- return applicationClientFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getApplicationClientFile_DeploymentDescriptor() {
- return (EReference)applicationClientFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getEJBJarFile() {
- return ejbJarFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getEJBJarFile_DeploymentDescriptor() {
- return (EReference)ejbJarFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getRARFile() {
- return rarFileEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EReference getRARFile_DeploymentDescriptor() {
- return (EReference)rarFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getArchive() {
- return archiveEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getArchive_Types() {
- return (EAttribute)archiveEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getFile() {
- return fileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getFile_URI() {
- return (EAttribute)fileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getFile_LastModified() {
- return (EAttribute)fileEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getFile_Size() {
- return (EAttribute)fileEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getFile_DirectoryEntry() {
- return (EAttribute)fileEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getFile_OriginalURI() {
- return (EAttribute)fileEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getFile_LoadingContainer() {
- return (EReference)fileEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getFile_Container() {
- return (EReference)fileEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getReadOnlyDirectory() {
- return readOnlyDirectoryEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public CommonarchiveFactory getCommonarchiveFactory() {
- return (CommonarchiveFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- fileEClass = createEClass(FILE);
- createEAttribute(fileEClass, FILE__URI);
- createEAttribute(fileEClass, FILE__LAST_MODIFIED);
- createEAttribute(fileEClass, FILE__SIZE);
- createEAttribute(fileEClass, FILE__DIRECTORY_ENTRY);
- createEAttribute(fileEClass, FILE__ORIGINAL_URI);
- createEReference(fileEClass, FILE__LOADING_CONTAINER);
- createEReference(fileEClass, FILE__CONTAINER);
-
- archiveEClass = createEClass(ARCHIVE);
- createEAttribute(archiveEClass, ARCHIVE__TYPES);
-
- ejbJarFileEClass = createEClass(EJB_JAR_FILE);
- createEReference(ejbJarFileEClass, EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR);
-
- warFileEClass = createEClass(WAR_FILE);
- createEReference(warFileEClass, WAR_FILE__DEPLOYMENT_DESCRIPTOR);
-
- earFileEClass = createEClass(EAR_FILE);
- createEReference(earFileEClass, EAR_FILE__MODULE_REFS);
- createEReference(earFileEClass, EAR_FILE__DEPLOYMENT_DESCRIPTOR);
-
- applicationClientFileEClass = createEClass(APPLICATION_CLIENT_FILE);
- createEReference(applicationClientFileEClass, APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR);
-
- moduleFileEClass = createEClass(MODULE_FILE);
-
- containerEClass = createEClass(CONTAINER);
- createEReference(containerEClass, CONTAINER__FILES);
-
- readOnlyDirectoryEClass = createEClass(READ_ONLY_DIRECTORY);
-
- rarFileEClass = createEClass(RAR_FILE);
- createEReference(rarFileEClass, RAR_FILE__DEPLOYMENT_DESCRIPTOR);
-
- moduleRefEClass = createEClass(MODULE_REF);
- createEReference(moduleRefEClass, MODULE_REF__MODULE_FILE);
- createEReference(moduleRefEClass, MODULE_REF__EAR_FILE);
- createEReference(moduleRefEClass, MODULE_REF__MODULE);
-
- ejbModuleRefEClass = createEClass(EJB_MODULE_REF);
-
- webModuleRefEClass = createEClass(WEB_MODULE_REF);
-
- clientModuleRefEClass = createEClass(CLIENT_MODULE_REF);
-
- connectorModuleRefEClass = createEClass(CONNECTOR_MODULE_REF);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- LooseconfigPackage theLooseconfigPackage = (LooseconfigPackage)EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI);
- CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
- EjbPackage theEjbPackage = (EjbPackage)EPackage.Registry.INSTANCE.getEPackage(EjbPackage.eNS_URI);
- WebapplicationPackage theWebapplicationPackage = (WebapplicationPackage)EPackage.Registry.INSTANCE.getEPackage(WebapplicationPackage.eNS_URI);
- ApplicationPackage theApplicationPackage = (ApplicationPackage)EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI);
- ClientPackage theClientPackage = (ClientPackage)EPackage.Registry.INSTANCE.getEPackage(ClientPackage.eNS_URI);
- JcaPackage theJcaPackage = (JcaPackage)EPackage.Registry.INSTANCE.getEPackage(JcaPackage.eNS_URI);
-
- // Add subpackages
- getESubpackages().add(theLooseconfigPackage);
-
- boolean hasLock = false;
- try {
- hasLock = J2EEInit.aquireInitializePackageContentsLock();
- } catch (InterruptedException e) {
- J2EECorePlugin.logError(e);
- }
-
- try{
- // Add supertypes to classes
- fileEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject());
- archiveEClass.getESuperTypes().add(this.getContainer());
- ejbJarFileEClass.getESuperTypes().add(this.getModuleFile());
- warFileEClass.getESuperTypes().add(this.getModuleFile());
- earFileEClass.getESuperTypes().add(this.getModuleFile());
- applicationClientFileEClass.getESuperTypes().add(this.getModuleFile());
- moduleFileEClass.getESuperTypes().add(this.getArchive());
- containerEClass.getESuperTypes().add(this.getFile());
- readOnlyDirectoryEClass.getESuperTypes().add(this.getContainer());
- rarFileEClass.getESuperTypes().add(this.getModuleFile());
- moduleRefEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject());
- ejbModuleRefEClass.getESuperTypes().add(this.getModuleRef());
- webModuleRefEClass.getESuperTypes().add(this.getModuleRef());
- clientModuleRefEClass.getESuperTypes().add(this.getModuleRef());
- connectorModuleRefEClass.getESuperTypes().add(this.getModuleRef());
-
- // Initialize classes and features; add operations and parameters
- initEClass(fileEClass, File.class, "File", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEAttribute(getFile_URI(), ecorePackage.getEString(), "URI", null, 0, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getFile_LastModified(), ecorePackage.getELong(), "lastModified", null, 0, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getFile_Size(), ecorePackage.getELong(), "size", null, 0, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getFile_DirectoryEntry(), ecorePackage.getEBoolean(), "directoryEntry", null, 0, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getFile_OriginalURI(), ecorePackage.getEString(), "originalURI", null, 0, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getFile_LoadingContainer(), this.getContainer(), null, "loadingContainer", null, 1, 1, File.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getFile_Container(), this.getContainer(), this.getContainer_Files(), "container", null, 0, 1, File.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(archiveEClass, Archive.class, "Archive", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEAttribute(getArchive_Types(), ecorePackage.getEString(), "types", null, 0, -1, Archive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(ejbJarFileEClass, EJBJarFile.class, "EJBJarFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getEJBJarFile_DeploymentDescriptor(), theEjbPackage.getEJBJar(), null, "deploymentDescriptor", null, 1, 1, EJBJarFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(warFileEClass, WARFile.class, "WARFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getWARFile_DeploymentDescriptor(), theWebapplicationPackage.getWebApp(), null, "deploymentDescriptor", null, 1, 1, WARFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(earFileEClass, EARFile.class, "EARFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getEARFile_ModuleRefs(), this.getModuleRef(), this.getModuleRef_EarFile(), "moduleRefs", null, 1, -1, EARFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getEARFile_DeploymentDescriptor(), theApplicationPackage.getApplication(), null, "deploymentDescriptor", null, 1, 1, EARFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(applicationClientFileEClass, ApplicationClientFile.class, "ApplicationClientFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getApplicationClientFile_DeploymentDescriptor(), theClientPackage.getApplicationClient(), null, "deploymentDescriptor", null, 1, 1, ApplicationClientFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(moduleFileEClass, ModuleFile.class, "ModuleFile", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- initEClass(containerEClass, Container.class, "Container", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getContainer_Files(), this.getFile(), this.getFile_Container(), "files", null, 0, -1, Container.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(readOnlyDirectoryEClass, ReadOnlyDirectory.class, "ReadOnlyDirectory", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- initEClass(rarFileEClass, RARFile.class, "RARFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getRARFile_DeploymentDescriptor(), theJcaPackage.getConnector(), null, "deploymentDescriptor", null, 1, 1, RARFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(moduleRefEClass, ModuleRef.class, "ModuleRef", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getModuleRef_ModuleFile(), this.getModuleFile(), null, "moduleFile", null, 1, 1, ModuleRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getModuleRef_EarFile(), this.getEARFile(), this.getEARFile_ModuleRefs(), "earFile", null, 1, 1, ModuleRef.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getModuleRef_Module(), theApplicationPackage.getModule(), null, "module", null, 1, 1, ModuleRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(ejbModuleRefEClass, EJBModuleRef.class, "EJBModuleRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- initEClass(webModuleRefEClass, WebModuleRef.class, "WebModuleRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- initEClass(clientModuleRefEClass, ClientModuleRef.class, "ClientModuleRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- initEClass(connectorModuleRefEClass, ConnectorModuleRef.class, "ConnectorModuleRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
-
- // Create resource
- createResource(eNS_URI);
- }finally{
- if( hasLock )
- J2EEInit.releaseInitializePackageContentsLock();
- }
- }
-
-} //CommonarchivePackageImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ConnectorModuleRefImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ConnectorModuleRefImpl.java
deleted file mode 100644
index 662439cd5..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ConnectorModuleRefImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ConnectorModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.jca.Connector;
-
-/**
- * @generated
- */
-public class ConnectorModuleRefImpl extends ModuleRefImpl implements ConnectorModuleRef {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected ConnectorModuleRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.CONNECTOR_MODULE_REF;
- }
-
- public Connector getConnector() throws ArchiveWrappedException {
- return (Connector) getDeploymentDescriptor();
- }
-
- /*
- * @see ModuleRef#isConnector()
- */
- @Override
- public boolean isConnector() {
- return true;
- }
-
-} //ConnectorModuleRefImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java
deleted file mode 100644
index 6f61e9459..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-
-
-/**
- * @generated
- */
-public abstract class ContainerImpl extends FileImpl implements Container {
-
-
- /**
- * Inner class which maintains the index for the domain's collection of nodes keyed by name.
- */
- protected class FileNotificationAdapter extends AdapterImpl {
- @Override
- public boolean isAdapterForType(Object type) {
- return (type == "FileNotificationAdapter");//$NON-NLS-1$
- }
-
- public void addIndexedFile(String newValue, Notifier notifier) {
- fileIndex.put(newValue, notifier);
- if (notifier.eAdapters() == null || !notifier.eAdapters().contains(this))
- notifier.eAdapters().add(this);
- }
-
- public void removeIndexedFile(String oldValue, Notifier notifier) {
- fileIndex.remove(oldValue);
- notifier.eAdapters().remove(this);
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- if (fileIndex == null || notification.getFeature() == null)
- return;
- //If the name changed, update the index
- if (notification.getFeature().equals(CommonarchivePackage.eINSTANCE.getFile_URI()) && ((File) notification.getNotifier()).getContainer() == ContainerImpl.this) {
- fileIndex.remove(notification.getOldValue());
- fileIndex.put(notification.getNewValue(), notification.getNotifier());
- }
- //Handle adds and removes
- if (notification.getFeature().equals(CommonarchivePackage.eINSTANCE.getContainer_Files()) && notification.getNotifier() == ContainerImpl.this) {
- switch (notification.getEventType()) {
- case Notification.ADD : {
- File file = (File) notification.getNewValue();
- addIndexedFile(file.getURI(), file);
- break;
- }
- case Notification.REMOVE : {
- removeIndexedFile(((File) notification.getOldValue()).getURI(), (File) notification.getOldValue());
- break;
- }
- case Notification.ADD_MANY : {
- filesAdded((List) notification.getNewValue());
- break;
- }
- case Notification.REMOVE_MANY : {
- filesRemoved((List) notification.getOldValue());
- break;
- }
- case Notification.MOVE : {
- break;
- }
- case Notification.SET : {
- if (notification.getPosition() != Notification.NO_INDEX) { //This is now a
- // replace in
- // MOF2
- File file = (File) notification.getNewValue();
- removeIndexedFile(((File) notification.getOldValue()).getURI(), (File) notification.getOldValue());
- addIndexedFile(file.getURI(), file);
- }
- break;
- }
- }
- }
- }
-
- public void filesAdded(List newFiles) {
- for (int i = 0; i < newFiles.size(); i++) {
- File file = (File) newFiles.get(i);
- addIndexedFile(file.getURI(), file);
- }
- }
-
- public void filesRemoved(List oldFiles) {
- for (int i = 0; i < oldFiles.size(); i++) {
- File file = (File) oldFiles.get(i);
- removeIndexedFile(file.getURI(), file);
- }
- }
-
- public void rebuildFileIndex() {
- removeAdaptersIfNecessary();
- fileIndex = new HashMap();
-
- // If the primary collection already has elements,
- //'reflect them in the index...
- if (getFiles().size() > 0) {
- Iterator i = getFiles().iterator();
- while (i.hasNext()) {
- File file = (File) i.next();
- addIndexedFile(file.getURI(), file);
- }
- }
- }
-
- public void removeAdaptersIfNecessary() {
- if (fileIndex == null)
- return;
- Iterator iter = fileIndex.values().iterator();
- while (iter.hasNext()) {
- File aFile = (File) iter.next();
- aFile.eAdapters().remove(this);
- }
- }
- }
-
- /** Implementer for loading entries in this container */
- protected LoadStrategy loadStrategy;
- /**
- * Index to provide fast lookup by name of files.
- */
- protected Map fileIndex;
- /**
- * An adapter which maintains the file index
- */
- protected FileNotificationAdapter fileIndexAdapter;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList files = null;
-
- public ContainerImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.CONTAINER;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public boolean containsFile(java.lang.String aUri) {
- String key = aUri.startsWith("/") ? ArchiveUtil.truncateFromFrontIgnoreCase(aUri, "/") : aUri;//$NON-NLS-2$//$NON-NLS-1$
- if (isIndexed())
- return getFileIndex().containsKey(key);
- return getLoadStrategy().contains(key);
-
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Container
- */
- public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException {
- return getLoadStrategy().getAbsolutePath();
- }
-
- public File getFile(String URI) throws java.io.FileNotFoundException {
- if (!isIndexed()) {
- getFiles();
- }
-
- // Some load strategies load the files as relative, and some as absolute paths, so...
- // First try with the original URI
- File file = (File) getFileIndex().get(URI);
-
- if (file == null){
- // If the file was not found, try using absolute path
- IPath URIPath = new Path(URI);
- if (URIPath.segmentCount() > 1){
- URIPath = URIPath.makeAbsolute();
- file = (File) getFileIndex().get(URIPath.toString());
- }
- }
-
- if (file == null) {
- throw new java.io.FileNotFoundException(URI);
- }
- return file;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/05/00 7:20:21 PM)
- *
- * @return java.util.Map
- */
- protected java.util.Map getFileIndex() {
- if (fileIndex == null)
- getFileIndexAdapter().rebuildFileIndex();
- return fileIndex;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/05/00 7:20:21 PM)
- *
- * @return FileNotificationAdapter
- */
- protected FileNotificationAdapter getFileIndexAdapter() {
- if (fileIndexAdapter == null) {
- fileIndexAdapter = new FileNotificationAdapter();
- eAdapters().add(fileIndexAdapter);
- }
- return fileIndexAdapter;
- }
-
- /**
- * List is built on demand, by requesting from the load strategy.
- */
- public EList getFiles() {
- EList filesList = this.getFilesGen();
- if (!isIndexed()) {
- if (filesList.isEmpty() && getLoadStrategy() != null) {
- filesList.addAll(getLoadStrategy().collectFiles());
- }
- //Causes the index to be built
- getFileIndex();
- }
- return filesList;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive Looks for a file with the given uri, and returns an
- * input stream; optimization: if the file list has not been built, goes directly to the
- * loadStrategy.
- */
- public java.io.InputStream getInputStream(java.lang.String aUri) throws java.io.IOException, java.io.FileNotFoundException {
- if (isIndexed()) {
- return getFile(aUri).getInputStream();
- }
- return primGetInputStream(aUri);
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.LoadStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy getLoadStrategy() {
- return loadStrategy;
- }
-
- @Override
- public boolean isContainer() {
- return true;
- }
-
- public boolean isIndexed() {
- return fileIndex != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive Goes directly to the loadStrategy.
- */
- public java.io.InputStream primGetInputStream(java.lang.String aUri) throws java.io.IOException, java.io.FileNotFoundException {
- return getLoadStrategy().getInputStream(aUri);
- }
-
- public void rebuildFileIndex() {
- getFileIndexAdapter().rebuildFileIndex();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newLoadStrategy
- * com.ibm.etools.archive.LoadStrategy
- */
- public void setLoadStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy newLoadStrategy) {
-
- if (newLoadStrategy != null) {
- newLoadStrategy.setContainer(this);
- if (loadStrategy != null) {
- newLoadStrategy.setRendererType(loadStrategy.getRendererType());
- newLoadStrategy.setReadOnly(loadStrategy.isReadOnly());
- loadStrategy.setContainer(null);
- loadStrategy.close();
- }
- }
- loadStrategy = newLoadStrategy;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getFilesGen() {
- if (files == null) {
- files = new EObjectContainmentWithInverseEList(File.class, this, CommonarchivePackage.CONTAINER__FILES, CommonarchivePackage.FILE__CONTAINER);
- }
- return files;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- return ((InternalEList)getFiles()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- return ((InternalEList)getFiles()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- return getFiles();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- getFiles().clear();
- getFiles().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- getFiles().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.CONTAINER__FILES:
- return files != null && !files.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- public void clearFiles() {
- boolean oldDelivery = eDeliver();
- files.clear();
- eSetDeliver(oldDelivery);
- if (isIndexed()) {
- eAdapters().remove(fileIndexAdapter);
- fileIndexAdapter = null;
- fileIndex = null;
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EARFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EARFileImpl.java
deleted file mode 100644
index c0490c5af..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EARFileImpl.java
+++ /dev/null
@@ -1,1214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.application.ApplicationFactory;
-import org.eclipse.jst.j2ee.application.ApplicationPackage;
-import org.eclipse.jst.j2ee.application.ConnectorModule;
-import org.eclipse.jst.j2ee.application.EjbModule;
-import org.eclipse.jst.j2ee.application.JavaClientModule;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.application.WebModule;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.client.internal.impl.ApplicationClientResourceFactory;
-import org.eclipse.jst.j2ee.common.EjbRef;
-import org.eclipse.jst.j2ee.common.SecurityRole;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ObjectNotFoundException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EJBResource;
-import org.eclipse.jst.j2ee.ejb.EjbPackage;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EJBJarResourceFactory;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.jca.Connector;
-import org.eclipse.jst.j2ee.jca.internal.impl.ConnectorResourceFactory;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.internal.impl.WebAppResourceFactory;
-import org.eclipse.wst.common.internal.emf.resource.FileNameResourceFactoryRegistry;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-/**
- * @generated
- */
-public class EARFileImpl extends ModuleFileImpl implements EARFile {
-
- /**
- * Internal; clients should use {@link #getModuleRef(Module)}
- */
- public ModuleFile getModuleFile(Module moduleDescriptor) {
- ModuleRef ref = getModuleRef(moduleDescriptor);
- return (ref == null) ? null : ref.getModuleFile();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public ModuleFile addCopy(ModuleFile aModuleFile) throws DuplicateObjectException {
- Object result = primAddCopyRef(aModuleFile);
- if (result instanceof ModuleRef)
- return ((ModuleRef) result).getModuleFile();
-
- return (ModuleFile) result;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected Application deploymentDescriptor = null;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList moduleRefs = null;
-
- public EARFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.EAR_FILE;
- }
-
- @Override
- public Archive addCopy(Archive anArchive) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException {
- if (anArchive.isModuleFile())
- return addCopy((ModuleFile) anArchive);
- Archive copy = super.addCopy(anArchive);
- copy.initializeClassLoader();
- return copy;
- }
-
- protected Object primAddCopyRef(ModuleFile aModuleFile) throws DuplicateObjectException {
- //force this list to get initialized before the add
- EList refs = getModuleRefs();
-
- if (aModuleFile.isEARFile())
- //If it's an ear then just treat it like any other archive
- return super.addCopy(aModuleFile);
- checkAddValid(aModuleFile);
- ModuleFile copy = getCommonArchiveFactory().copy(aModuleFile);
- Module newModule = createModuleForCopying(aModuleFile);
- getFiles().add(copy);
- copy.initializeClassLoader();
- if (!copy.getURI().equals(newModule.getUri()))
- copy.setURI(newModule.getUri());
-
- getDeploymentDescriptor().getModules().add(newModule);
- ModuleRef aRef = createModuleRef(newModule, copy);
- refs.add(aRef);
- return aRef;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public ModuleRef addCopyRef(ModuleFile aModuleFile) throws DuplicateObjectException {
- Object result = primAddCopyRef(aModuleFile);
- if (result instanceof ModuleRef)
- return (ModuleRef) result;
-
- return null;
- }
-
-
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public SecurityRole addCopy(SecurityRole aRole, Module aModule) throws DuplicateObjectException {
- EObject dd = null;
- try {
- dd = getDeploymentDescriptor(aModule);
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
- }
- String roleName = aRole.getRoleName();
- SecurityRole copy = (SecurityRole) EtoolsCopyUtility.createCopy(aRole);
- if (aModule.isEjbModule()) {
- EJBJar ejbJar = (EJBJar) dd;
- if (ejbJar.containsSecurityRole(roleName))
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_sec_role_module_EXC_, (new Object[]{aModule.getUri(), roleName})), ejbJar.getAssemblyDescriptor().getSecurityRoleNamed(roleName)); // = "Deployment descriptor for {0} already contains a security role named {1}"
- getAssemblyDescriptorAddIfNecessary(ejbJar).getSecurityRoles().add(copy);
- } else if (aModule.isWebModule()) {
- WebApp webApp = (WebApp) dd;
- if (webApp.containsSecurityRole(roleName))
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_sec_role_module_EXC_, (new Object[]{aModule.getUri(), roleName})), webApp.getSecurityRoleNamed(roleName));// = "Deployment descriptor for {0} already contains a security role named {1}"
- webApp.getSecurityRoles().add(copy);
- }
- addCopyIfNotExists(aRole);
- return copy;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public SecurityRole addCopyIfNotExists(SecurityRole aRole) {
- Application dd = getDeploymentDescriptor();
- SecurityRole copy = null;
- if (!dd.containsSecurityRole(aRole.getRoleName())) {
- copy = (SecurityRole) EtoolsCopyUtility.createCopy(aRole);
- dd.getSecurityRoles().add(copy);
- }
- return copy;
- }
-
- protected void checkDuplicate(String aUri) throws DuplicateObjectException {
- if (isDuplicate(aUri))
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_resource_EXC_, (new Object[]{aUri, getURI()}))); // = "Resource named "{0}" already exists in archive "{1}""
- }
-
-
- protected Module createModuleForCopying(ModuleFile aModuleFile) {
- Module aModule = null;
- if (aModuleFile.isWARFile()) {
- aModule = getApplicationFactory().createWebModule();
- } else if (aModuleFile.isEJBJarFile()) {
- aModule = getApplicationFactory().createEjbModule();
- } else if (aModuleFile.isApplicationClientFile()) {
- aModule = getApplicationFactory().createJavaClientModule();
- } else if (aModuleFile.isRARFile()) {
- aModule = getApplicationFactory().createConnectorModule();
- }
- if(aModule != null){
- aModule.setUri(aModuleFile.getURI());
- }
- return aModule;
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- *
- * @return Only return null if an altDD is not defined.
- */
- public EObject getAltDeploymentDescriptor(Module aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- // Look for altDD
- String altDD = aModule.getAltDD();
- if (ArchiveUtil.isNullOrEmpty(altDD))
- return null;
- if (!isMofResourceLoaded(altDD.trim()))
- registerResourceFactory(aModule, altDD);
- XMLResource ddRes = (XMLResource) getMofResource(altDD.trim());
- if (!ddRes.isAlt()) {
- ddRes.setIsAlt(true);
- ddRes.setApplication(getDeploymentDescriptor());
- }
- return ArchiveUtil.getRoot(ddRes);
-
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public java.util.List getApplicationClientFiles() {
- List clientFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isApplicationClientFile()) {
- clientFiles.add(aFile);
- }
- }
- return clientFiles;
- }
-
- protected ApplicationFactory getApplicationFactory() {
- return ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory();
- }
-
- protected AssemblyDescriptor getAssemblyDescriptorAddIfNecessary(EJBJar ejbJar) {
- AssemblyDescriptor ad = ejbJar.getAssemblyDescriptor();
- if (ad == null) {
- ad = ((EjbPackage) EPackage.Registry.INSTANCE.getEPackage(EjbPackage.eNS_URI)).getEjbFactory().createAssemblyDescriptor();
- ejbJar.setAssemblyDescriptor(ad);
- }
- return ad;
- }
-
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
- public Application getDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- Application dd = this.getDeploymentDescriptorGen();
- if (dd == null && canLazyInitialize()) {
- try {
- getImportStrategy().importMetaData();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(getDeploymentDescriptorUri(), e);
- }
- }
- return this.getDeploymentDescriptorGen();
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- */
- public Connector getDeploymentDescriptor(ConnectorModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- return (Connector) getDeploymentDescriptor((Module) aModule);
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- */
- public EJBJar getDeploymentDescriptor(EjbModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- return (EJBJar) getDeploymentDescriptor((Module) aModule);
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- */
- public ApplicationClient getDeploymentDescriptor(JavaClientModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- return (ApplicationClient) getDeploymentDescriptor((Module) aModule);
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- */
- public EObject getDeploymentDescriptor(Module aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- EObject dd = getAltDeploymentDescriptor(aModule);
- if (dd == null)
- dd = getModuleFile(aModule).getStandardDeploymentDescriptor();
- return dd;
- }
-
- /**
- * Retrieves the deployment descriptor root element for the specified module. Takes into account
- * altDD indirection.
- */
- public WebApp getDeploymentDescriptor(WebModule aModule) throws FileNotFoundException, ResourceLoadException, EmptyResourceException {
- return (WebApp) getDeploymentDescriptor((Module) aModule);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.ModuleFile
- */
- @Override
- public java.lang.String getDeploymentDescriptorUri() {
- return J2EEConstants.APPLICATION_DD_URI;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public java.util.List getEJBJarFiles() {
- List ejbJarFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isEJBJarFile()) {
- ejbJarFiles.add(aFile);
- }
- }
- return ejbJarFiles;
- }
-
- /**
- * Return an enterprise bean referenced by the EjbRef, if one exists. The ejb-link value of the
- * ref must equate to a named enterprise bean contained in the jar; otherwise return null.
- * Returns the first hit found; assumption that the ejb names are unique within the scope of the
- * ear file. This will likely be replaced with a better way for dereferencing ejb refs.
- *
- * Can be used with ejb 1.1 references only.
- *
- * @deprecated {@link#getEnterpiseBeanFromRef(EjbRef ref, String moduleUri )
- * @param EjbRef
- * ref - An ejb reference
- * @return EnterpriseBean
- */
- public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref) {
- String link = ref.getLink();
- if (link == null) {
- return null;
- }
- List jarFiles = getEJBJarFiles();
- for (int i = 0; i < jarFiles.size(); i++) {
- EnterpriseBean bean = ((EJBJarFile) jarFiles.get(i)).getDeploymentDescriptor().getEnterpriseBeanNamed(link);
- if (bean != null) {
- return bean;
- }
- }
- return null;
- }
-
- /**
- * Return an enterprise bean referenced by the EjbRef, if one exists. The ejb-link value of the
- * ref must equate to a named enterprise bean contained in the jar; otherwise return null.
- * Returns the first hit found; assumption that the ejb names are unique within the scope of the
- * ear file. This will likely be replaced with a better way for dereferencing ejb refs
- *
- * Can be used with ejb 1.1 & ejb 2.0 references.
- *
- * @param EjbRef
- * ref - An ejb reference
- * @param String
- * moduleUri - The module uri
- * @return EnterpriseBean
- */
- public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref, String moduleUri) {
- String link = ref.getLink();
- if (link == null) {
- return null;
- }// if
-
- if (link.indexOf('#') == -1) {
- EnterpriseBean linkedEJB = null;
- XMLResource res = (XMLResource) ref.eResource();
- if (res instanceof EJBResource) {
- //Must be in an EJB JAR to be here
- EJBJar jar = ((EJBResource) res).getEJBJar();
- if (jar != null)
- linkedEJB = jar.getEnterpiseBeanFromRef(ref);
- }
- if (linkedEJB == null) {
- List jarFiles = getEJBJarFiles();
- for (int i = 0; i < jarFiles.size(); i++) {
- linkedEJB = ((EJBJarFile) jarFiles.get(i)).getDeploymentDescriptor().getEnterpriseBeanNamed(link);
- if (linkedEJB != null) {
- return linkedEJB;
- }// if
- }// for
- } else
- return linkedEJB;
- } else {
- //Grab the ejb name and ejb jar name from the link
- String ejbBeanName = link.substring(link.indexOf("#") + 1, link.length()); //$NON-NLS-1$
- String ejbJarName = link.substring(0, link.indexOf("#")); //$NON-NLS-1$
-
- if (ejbBeanName != null && ejbJarName != null) {
- //Get the uri of the jar name.
- String ejbJarUri = ArchiveUtil.deriveEARRelativeURI(ejbJarName, moduleUri);
- if (ejbJarUri != null) {
- try {
- //Get the actual jar file
- File aFile = getFile(ejbJarUri);
- if (aFile == null || !aFile.isEJBJarFile())
- return null;
-
- EJBJarFile jarFile = (EJBJarFile) getFile(ejbJarUri);
- List ejbs = jarFile.getDeploymentDescriptor().getEnterpriseBeans();
- //Check if any of the beans in the list match the given ejb bean name give
- // in
- //the link
- if (ejbs != null && !ejbs.isEmpty()) {
- Iterator it = ejbs.iterator();
- while (it.hasNext()) {
- EnterpriseBean ejbBean = (EnterpriseBean) it.next();
- if (ejbBean != null && ejbBean.getName().equals(ejbBeanName)) {
- return ejbBean;
- }// if
- }// while
- }// if
- } catch (FileNotFoundException fe) {
- return null;
- }// try
- }// if
- }// if
- }// if
- return null;
- }// getEnterpiseBeanFromRef
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public Module getModule(String aUri, String altDD) {
- return getDeploymentDescriptor().getModule(aUri, altDD);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public ModuleRef getModuleRef(Module moduleDescriptor) {
- List refs = getModuleRefs();
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.getModule() == moduleDescriptor)
- return ref;
- }
- return null;
- }
-
- /**
- * Return a filtered list of the archives
- */
- public List getModuleFiles() {
- List moduleFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isModuleFile()) {
- moduleFiles.add(aFile);
- }
- }
- return moduleFiles;
- }
-
- protected ArchiveOptions getOptionsForOpening(String aUri) throws IOException {
-
- LoadStrategy strategy = getCommonArchiveFactory().createChildLoadStrategy(aUri, getLoadStrategy());
- return getOptions().cloneWith(strategy, aUri);
- }
-
- protected ArchiveOptions getOptionsForOpening(LooseArchive loose) throws IOException, OpenFailureException{
- if(loose.getBinariesPath() == null){
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.open_nested_EXC_, (new Object[] {loose.getUri(), getURI()})), null); // = "Could not open the nested archive "{0}" in "{1}""
- }
- LoadStrategy strategy = getCommonArchiveFactory().createLoadStrategy(loose.getBinariesPath());
- strategy.setLooseArchive(loose);
- return getOptions().cloneWith(strategy, loose.getUri());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public java.util.List getRARFiles() {
- List rarFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isRARFile()) {
- rarFiles.add(aFile);
- }
- }
- return rarFiles;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public EList getRolesFromAllModules() {
- EList roleList = new org.eclipse.emf.common.util.BasicEList();
- List modules = getDeploymentDescriptor().getModules();
- for (int i = 0, n = modules.size(); i < n; i++) {
- Module aModule = (Module) modules.get(i);
- EList roles = getRolesFromModule(aModule);
- for (int j = 0, m = roles.size(); j < m; j++) {
- roleList.add(roles.get(j));
- }
- }
- return roleList;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public EList getRolesFromModule(Module aModule) {
- EList roleList = new org.eclipse.emf.common.util.BasicEList();
- try {
- if (aModule.isWebModule())
- roleList = getDeploymentDescriptor((WebModule) aModule).getSecurityRoles();
- else if (aModule.isEjbModule())
- roleList = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule)).getSecurityRoles();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
- }
- return roleList;
- }
-
- /**
- * Return the DeployementDescriptor.
- */
- public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- return getDeploymentDescriptor();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public java.util.List getWARFiles() {
- List warFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isWARFile()) {
- warFiles.add(aFile);
- }
- }
- return warFiles;
- }
-
- @Override
- public void initializeAfterOpen() {
- super.initializeAfterOpen();
- }
-
- @Override
- public boolean isDeploymentDescriptorSet() {
- return deploymentDescriptor != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isEARFile() {
- return true;
- }
-
- /**
- * Return true if super returns true, or return whether the app dd contains a module having the
- * uri
- */
- @Override
- public boolean isNestedArchive(String aUri) {
- if (super.isNestedArchive(aUri))
- return true;
- return getDeploymentDescriptor().getFirstModule(aUri) != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public org.eclipse.emf.ecore.EObject makeDeploymentDescriptor(XMLResource resource) {
- Application appl = ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory().createApplication();
- resource.setID(appl, J2EEConstants.APPL_ID);
- setDeploymentDescriptorGen(appl);
- resource.getContents().add(appl);
- return appl;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- @Override
- public Archive openNestedArchive(LooseArchive loose) throws OpenFailureException {
-
- Module m = getDeploymentDescriptor().getFirstModule(loose.getUri());
- if (m == null)
- return super.openNestedArchive(loose);
-
- try {
- ArchiveOptions archiveOptions = getOptionsForOpening(loose);
- return openNestedArchive(m, archiveOptions);
- } catch (java.io.IOException ex) {
- //Probably the file did not exist; silently fail, per request from WS runtime
- //More than likely a failure is going to occur down the road when a ModuleFile for a
- // Module
- //in the dd is requested
- }
- return null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- @Override
- public Archive openNestedArchive(String aUri) throws OpenFailureException {
-
- Module m = getDeploymentDescriptor().getFirstModule(aUri);
- if (m == null)
- return super.openNestedArchive(aUri);
-
- try {
- ArchiveOptions archiveOptions = getOptionsForOpening(aUri);
- return openNestedArchive(m, archiveOptions);
- } catch (java.io.IOException ex) {
- //Probably the file did not exist; silently fail, per request from WS runtime
- //More than likely a failure is going to occur down the road when a ModuleFile for a
- // Module
- //in the dd is requested
- }
- return null;
- }
-
- protected Archive openNestedArchive(Module m, ArchiveOptions archiveOptions) throws OpenFailureException {
- String aUri = m.getUri();
-
- try {
- /*
- * Since we have a clue about the type of archive to open Use the appropriate open
- * method, so if a failure occurrs, we can get a more specific message
- */
- if (m.isWebModule())
- return getCommonArchiveFactory().openWARFile(archiveOptions, aUri);
- else if (m.isEjbModule())
- return getCommonArchiveFactory().openEJBJarFile(archiveOptions, aUri);
- else if (m.isJavaModule())
- return getCommonArchiveFactory().openApplicationClientFile(archiveOptions, aUri);
- else if (m.isConnectorModule())
- return getCommonArchiveFactory().openRARFile(archiveOptions, aUri);
-
- } catch (OpenFailureException ex) {
- throw new OpenFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.nested_open_fail_EXC_, (new Object[]{aUri, getURI()})), ex); // = "Unable to open module file "{0}" in EAR file "{1}""
- }
- //Should never reach the code below
- return null;
- }
-
- /**
- * @see EARFile
- */
- public void pushDownRole(SecurityRole role) {
- if (role == null)
- throw new IllegalArgumentException(CommonArchiveResourceHandler.Parameter_should_not_be_nu_EXC_); // = "Parameter should not be null"
-
- List modules = getDeploymentDescriptor().getModules();
- for (int i = 0; i < modules.size(); i++) {
- Module m = (Module) modules.get(i);
- pushDownRole(role, m);
- }
- }
-
- /**
- * @see EARFile
- */
- public void pushDownRole(SecurityRole role, Module aModule) {
- try {
- if (aModule.isWebModule()) {
- WebApp dd = getDeploymentDescriptor((WebModule) aModule);
- if (dd.getSecurityRoleNamed(role.getRoleName()) == null)
- dd.getSecurityRoles().add(EtoolsCopyUtility.createCopy(role));
- } else if (aModule.isEjbModule()) {
- AssemblyDescriptor assembly = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule));
- if (assembly.getSecurityRoleNamed(role.getRoleName()) == null)
- assembly.getSecurityRoles().add(EtoolsCopyUtility.createCopy(role));
- }
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
- }
- }
-
- /**
- * An alt-dd is about to be loaded; register the appropriate resource factory for the uri so it
- * will get loaded correctly.
- */
- protected void registerResourceFactory(Module aModule, String aUri) {
- org.eclipse.emf.ecore.resource.Resource.Factory factory = null;
- if (aModule.isEjbModule())
- factory = EJBJarResourceFactory.getRegisteredFactory();
- else if (aModule.isWebModule())
- factory = WebAppResourceFactory.getRegisteredFactory();
- else if (aModule.isJavaModule())
- factory = ApplicationClientResourceFactory.getRegisteredFactory();
- else if (aModule.isConnectorModule())
- factory = ConnectorResourceFactory.getRegisteredFactory();
-
- if (factory != null) {
- ResourceSet set = getResourceSet();
- ((FileNameResourceFactoryRegistry) set.getResourceFactoryRegistry()).registerLastFileSegment(aUri, factory);
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public void remove(ModuleRef aModuleRef) {
- if (aModuleRef == null)
- return;
- Module aModule = aModuleRef.getModule();
-
- if (aModule != null)
- getDeploymentDescriptor().getModules().remove(aModule);
-
- getModuleRefs().remove(aModuleRef);
- if (getModuleRefs(aModuleRef.getModuleFile()).isEmpty())
- getFiles().remove(aModuleRef.getModuleFile());
- }
-
- /**
- * @see EARFile
- */
- public List getModuleRefs(ModuleFile aModuleFile) {
- List refs = getModuleRefs();
- List result = new ArrayList(1);
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.getModuleFile() == aModuleFile)
- result.add(ref);
- }
- return result;
- }
-
- protected void renameRolesInModuleDDs(String existingRoleName, String newRoleName) {
- List modules = getDeploymentDescriptor().getModules();
- for (int i = 0; i < modules.size(); i++) {
- Module m = (Module) modules.get(i);
- try {
- if (m.isEjbModule())
- getDeploymentDescriptor((EjbModule) m).renameSecurityRole(existingRoleName, newRoleName);
- else if (m.isWebModule())
- getDeploymentDescriptor((WebModule) m).renameSecurityRole(existingRoleName, newRoleName);
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{m.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
- }
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public void renameSecurityRole(String existingRoleName, String newRoleName) throws ObjectNotFoundException, DuplicateObjectException {
- Application app = getDeploymentDescriptor();
- SecurityRole aRole = app.getSecurityRoleNamed(existingRoleName);
- if (aRole == null)
- throw new ObjectNotFoundException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.no_sec_role_EXC_, (new Object[]{getURI(), existingRoleName}))); // = ": EAR File deployment descriptor does not contain a security role named "
- if (app.getSecurityRoleNamed(newRoleName) != null)
- throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_sec_role_EXC_, (new Object[]{getURI(), newRoleName})), app.getSecurityRoleNamed(newRoleName)); // = ": EAR File deployment descriptor already contains a security role named "
-
- aRole.setRoleName(newRoleName);
-
- renameRolesInModuleDDs(existingRoleName, newRoleName);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public void rollUpRoles() {
- List modules = getDeploymentDescriptor().getModules();
- for (int i = 0; i < modules.size(); i++) {
- Module aModule = (Module) modules.get(i);
- rollUpRoles(aModule);
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EARFile
- */
- public void rollUpRoles(Module aModule) {
- List securityRoles = null;
- try {
- if (aModule.isWebModule())
- securityRoles = getDeploymentDescriptor((WebModule) aModule).getSecurityRoles();
- else if (aModule.isEjbModule())
- securityRoles = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule)).getSecurityRoles();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
- }
-
- if (securityRoles == null)
- return;
- for (int i = 0; i < securityRoles.size(); i++) {
- addCopyIfNotExists((SecurityRole) securityRoles.get(i));
- }
- }
-
- public void setDeploymentDescriptor(Application l) {
- this.setDeploymentDescriptorGen(l);
- replaceRoot(getMofResourceMakeIfNecessary(getDeploymentDescriptorUri()), l);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public Application getDeploymentDescriptorGen() {
- if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) {
- InternalEObject oldDeploymentDescriptor = (InternalEObject)deploymentDescriptor;
- deploymentDescriptor = (Application)eResolveProxy(oldDeploymentDescriptor);
- if (deploymentDescriptor != oldDeploymentDescriptor) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
- }
- return deploymentDescriptor;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public Application basicGetDeploymentDescriptor() {
- return deploymentDescriptor;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDeploymentDescriptorGen(Application newDeploymentDescriptor) {
- Application oldDeploymentDescriptor = deploymentDescriptor;
- deploymentDescriptor = newDeploymentDescriptor;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- return ((InternalEList)getModuleRefs()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- return ((InternalEList)getModuleRefs()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- return getModuleRefs();
- case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR:
- if (resolve) return getDeploymentDescriptor();
- return basicGetDeploymentDescriptor();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- getModuleRefs().clear();
- getModuleRefs().addAll((Collection)newValue);
- return;
- case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((Application)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- getModuleRefs().clear();
- return;
- case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((Application)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.EAR_FILE__MODULE_REFS:
- return moduleRefs != null && !moduleRefs.isEmpty();
- case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR:
- return deploymentDescriptor != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getModuleRefsGen() {
- if (moduleRefs == null) {
- moduleRefs = new EObjectContainmentWithInverseEList(ModuleRef.class, this, CommonarchivePackage.EAR_FILE__MODULE_REFS, CommonarchivePackage.MODULE_REF__EAR_FILE);
- }
- return moduleRefs;
- }
-
- public EList getModuleRefs() {
- EList refs = getModuleRefsGen();
-
- if (refs.isEmpty())
- initRefs(refs);
-
- return refs;
- }
-
- public void initRefs(EList refs) {
- List modules = getDeploymentDescriptor().getModules();
- for (int i = 0; i < modules.size(); i++) {
- Module module = (Module) modules.get(i);
- refs.add(createModuleRef(module, null));
- }
- }
-
- protected ModuleRef createModuleRef(Module aModule, ModuleFile aFile) {
- ModuleRef newRef = null;
-
- if (aModule.isEjbModule())
- newRef = getCommonArchiveFactory().createEJBModuleRef();
- else if (aModule.isWebModule())
- newRef = getCommonArchiveFactory().createWebModuleRef();
- else if (aModule.isConnectorModule())
- newRef = getCommonArchiveFactory().createConnectorModuleRef();
- else if (aModule.isJavaModule())
- newRef = getCommonArchiveFactory().createClientModuleRef();
- if(newRef != null){
- newRef.setModule(aModule);
- newRef.setModuleFile(aFile);
- }
- return newRef;
- }
-
- /*
- * @see EARFile#getClientModuleRefs()
- */
- public List getClientModuleRefs() {
- List result = new ArrayList();
- List refs = getModuleRefs();
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.isClient())
- result.add(ref);
- }
- return result;
- }
-
- /*
- * @see EARFile#getConnectorModuleRefs()
- */
- public List getConnectorModuleRefs() {
- List result = new ArrayList();
- List refs = getModuleRefs();
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.isConnector())
- result.add(ref);
- }
- return result;
- }
-
- /*
- * @see EARFile#getEJBModuleRefs()
- */
- public List getEJBModuleRefs() {
- List result = new ArrayList();
- List refs = getModuleRefs();
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.isEJB())
- result.add(ref);
- }
- return result;
- }
-
- /*
- * @see EARFile#getWebModuleRefs()
- */
- public List getWebModuleRefs() {
- List result = new ArrayList();
- List refs = getModuleRefs();
- for (int i = 0; i < refs.size(); i++) {
- ModuleRef ref = (ModuleRef) refs.get(i);
- if (ref.isWeb())
- result.add(ref);
- }
- return result;
- }
-
- /*
- * @see EARFile#getFARFiles()
- */
- public List getFARFiles() {
- List farFiles = new ArrayList();
- List fileList = getFiles();
- for (int i = 0; i < fileList.size(); i++) {
- File aFile = (File) fileList.get(i);
- if (aFile.isFARFile()) {
- farFiles.add(aFile);
- }
- }
- return farFiles;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.commonarchive.EARFile#getArchivesOfType(java.lang.String)
- */
- public List getArchivesOfType(String type) {
- return Collections.EMPTY_LIST;
- }
-
- public Map getEJBReferences(boolean filterLinkedReferences, boolean filterNonLinkedReferences) throws ArchiveWrappedException {
- if (!filterLinkedReferences || !filterNonLinkedReferences) {
- Application app = getDeploymentDescriptor();
- if (app != null) {
- List modules = app.getModules();
- Module module;
- Map references = null;
- for (int i = 0; i < modules.size(); i++) {
- module = (Module) modules.get(i);
- try {
- references = collectEJBReferences(module, filterLinkedReferences, filterNonLinkedReferences, references);
- } catch (ResourceLoadException e) {
- throw new ArchiveWrappedException(e);
- } catch (FileNotFoundException e) {
- throw new ArchiveWrappedException(e);
- } catch (EmptyResourceException e) {
- throw new ArchiveWrappedException(e);
- }
- }
- return references;
- }
- }
- return Collections.EMPTY_MAP;
- }
-
- /**
- * @param module
- * @param filterLinkedReferences
- * @param filterNonLinkedReferences
- * @param references
- * @return
- */
- private Map collectEJBReferences(Module module, boolean filterLinkedReferences, boolean filterNonLinkedReferences, Map references) throws ResourceLoadException, FileNotFoundException, EmptyResourceException {
- Map myReferences = references;
- List moduleReferences = getEJBReferneces(module);
- if (moduleReferences != null && !moduleReferences.isEmpty()) {
- EjbRef ref = null;
- List filteredRefs = null;
- String link = null;
- for (int i = 0; i < moduleReferences.size(); i++) {
- ref = (EjbRef) moduleReferences.get(i);
- link = ref.getLink();
- if ((link != null && link.length() > 0 && !filterLinkedReferences) || ((link == null || link.length() == 0) && !filterNonLinkedReferences)) {
- if (filteredRefs == null)
- filteredRefs = new ArrayList(moduleReferences.size());
- filteredRefs.add(ref);
- }
- }
- if (filteredRefs != null) {
- if (myReferences == null)
- myReferences = new HashMap();
- myReferences.put(module, filteredRefs);
- }
- }
- return myReferences;
- }
-
- /**
- * @param module
- * @return
- */
- private List getEJBReferneces(Module module) throws ResourceLoadException, FileNotFoundException, EmptyResourceException {
- if (module != null) {
- if (module.isEjbModule()) {
- EJBJar ejbJar = getDeploymentDescriptor((EjbModule) module);
- return getEJBReferences(ejbJar);
- } else if (module.isWebModule()) {
- WebApp webApp = getDeploymentDescriptor((WebModule) module);
- if (webApp != null)
- return webApp.getEjbRefs();
- } else if (module.isJavaModule()) {
- ApplicationClient appClient = getDeploymentDescriptor((JavaClientModule) module);
- if (appClient != null)
- return appClient.getEjbReferences();
- }
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @param ejbJar
- * @return
- */
- private List getEJBReferences(EJBJar ejbJar) {
- if (ejbJar != null) {
- List ejbs = ejbJar.getEnterpriseBeans();
- List refs = null;
- EnterpriseBean ejb = null;
- for (int i = 0; i < ejbs.size(); i++) {
- ejb = (EnterpriseBean) ejbs.get(i);
- if (refs == null)
- refs = new ArrayList();
- refs.addAll(ejb.getEjbRefs());
- }
- if (refs != null)
- return refs;
- }
- return Collections.EMPTY_LIST;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBJarFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBJarFileImpl.java
deleted file mode 100644
index 506210647..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBJarFileImpl.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EjbPackage;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Entity;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-
-
-/**
- * @generated
- */
-public class EJBJarFileImpl extends ModuleFileImpl implements EJBJarFile {
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EJBJar deploymentDescriptor = null;
-
- public EJBJarFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.EJB_JAR_FILE;
- }
-
- /**
- * Used for tools performing selective import
- */
- public List getAssociatedFiles(EnterpriseBean ejb) {
-
- List classNames = new java.util.ArrayList();
- List result = new ArrayList();
- if (ejb.getVersionID() <= J2EEVersionConstants.EJB_1_1_ID) {
- classNames.add(ejb.getHomeInterfaceName());
- classNames.add(ejb.getRemoteInterfaceName());
- } else if (ejb.getVersionID() >= J2EEVersionConstants.EJB_2_0_ID) {
- if (ejb.hasRemoteClient()) {
- classNames.add(ejb.getHomeInterfaceName());
- classNames.add(ejb.getRemoteInterfaceName());
- }
- if (ejb.hasLocalClient()) {
- classNames.add(ejb.getLocalHomeInterfaceName());
- classNames.add(ejb.getLocalInterfaceName());
- }
- }
- classNames.add(ejb.getEjbClassName());
-
- if (ejb.isEntity()) {
- String className = ((Entity) ejb).getPrimaryKeyName();
- if (!className.startsWith("java"))//$NON-NLS-1$
- classNames.add(className);
- }
- for (int i = 0; i < classNames.size(); i++) {
- String className = (String) classNames.get(i);
- if (className == null)
- continue;
- String classUri = org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.classNameToUri(className);
- String javaUri = org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.classNameToJavaUri(className);
- try {
- result.add(getFile(classUri));
- } catch (java.io.FileNotFoundException iox) {
- //Do nothing - the file does not exist in this jar file
- }
- try {
- result.add(getFile(javaUri));
- } catch (java.io.FileNotFoundException iox) {
- //Do nothing - the file does not exist in this jar file
- }
- }
- return result;
- }
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
- public EJBJar getDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- EJBJar dd = this.getDeploymentDescriptorGen();
- if (dd == null && canLazyInitialize()) {
- try {
- getImportStrategy().importMetaData();
- } catch (DeploymentDescriptorLoadException ex) {
- throw ex;
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(getDeploymentDescriptorUri(), e);
- }
- }
- return this.getDeploymentDescriptorGen();
- }
-
- @Override
- public java.lang.String getDeploymentDescriptorUri() {
- return J2EEConstants.EJBJAR_DD_URI;
- }
-
- /**
- * Return the DeployementDescriptor.
- */
- public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- return getDeploymentDescriptor();
- }
-
- @Override
- public boolean isDeploymentDescriptorSet() {
- return deploymentDescriptor != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isEJBJarFile() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.EJBJarFile
- */
- public boolean isImportedFrom10() {
- return getImportStrategy() != null && getImportStrategy().isEJB10();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public org.eclipse.emf.ecore.EObject makeDeploymentDescriptor(XMLResource resource) {
- EJBJar ejbJar = ((EjbPackage) EPackage.Registry.INSTANCE.getEPackage(EjbPackage.eNS_URI)).getEjbFactory().createEJBJar();
- resource.setID(ejbJar, J2EEConstants.EJBJAR_ID);
- setDeploymentDescriptorGen(ejbJar);
- resource.getContents().add(ejbJar);
-
- return ejbJar;
- }
-
-
- public void setDeploymentDescriptor(EJBJar l) {
- this.setDeploymentDescriptorGen(l);
- replaceRoot(getMofResourceMakeIfNecessary(getDeploymentDescriptorUri()), l);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EJBJar getDeploymentDescriptorGen() {
- if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) {
- InternalEObject oldDeploymentDescriptor = (InternalEObject)deploymentDescriptor;
- deploymentDescriptor = (EJBJar)eResolveProxy(oldDeploymentDescriptor);
- if (deploymentDescriptor != oldDeploymentDescriptor) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
- }
- return deploymentDescriptor;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EJBJar basicGetDeploymentDescriptor() {
- return deploymentDescriptor;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDeploymentDescriptorGen(EJBJar newDeploymentDescriptor) {
- EJBJar oldDeploymentDescriptor = deploymentDescriptor;
- deploymentDescriptor = newDeploymentDescriptor;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR:
- if (resolve) return getDeploymentDescriptor();
- return basicGetDeploymentDescriptor();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((EJBJar)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((EJBJar)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR:
- return deploymentDescriptor != null;
- }
- return super.eIsSet(featureID);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBModuleRefImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBModuleRefImpl.java
deleted file mode 100644
index b70124d05..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBModuleRefImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-
-/**
- * @generated
- */
-public class EJBModuleRefImpl extends ModuleRefImpl implements EJBModuleRef {
-
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EJBModuleRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.EJB_MODULE_REF;
- }
-
- public EJBJar getEJBJar() throws ArchiveWrappedException {
- return (EJBJar) getDeploymentDescriptor();
- }
-
- /*
- * @see ModuleRef#isEJB()
- */
- @Override
- public boolean isEJB() {
- return true;
- }
-
-} //EJBModuleRefImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/FileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/FileImpl.java
deleted file mode 100644
index e3881a183..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/FileImpl.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEEObjectImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-
-
-
-/**
- * @generated
- */
-public class FileImpl extends J2EEEObjectImpl implements File {
-
- /**
- * The default value of the '{@link #getURI() <em>URI</em>}' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @see #getURI()
- * @generated
- * @ordered
- */
- protected static final String URI_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String uri = URI_EDEFAULT;
- /**
- * The default value of the '{@link #getLastModified() <em>Last Modified</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #getLastModified()
- * @generated
- * @ordered
- */
- protected static final long LAST_MODIFIED_EDEFAULT = 0L;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected long lastModified = LAST_MODIFIED_EDEFAULT;
- /**
- * This is true if the Last Modified attribute has been set.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean lastModifiedESet = false;
-
- /**
- * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected static final long SIZE_EDEFAULT = 0L;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected long size = SIZE_EDEFAULT;
- /**
- * This is true if the Size attribute has been set. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
- *
- * @generated
- * @ordered
- */
- protected boolean sizeESet = false;
-
- /**
- * The default value of the '{@link #isDirectoryEntry() <em>Directory Entry</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #isDirectoryEntry()
- * @generated
- * @ordered
- */
- protected static final boolean DIRECTORY_ENTRY_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDirectoryEntry() <em>Directory Entry</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #isDirectoryEntry()
- * @generated
- * @ordered
- */
- protected boolean directoryEntry = DIRECTORY_ENTRY_EDEFAULT;
-
- /**
- * This is true if the Directory Entry attribute has been set.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean directoryEntryESet = false;
-
- /**
- * The default value of the '{@link #getOriginalURI() <em>Original URI</em>}' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getOriginalURI()
- * @generated
- * @ordered
- */
- protected static final String ORIGINAL_URI_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String originalURI = ORIGINAL_URI_EDEFAULT;
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected Container loadingContainer = null;
-
- public FileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.FILE;
- }
-
- public CommonarchiveFactory getCommonArchiveFactory() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory();
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public java.lang.String getDirectoryURI() {
- return ArchiveUtil.getFileNameParent(getURI());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public java.io.InputStream getInputStream() throws java.io.FileNotFoundException, java.io.IOException {
- return getLoadingContainer().primGetInputStream(getOriginalURI());
- }
-
- public String getName() {
- return ArchiveUtil.getFileNameTail(getURI());
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isApplicationClientFile() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isArchive() {
- return false;
- }
-
- /**
- * isContainer method comment.
- */
- public boolean isContainer() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isEARFile() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isEJBJarFile() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isModuleFile() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isRARFile() {
- return false;
- }
-
- /**
- * isReadOnlyDirectory method comment.
- */
- public boolean isReadOnlyDirectory() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- public boolean isWARFile() {
- return false;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setURI(String newURI) {
- String oldURI = uri;
- uri = newURI;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__URI, oldURI, uri));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public long getLastModified() {
- return lastModified;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setLastModified(long newLastModified) {
- long oldLastModified = lastModified;
- lastModified = newLastModified;
- boolean oldLastModifiedESet = lastModifiedESet;
- lastModifiedESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__LAST_MODIFIED, oldLastModified, lastModified, !oldLastModifiedESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void unsetLastModified() {
- long oldLastModified = lastModified;
- boolean oldLastModifiedESet = lastModifiedESet;
- lastModified = LAST_MODIFIED_EDEFAULT;
- lastModifiedESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, CommonarchivePackage.FILE__LAST_MODIFIED, oldLastModified, LAST_MODIFIED_EDEFAULT, oldLastModifiedESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public boolean isSetLastModified() {
- return lastModifiedESet;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public long getSize() {
- return size;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setSize(long newSize) {
- long oldSize = size;
- size = newSize;
- boolean oldSizeESet = sizeESet;
- sizeESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__SIZE, oldSize, size, !oldSizeESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void unsetSize() {
- long oldSize = size;
- boolean oldSizeESet = sizeESet;
- size = SIZE_EDEFAULT;
- sizeESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, CommonarchivePackage.FILE__SIZE, oldSize, SIZE_EDEFAULT, oldSizeESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public boolean isSetSize() {
- return sizeESet;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public boolean isDirectoryEntry() {
- return directoryEntry;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setDirectoryEntry(boolean newDirectoryEntry) {
- boolean oldDirectoryEntry = directoryEntry;
- directoryEntry = newDirectoryEntry;
- boolean oldDirectoryEntryESet = directoryEntryESet;
- directoryEntryESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__DIRECTORY_ENTRY, oldDirectoryEntry, directoryEntry, !oldDirectoryEntryESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void unsetDirectoryEntry() {
- boolean oldDirectoryEntry = directoryEntry;
- boolean oldDirectoryEntryESet = directoryEntryESet;
- directoryEntry = DIRECTORY_ENTRY_EDEFAULT;
- directoryEntryESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, CommonarchivePackage.FILE__DIRECTORY_ENTRY, oldDirectoryEntry, DIRECTORY_ENTRY_EDEFAULT, oldDirectoryEntryESet));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public boolean isSetDirectoryEntry() {
- return directoryEntryESet;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getOriginalURI() {
- return originalURI;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setOriginalURI(String newOriginalURI) {
- String oldOriginalURI = originalURI;
- originalURI = newOriginalURI;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__ORIGINAL_URI, oldOriginalURI, originalURI));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public Container getLoadingContainer() {
- if (loadingContainer != null && loadingContainer.eIsProxy()) {
- InternalEObject oldLoadingContainer = (InternalEObject)loadingContainer;
- loadingContainer = (Container)eResolveProxy(oldLoadingContainer);
- if (loadingContainer != oldLoadingContainer) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.FILE__LOADING_CONTAINER, oldLoadingContainer, loadingContainer));
- }
- }
- return loadingContainer;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public Container basicGetLoadingContainer() {
- return loadingContainer;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setLoadingContainer(Container newLoadingContainer) {
- Container oldLoadingContainer = loadingContainer;
- loadingContainer = newLoadingContainer;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__LOADING_CONTAINER, oldLoadingContainer, loadingContainer));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public Container getContainer() {
- if (eContainerFeatureID != CommonarchivePackage.FILE__CONTAINER) return null;
- return (Container)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetContainer(Container newContainer, NotificationChain msgs) {
- NotificationChain innerMsgs = eBasicSetContainer((InternalEObject)newContainer, CommonarchivePackage.FILE__CONTAINER, msgs);
- return innerMsgs;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setContainer(Container newContainer) {
- if (newContainer != eInternalContainer() || (eContainerFeatureID != CommonarchivePackage.FILE__CONTAINER && newContainer != null)) {
- if (EcoreUtil.isAncestor(this, newContainer))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newContainer != null)
- msgs = ((InternalEObject)newContainer).eInverseAdd(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs);
- msgs = basicSetContainer(newContainer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.FILE__CONTAINER, newContainer, newContainer));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.FILE__CONTAINER:
- NotificationChain innerMsgs = msgs;
- if (eInternalContainer() != null){
- innerMsgs = eBasicRemoveFromContainer(msgs);
- }
- return basicSetContainer((Container)otherEnd, innerMsgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.FILE__CONTAINER:
- return basicSetContainer(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case CommonarchivePackage.FILE__CONTAINER:
- return eInternalContainer().eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.FILE__URI:
- return getURI();
- case CommonarchivePackage.FILE__LAST_MODIFIED:
- return new Long(getLastModified());
- case CommonarchivePackage.FILE__SIZE:
- return new Long(getSize());
- case CommonarchivePackage.FILE__DIRECTORY_ENTRY:
- return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE;
- case CommonarchivePackage.FILE__ORIGINAL_URI:
- return getOriginalURI();
- case CommonarchivePackage.FILE__LOADING_CONTAINER:
- if (resolve) return getLoadingContainer();
- return basicGetLoadingContainer();
- case CommonarchivePackage.FILE__CONTAINER:
- return getContainer();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.FILE__URI:
- setURI((String)newValue);
- return;
- case CommonarchivePackage.FILE__LAST_MODIFIED:
- setLastModified(((Long)newValue).longValue());
- return;
- case CommonarchivePackage.FILE__SIZE:
- setSize(((Long)newValue).longValue());
- return;
- case CommonarchivePackage.FILE__DIRECTORY_ENTRY:
- setDirectoryEntry(((Boolean)newValue).booleanValue());
- return;
- case CommonarchivePackage.FILE__ORIGINAL_URI:
- setOriginalURI((String)newValue);
- return;
- case CommonarchivePackage.FILE__LOADING_CONTAINER:
- setLoadingContainer((Container)newValue);
- return;
- case CommonarchivePackage.FILE__CONTAINER:
- setContainer((Container)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.FILE__URI:
- setURI(URI_EDEFAULT);
- return;
- case CommonarchivePackage.FILE__LAST_MODIFIED:
- unsetLastModified();
- return;
- case CommonarchivePackage.FILE__SIZE:
- unsetSize();
- return;
- case CommonarchivePackage.FILE__DIRECTORY_ENTRY:
- unsetDirectoryEntry();
- return;
- case CommonarchivePackage.FILE__ORIGINAL_URI:
- setOriginalURI(ORIGINAL_URI_EDEFAULT);
- return;
- case CommonarchivePackage.FILE__LOADING_CONTAINER:
- setLoadingContainer((Container)null);
- return;
- case CommonarchivePackage.FILE__CONTAINER:
- setContainer((Container)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.FILE__URI:
- return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
- case CommonarchivePackage.FILE__LAST_MODIFIED:
- return isSetLastModified();
- case CommonarchivePackage.FILE__SIZE:
- return isSetSize();
- case CommonarchivePackage.FILE__DIRECTORY_ENTRY:
- return isSetDirectoryEntry();
- case CommonarchivePackage.FILE__ORIGINAL_URI:
- return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI);
- case CommonarchivePackage.FILE__LOADING_CONTAINER:
- return loadingContainer != null;
- case CommonarchivePackage.FILE__CONTAINER:
- return getContainer() != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (URI: "); //$NON-NLS-1$
- result.append(uri);
- result.append(", lastModified: "); //$NON-NLS-1$
- if (lastModifiedESet) result.append(lastModified); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", size: "); //$NON-NLS-1$
- if (sizeESet) result.append(size); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", directoryEntry: "); //$NON-NLS-1$
- if (directoryEntryESet) result.append(directoryEntry); else result.append("<unset>"); //$NON-NLS-1$
- result.append(", originalURI: "); //$NON-NLS-1$
- result.append(originalURI);
- result.append(')');
- return result.toString();
- }
-
- /*
- * @see File#isFARFile()
- */
- public boolean isFARFile() {
- return false;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleFileImpl.java
deleted file mode 100644
index 786af741c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleFileImpl.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.FileNotFoundException;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-
-
-/**
- * @generated
- */
-public abstract class ModuleFileImpl extends ArchiveImpl implements ModuleFile {
-
- /** Implementer for extracting meta-data from this archive into the root object */
- protected ImportStrategy importStrategy;
- /** Implementer for adding meta-data to an about-to-be-exported archive */
- protected ExportStrategy exportStrategy;
-
- public ModuleFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.MODULE_FILE;
- }
-
- protected boolean canLazyInitialize() {
- return getImportStrategy() != null;
- }
-
- public Resource getDeploymentDescriptorResource() throws java.io.FileNotFoundException, ResourceLoadException {
- return getMofResource(getDeploymentDescriptorUri());
- }
-
- /**
- * Subclasses must override
- */
- public abstract String getDeploymentDescriptorUri();
-
- /**
- * @see com.ibm.etools.commonarchive.ModuleFile
- */
- @Override
- public EARFile getEARFile() {
- Container aContainer = getContainer();
- if (aContainer == null || !aContainer.isEARFile()) {
- return null;
- }
- return ((EARFile) aContainer);
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.ExportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy getExportStrategy() {
- return exportStrategy;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @return com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy getImportStrategy() {
- return importStrategy;
- }
-
- /**
- * Returns the specification version of the module file, or empty string if unknown version. For
- * example, "2.0"
- *
- * @deprecated, Use getDeploymentDescriptorResource().getModuleVersionID();
- */
- public String getSpecVersion() {
- float ver = getSpecVersionID();
- Float specVersion = new Float(ver / 10);
- return specVersion.toString();
- }
-
- /**
- * Return the version ID of the module For example, "20"
- *
- * @return int
- */
- public int getSpecVersionID() {
- try {
- return ((XMLResource) getDeploymentDescriptorResource()).getModuleVersionID();
- } catch (Exception e) {
- throw new ArchiveRuntimeException(e);
- }
- }
-
- /**
- * @see com.ibm.etools.commonarchive.ModuleFile
- */
- public abstract boolean isDeploymentDescriptorSet();
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isModuleFile() {
- return true;
- }
-
-
-
- /**
- * subclasses must override
- */
- public abstract EObject makeDeploymentDescriptor(XMLResource resource);
-
- public Resource makeDeploymentDescriptorResource() {
- XMLResource resource = null;
- try {
- resource = (XMLResource) makeMofResource(getDeploymentDescriptorUri());
- } catch (DuplicateObjectException ex) {
- try {
- return getDeploymentDescriptorResource();
- } catch (java.io.FileNotFoundException fnfEx) {
- //Ignore
- }
- }
- makeDeploymentDescriptor(resource);
- return resource;
- }
-
- @Override
- public void save(SaveStrategy aSaveStrategy) throws SaveFailureException {
- setSaveStrategy(aSaveStrategy);
- if (getExportStrategy() != null)
- getExportStrategy().preSave(aSaveStrategy);
- super.save(aSaveStrategy);
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newExportStrategy
- * com.ibm.etools.archive.ExportStrategy
- */
- public void setExportStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy newExportStrategy) {
- exportStrategy = newExportStrategy;
- if (newExportStrategy != null) {
- newExportStrategy.setArchive(this);
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (11/29/00 6:35:08 PM)
- *
- * @param newImportStrategy
- * com.ibm.etools.archive.ImportStrategy
- */
- public void setImportStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy newImportStrategy) {
- importStrategy = newImportStrategy;
- if (newImportStrategy != null) {
- newImportStrategy.setArchive(this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.commonarchive.ModuleFile#setJ2EEVersion(int)
- */
- public void setJ2EEVersion(int versionID) {
- try {
- ((XMLResource) getDeploymentDescriptorResource()).setVersionID(versionID);
- } catch (ResourceLoadException e) {
- throw e;
- } catch (FileNotFoundException e) {
- throw new ArchiveRuntimeException(e);
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleRefImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleRefImpl.java
deleted file mode 100644
index 316fa78d8..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleRefImpl.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEEObjectImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.NoModuleFileException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-
-/**
- * @generated
- */
-public abstract class ModuleRefImpl extends J2EEEObjectImpl implements ModuleRef {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected ModuleFile moduleFile = null;
- /**
- * The cached value of the '{@link #getModule() <em>Module</em>}' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getModule()
- * @ordered
- */
- protected Module module = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected ModuleRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.MODULE_REF;
- }
-
- protected CommonarchiveFactory getCommonArchiveFactory() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory();
- }
-
- /**
- * The default is to do nothing; subclasses should override if necessary
- */
- protected void buildComponentList(EList list) {
- //Default
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public ModuleFile getModuleFileGen() {
- if (moduleFile != null && moduleFile.eIsProxy()) {
- InternalEObject oldModuleFile = (InternalEObject)moduleFile;
- moduleFile = (ModuleFile)eResolveProxy(oldModuleFile);
- if (moduleFile != oldModuleFile) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.MODULE_REF__MODULE_FILE, oldModuleFile, moduleFile));
- }
- }
- return moduleFile;
- }
-
- public ModuleFile getModuleFile() {
- if (moduleFile == null)
- initModuleFileFromEAR();
- return moduleFile;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public ModuleFile basicGetModuleFile() {
- return moduleFile;
- }
-
- protected void initModuleFileFromEAR() {
- checkEARFile();
- ModuleFile aFile = null;
- try {
- aFile = (ModuleFile) getEarFile().getFile(module.getUri());
- } catch (FileNotFoundException ex) {
- //Ignore
- } catch (ClassCastException ex) {
- //Ignore
- }
- checkType(module, aFile);
- setModuleFile(aFile);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setModuleFile(ModuleFile newModuleFile) {
- ModuleFile oldModuleFile = moduleFile;
- moduleFile = newModuleFile;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.MODULE_REF__MODULE_FILE, oldModuleFile, moduleFile));
- }
-
- public boolean usesAltDD() {
- if (module == null)
- return false;
- return !ArchiveUtil.isNullOrEmpty(module.getAltDD());
- }
-
- public EObject getAltDeploymentDescriptor() throws ArchiveWrappedException {
- if (getEarFile() == null)
- return null;
- try {
- return getEarFile().getAltDeploymentDescriptor(getModule());
- } catch (Exception ex) {
- throw new ArchiveWrappedException(ex);
- }
- }
-
- /*
- * @see ModuleRef#getDeploymentDescriptor()
- */
- public EObject getDeploymentDescriptor() throws ArchiveWrappedException {
- if (getEarFile() == null)
- return getStandardDeploymentDescriptor();
- try {
- return getEarFile().getDeploymentDescriptor(getModule());
- } catch (Exception ex) {
- throw new ArchiveWrappedException(ex);
- }
- }
-
- /*
- * @see ModuleRef#getEARFile()
- */
- public EObject getStandardDeploymentDescriptor() {
- if (getModuleFile() == null)
- return null;
- return getModuleFile().getStandardDeploymentDescriptor();
- }
-
-
- /*
- * @see ModuleRef#setURI(String)
- */
- public void setURI(String uri) {
- if (getModuleFile() != null)
- getModuleFile().setURI(uri);
-
- if (getModule() != null)
- getModule().setUri(uri);
- }
-
- /*
- * @see ModuleRef#isClient()
- */
- public boolean isClient() {
- return false;
- }
-
- /*
- * @see ModuleRef#isConnector()
- */
- public boolean isConnector() {
- return false;
- }
-
- /*
- * @see ModuleRef#isEJB()
- */
- public boolean isEJB() {
- return false;
- }
-
- /*
- * @see ModuleRef#isWeb()
- */
- public boolean isWeb() {
- return false;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EARFile getEarFile() {
- if (eContainerFeatureID != CommonarchivePackage.MODULE_REF__EAR_FILE) return null;
- return (EARFile)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEarFile(EARFile newEarFile, NotificationChain msgs) {
- NotificationChain msgs2 = eBasicSetContainer((InternalEObject)newEarFile, CommonarchivePackage.MODULE_REF__EAR_FILE, msgs);
- return msgs2;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setEarFile(EARFile newEarFile) {
- if (newEarFile != eInternalContainer() || (eContainerFeatureID != CommonarchivePackage.MODULE_REF__EAR_FILE && newEarFile != null)) {
- if (EcoreUtil.isAncestor(this, newEarFile))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newEarFile != null)
- msgs = ((InternalEObject)newEarFile).eInverseAdd(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs);
- msgs = basicSetEarFile(newEarFile, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.MODULE_REF__EAR_FILE, newEarFile, newEarFile));
- }
-
- public Module getModule() {
- if (module != null && module.eIsProxy()) {
- Module oldModule = module;
- module = (Module) EcoreUtil.resolve(module, this);
- if (module != oldModule) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.MODULE_REF__MODULE, oldModule, module));
- }
- }
- return module;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Module basicGetModule() {
- return module;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setModule(Module newModule) {
- Module oldModule = module;
- module = newModule;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.MODULE_REF__MODULE, oldModule, module));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- NotificationChain msgs2 = msgs;
- if (eInternalContainer() != null)
- msgs2 = eBasicRemoveFromContainer(msgs2);
- return basicSetEarFile((EARFile)otherEnd, msgs2);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- return basicSetEarFile(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- return eInternalContainer().eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__MODULE_FILE:
- if (resolve) return getModuleFile();
- return basicGetModuleFile();
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- return getEarFile();
- case CommonarchivePackage.MODULE_REF__MODULE:
- if (resolve) return getModule();
- return basicGetModule();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__MODULE_FILE:
- setModuleFile((ModuleFile)newValue);
- return;
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- setEarFile((EARFile)newValue);
- return;
- case CommonarchivePackage.MODULE_REF__MODULE:
- setModule((Module)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__MODULE_FILE:
- setModuleFile((ModuleFile)null);
- return;
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- setEarFile((EARFile)null);
- return;
- case CommonarchivePackage.MODULE_REF__MODULE:
- setModule((Module)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.MODULE_REF__MODULE_FILE:
- return moduleFile != null;
- case CommonarchivePackage.MODULE_REF__EAR_FILE:
- return getEarFile() != null;
- case CommonarchivePackage.MODULE_REF__MODULE:
- return module != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * Return an input stream from the "resources path" of either the ModuleFile, if the module does
- * not use alt-dd, or from the altRoot of the module, found in the resources path of the EAR
- *
- * @see LoadStrategy#getResourceInputStream(String)
- */
- public InputStream getResourceInputStream(String uri) throws IOException {
- if (usesAltDD())
- return getAltResourceInputStream(uri);
- return getLocalResourceInputStream(uri);
- }
-
- public InputStream getLocalResourceInputStream(String uri) throws IOException {
- checkModuleFile();
- return moduleFile.getResourceInputStream(uri);
- }
-
- public InputStream getAltResourceInputStream(String uri) throws IOException {
- checkEARFile();
- return getEarFile().getResourceInputStream(uri);
- }
-
- /*
- * @see ModuleRef#getUri()
- */
- public String getUri() {
- if (module != null)
- return module.getUri();
- if (moduleFile != null)
- return moduleFile.getURI();
-
- return null;
- }
-
- /**
- * @see ModuleRef#getAltMofResource(String)
- */
- public Resource getAltMofResource(String uri) throws FileNotFoundException, ResourceLoadException {
- checkEARFile();
- return getEarFile().getMofResource(uri);
- }
-
- /**
- * @see ModuleRef#getLocalMofResource(String)
- */
- public Resource getLocalMofResource(String uri) throws FileNotFoundException, ResourceLoadException {
- checkModuleFile();
- return moduleFile.getMofResource(uri);
- }
-
- /**
- * @see ModuleRef#getMofResource(String)
- */
- public Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException {
- if (usesAltDD())
- return getAltMofResource(uri);
- return getLocalMofResource(uri);
- }
-
- /**
- * @see ModuleRef#makeAltMofResource(String)
- */
- public Resource makeAltMofResource(String uri) throws DuplicateObjectException {
- checkEARFile();
- return getEarFile().makeMofResource(uri);
- }
-
- protected void checkEARFile() {
- if (getEarFile() == null)
- throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.Module_not_in_EAR, new Object[]{getUri()}));
- }
-
- /**
- * @see ModuleRef#makeLocalMofResource(String)
- */
- public Resource makeLocalMofResource(String uri) throws DuplicateObjectException {
- checkModuleFile();
- return moduleFile.makeMofResource(uri);
-
- }
-
- protected void checkModuleFile() {
- getModuleFile();
- if (moduleFile == null)
- throw new NoModuleFileException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.Module_file_does_not_exist_2, new Object[]{getUri()}));
- }
-
- protected void checkType(Module moduleDescriptor, File aFile) {
- if (aFile == null) {
- String message = CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.A_file_does_not_exist_for_module, new Object[]{moduleDescriptor.getUri()});
- throw new NoModuleFileException(message);
- }
- //Added for defect 113929
- boolean isValid = true;
- String type = CommonArchiveResourceHandler.Module_file;
- if (moduleDescriptor.isWebModule() && !aFile.isWARFile()) {
- isValid = false;
- type = CommonArchiveResourceHandler.A_WAR_file;
- } else if (moduleDescriptor.isEjbModule() && !aFile.isEJBJarFile()) {
- isValid = false;
- type = CommonArchiveResourceHandler.An_EJB_JAR_file;
- } else if (moduleDescriptor.isJavaModule() && !aFile.isApplicationClientFile()) {
- isValid = false;
- type = CommonArchiveResourceHandler.An_Application_Client_JAR_file;
- } else if (moduleDescriptor.isConnectorModule() && !aFile.isRARFile()) {
- isValid = false;
- type = CommonArchiveResourceHandler.A_RAR_file;
- } else if (!aFile.isModuleFile())
- isValid = false;
-
- if (isValid)
- return;
-
- String earUri = ""; //$NON-NLS-1$
- if (getEarFile() != null)
- earUri = getEarFile().getURI();
- String message = CommonArchiveResourceHandler.getString("File_not_correct_type", new Object[]{aFile.getURI(), earUri, type}); //$NON-NLS-1$
- throw new ArchiveRuntimeException(message);
- }
-
-
- /**
- * @see ModuleRef#makeMofResource(String)
- */
- public Resource makeMofResource(String uri) throws DuplicateObjectException {
- if (usesAltDD())
- return makeAltMofResource(uri);
- return makeLocalMofResource(uri);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java
deleted file mode 100644
index 51c926a3e..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ConnectorDirectorySaveStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.RarFileDynamicClassLoader;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.jca.Connector;
-import org.eclipse.jst.j2ee.jca.JcaFactory;
-import org.eclipse.jst.j2ee.jca.JcaPackage;
-
-
-/**
- * @generated
- */
-public class RARFileImpl extends ModuleFileImpl implements RARFile {
-
- /**
- * The cached value of the '{@link #getDeploymentDescriptor() <em>Deployment Descriptor</em>}' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #getDeploymentDescriptor()
- * @generated
- * @ordered
- */
- protected Connector deploymentDescriptor = null;
-
- public RARFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.RAR_FILE;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public File addCopyClass(File aFile) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException {
- if (aFile.isReadOnlyDirectory())
- throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_class_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyClass not supported for directories :"
- return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_CLASSES_URI);
- }
-
- protected File addCopyFileAddingPrefix(File aFile, String uriPrefix) throws DuplicateObjectException {
- String swizzledUri = aFile.getURI();
- if (!swizzledUri.startsWith(uriPrefix)) {
- swizzledUri = ArchiveUtil.concatUri(uriPrefix, swizzledUri, '/');
- }
- checkAddValid(swizzledUri);
- File copy = copy(aFile);
- copy.setURI(swizzledUri);
- getFiles().add(copy);
- return copy;
- }
-
- protected SaveStrategy createSaveStrategyForConnectorDirectory(java.io.File dir, int expansionFlags) {
- return new ConnectorDirectorySaveStrategyImpl(dir.getAbsolutePath(), expansionFlags);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public void extractToConnectorDirectory(java.lang.String aUri, int expansionFlags) throws SaveFailureException {
- java.io.File aDir = new java.io.File(aUri);
- if (getLoadStrategy().isUsing(aDir))
- throw new SaveFailureException(CommonArchiveResourceHandler.Extract_destination_is_the_EXC_); // = "Extract destination is the same path as source file"
-
- try {
- SaveStrategy aSaveStrategy = createSaveStrategyForConnectorDirectory(aDir, expansionFlags);
- save(aSaveStrategy);
- aSaveStrategy.close();
- } catch (java.io.IOException ex) {
- throw new SaveFailureException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.error_saving_EXC_, (new Object[]{uri})), ex); // = "Error saving "
- }
-
- }
-
- /**
- * @see com.ibm.etools.commonarchive.RARFile
- */
- public java.util.List getClasses() {
- return filterFilesByPrefix(ArchiveConstants.RAR_CLASSES_URI);
- }
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
- public Connector getDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- Connector dd = deploymentDescriptor;
- if (dd == null && canLazyInitialize())
- try {
- getImportStrategy().importMetaData();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(getDeploymentDescriptorUri(), e);
- }
- return deploymentDescriptor;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public Connector basicGetDeploymentDescriptor() {
- return deploymentDescriptor;
- }
-
- @Override
- public String getDeploymentDescriptorUri() {
- return J2EEConstants.RAR_DD_URI;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public java.util.List getResources() {
- String[] prefixes = {J2EEConstants.META_INF, J2EEConstants.WEB_INF};
- return filterFilesWithoutPrefix(prefixes);
- }
-
- /**
- * Return the DeployementDescriptor.
- */
- public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- return getDeploymentDescriptor();
- }
-
- @Override
- public boolean isDeploymentDescriptorSet() {
- return deploymentDescriptor != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isRARFile() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public org.eclipse.emf.ecore.EObject makeDeploymentDescriptor(XMLResource resource) {
- JcaPackage p = (JcaPackage) EPackage.Registry.INSTANCE.getEPackage(JcaPackage.eNS_URI);
- JcaFactory fct = p.getJcaFactory();
- Connector connector = fct.createConnector();
- setDeploymentDescriptor(connector);
- resource.getContents().add(connector);
- return connector;
- }
-
-
- public void setDeploymentDescriptor(Connector l) {
- deploymentDescriptor = l;
- replaceRoot(getMofResourceMakeIfNecessary(getDeploymentDescriptorUri()), l);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR:
- if (resolve) return getDeploymentDescriptor();
- return basicGetDeploymentDescriptor();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((Connector)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((Connector)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR:
- return deploymentDescriptor != null;
- }
- return super.eIsSet(featureID);
- }
-
- @Override
- public ClassLoader createDynamicClassLoader(ClassLoader parentCl, ClassLoader extraCl) {
- return new RarFileDynamicClassLoader(this, parentCl, extraCl);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ReadOnlyDirectoryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ReadOnlyDirectoryImpl.java
deleted file mode 100644
index a34968e23..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ReadOnlyDirectoryImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-
-/**
- * @generated
- */
-public class ReadOnlyDirectoryImpl extends ContainerImpl implements ReadOnlyDirectory {
-
- public ReadOnlyDirectoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.READ_ONLY_DIRECTORY;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- @Override
- public boolean containsFile(java.lang.String aUri) {
- getFiles();
- return getFileIndex().containsKey(aUri);
- }
-
- /**
- * containsFileInRootOrSubdirectory method comment.
- */
- public boolean containsFileInSelfOrSubdirectory(java.lang.String aUri) {
- return getLoadStrategy().contains(aUri);
- }
-
- /**
- * getFileInSelfOrSubdirectory method comment.
- */
- public File getFileInSelfOrSubdirectory(java.lang.String aUri) throws java.io.FileNotFoundException {
- if (!containsFileInSelfOrSubdirectory(aUri))
- throw new java.io.FileNotFoundException(aUri);
-
- if (containsFile(aUri))
- return getFile(aUri);
-
- List subdirs = getReadOnlyDirectories();
- for (int i = 0; i < subdirs.size(); i++) {
- ReadOnlyDirectory subdir = (ReadOnlyDirectory) subdirs.get(i);
- if (subdir.containsFileInSelfOrSubdirectory(aUri))
- return subdir.getFileInSelfOrSubdirectory(aUri);
- }
- throw new java.io.FileNotFoundException(aUri);
- }
-
- /**
- * Returns a flat list of all the files contained in this directory and subdirectories, with the
- * directories filtered out, as the list would appear in an archive
- */
- public java.util.List getFilesRecursive() {
- List allFiles = new ArrayList();
- List filesList = getFiles();
- for (int i = 0; i < filesList.size(); i++) {
- File aFile = (File) filesList.get(i);
- if (aFile.isReadOnlyDirectory())
- allFiles.addAll(((ReadOnlyDirectory) aFile).getFilesRecursive());
- else
- allFiles.add(aFile);
- }
- return allFiles;
- }
-
- /**
- * Return a filtered list on the files with just the instances of ReadOnlyDirectory
- */
- public List getReadOnlyDirectories() {
- List filtered = new ArrayList();
- List filesList = getFiles();
- for (int i = 0; i < filesList.size(); i++) {
- File aFile = (File) filesList.get(i);
- if (aFile.isReadOnlyDirectory())
- filtered.add(aFile);
- }
- return filtered;
- }
-
- /**
- * isReadOnlyDirectory method comment.
- */
- @Override
- public boolean isReadOnlyDirectory() {
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootArchiveTypeDescriminatorImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootArchiveTypeDescriminatorImpl.java
deleted file mode 100644
index 53b11dc79..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootArchiveTypeDescriminatorImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy;
-
-
-/**
- * Insert the type's description here. Creation date: (12/04/00 5:24:44 PM)
- *
- * @author: Administrator
- */
-public class RootArchiveTypeDescriminatorImpl extends org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl {
- protected static ArchiveTypeDiscriminatorImpl singleton;
-
- /**
- * CommonArchiveFactoryDescriminator constructor comment.
- */
- public RootArchiveTypeDescriminatorImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public boolean canImport(Archive anArchive) {
- return true;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public Archive convert(Archive anArchive) {
- return anArchive;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- @Override
- public Archive createConvertedArchive() {
- return null;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy() {
- return null;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- @Override
- public ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return null;
- }
-
- /**
- * @return null This method should not get called at this level
- *
- * @see ArchiveTypeDescriminator#getUnableToOpenMessage()
- */
- public java.lang.String getUnableToOpenMessage() {
- return "";//$NON-NLS-1$
- }
-
- public static ArchiveTypeDiscriminator singleton() {
- if (singleton == null) {
- singleton = new RootArchiveTypeDescriminatorImpl();
- }
- return singleton;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootEJBJarDescriminatorImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootEJBJarDescriminatorImpl.java
deleted file mode 100644
index d1d73c717..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootEJBJarDescriminatorImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.EjbJar11ImportStrategyImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy;
-
-
-/**
- * Insert the type's description here. Creation date: (12/04/00 5:24:44 PM)
- *
- * @author: Administrator
- */
-public class RootEJBJarDescriminatorImpl extends org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl {
- protected static ArchiveTypeDiscriminatorImpl singleton;
-
- /**
- * CommonArchiveFactoryDescriminator constructor comment.
- */
- public RootEJBJarDescriminatorImpl() {
- super();
- initialize();
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public boolean canImport(Archive anArchive) {
- java.util.List theChildren = getChildren();
- for (int i = 0; i < theChildren.size(); i++) {
- ArchiveTypeDiscriminator child = (ArchiveTypeDiscriminator) theChildren.get(i);
- if (child.canImport(anArchive))
- return true;
- }
- return false;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public Archive convert(Archive anArchive) {
- return anArchive;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- @Override
- public Archive createConvertedArchive() {
- return null;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy() {
- return null;
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this
- * implementer.
- */
- @Override
- public ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return null;
- }
-
- /**
- * @return null This method should not get called at this level
- *
- * @see ArchiveTypeDescriminator#getUnableToOpenMessage()
- */
- public java.lang.String getUnableToOpenMessage() {
- StringBuffer message = new StringBuffer();
- java.util.List theChildren = getChildren();
- for (int i = 0; i < theChildren.size(); i++) {
- ArchiveTypeDiscriminator child = (ArchiveTypeDiscriminator) theChildren.get(i);
- message.append(child.getUnableToOpenMessage());
- message.append('\n');
- }
- return message.toString();
- }
-
- public void initialize() {
- addChild(EjbJar11ImportStrategyImpl.getDiscriminator());
- }
-
- /**
- * @see ArchiveTypeDiscriminator#openArchive(Archive)
- */
- @Override
- public Archive openArchive(Archive anArchive) throws OpenFailureException {
- Archive result = super.openArchive(anArchive);
- if (result == anArchive)
- //Couldn't convert
- return null;
- return result;
- }
-
- public static ArchiveTypeDiscriminator singleton() {
- if (singleton == null) {
- singleton = new RootEJBJarDescriminatorImpl();
- }
- return singleton;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WARFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WARFileImpl.java
deleted file mode 100644
index e9ebbc883..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WARFileImpl.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.WarFileDynamicClassLoader;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationPackage;
-
-
-/**
- * @generated
- */
-public class WARFileImpl extends ModuleFileImpl implements WARFile {
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected WebApp deploymentDescriptor = null;
- protected List sourceFiles;
-
- public WARFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.WAR_FILE;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public File addCopyClass(File aFile) throws DuplicateObjectException {
- if (aFile.isReadOnlyDirectory())
- throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_class_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyClass not supported for directories :"
- return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_CLASSES_URI);
- }
-
- protected File addCopyFileAddingPrefix(File aFile, String uriPrefix) throws DuplicateObjectException {
- String swizzledUri = aFile.getURI();
- if (!swizzledUri.startsWith(uriPrefix)) {
- swizzledUri = ArchiveUtil.concatUri(uriPrefix, swizzledUri, '/');
- }
- checkAddValid(swizzledUri);
- File copy = copy(aFile);
- copy.setURI(swizzledUri);
- getFiles().add(copy);
- return copy;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public File addCopyLib(File aFile) throws DuplicateObjectException {
- if (aFile.isReadOnlyDirectory())
- throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_lib_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyLib not supported for directories :"
- return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_LIB_URI);
- }
-
- protected RuntimeClasspathEntry createLibClasspathEntry(String libPath) {
- RuntimeClasspathEntry entry = createRuntimeClasspathEntry(libPath);
- entry.setWarFile(this);
- return entry;
- }
-
- /**
- * Used internally for building the runtime class path
- *
- * @return List of Strings, the absolute paths of all file entries (no directories)
- */
- protected List getAllFileEntriesRecursive(java.io.File aFile, List aList) {
- if (!aFile.exists())
- return aList;
- //modified for botp 126140 05.29.02
- String name = aFile.getName();
- if (name.regionMatches(true, name.length() - 4, ".jar", 0, 4)) {//$NON-NLS-1$
- aList.add(aFile.getAbsolutePath());
- } else if (aFile.isDirectory()) {
- java.io.File[] children = aFile.listFiles();
- for (int i = 0; i < children.length; i++) {
- getAllFileEntriesRecursive(children[i], aList);
- }
- }
- return aList;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public java.util.List getClasses() {
- return filterFilesByPrefix(ArchiveConstants.WEBAPP_CLASSES_URI);
- }
-
- /**
- * @throws DeploymentDescriptorLoadException -
- * is a runtime exception, because we can't override the signature of the generated
- * methods
- */
- public WebApp getDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- WebApp dd = this.getDeploymentDescriptorGen();
- if (dd == null && canLazyInitialize())
- try {
- getImportStrategy().importMetaData();
- } catch (Exception e) {
- throw new DeploymentDescriptorLoadException(getDeploymentDescriptorUri(), e);
- }
- return this.getDeploymentDescriptorGen();
- }
-
- @Override
- public String getDeploymentDescriptorUri() {
- return J2EEConstants.WEBAPP_DD_URI;
- }
-
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public java.util.List getLibs() {
- return filterFilesByPrefix(ArchiveConstants.WEBAPP_LIB_URI);
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public List getLibArchives() {
- return filterFiles(ArchiveConstants.WEBAPP_LIB_URI, new String[]{"jar", "zip"}); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @see com.ibm.etools.commonarchive.WARFile
- */
- public java.util.List getResources() {
- String[] prefixes = {J2EEConstants.META_INF, J2EEConstants.WEB_INF};
- return filterFilesWithoutPrefix(prefixes);
- }
-
- /**
- * Overridden from superclass to include the claseses and libs of a WARFile There also is an
- * assumption that this is an exploded war file The following is what should be returned:
- *
- * 1) WAR directory + /WEB-INF/classes 2) all JAR files contained in [WAR directory +
- * /WEB-INF/lib] 3) WAR directory
- */
- @Override
- public RuntimeClasspathEntry[] getLocalRuntimeClassPath() {
-
- String absolutePath;
- try {
- absolutePath = getLoadStrategy().getBinariesPath();
- } catch (IOException ex) {
- return new RuntimeClasspathEntry[0];
- }
-
- List entries = new ArrayList();
-
- if (getLoadStrategy().isDirectory()) {
- String classesPath = ArchiveUtil.getOSUri(absolutePath, ArchiveConstants.WEBAPP_CLASSES_URI);
- entries.add(createRuntimeClasspathEntry(classesPath));
- addWebLibs(absolutePath, entries);
- }
-
- entries.add(createRuntimeClasspathEntry(absolutePath));
- return (RuntimeClasspathEntry[]) entries.toArray(new RuntimeClasspathEntry[entries.size()]);
- }
-
- @Override
- protected RuntimeClasspathEntry[] getDependencyClassPathAtThisLevel() {
-
- String absolutePath = internalGetBinariesPath();
- if (absolutePath == null)
- return emptyClasspath();
- RuntimeClasspathEntry[] mfEntries = super.getDependencyClassPathAtThisLevel();
- List entries = new ArrayList();
- entries.addAll(Arrays.asList(mfEntries));
-
- return (RuntimeClasspathEntry[]) entries.toArray(new RuntimeClasspathEntry[entries.size()]);
- }
-
- protected void addWebLibs(String absolutePath, List entries) {
- /*******************************************************************************************
- * Optimization*********** We could have used the helper getlibs here; however, that could
- * drag down performance as the full file list would have to get built, and this is runtime;
- * if the classes portion is huge then building the file list would be slow; moreover, we
- * would then have to clear the index from this war file. therefore, we'll do a little extra
- * work to get the libs
- ******************************************************************************************/
- java.io.File aFile = new java.io.File(ArchiveUtil.getOSUri(absolutePath, ArchiveConstants.WEBAPP_LIB_URI));
- List libs = getAllFileEntriesRecursive(aFile, new ArrayList());
- for (int i = 0; i < libs.size(); i++) {
- String libPath = (String) libs.get(i);
- entries.add(createLibClasspathEntry(libPath));
- }
- addLooseLibsToRuntimeClasspath(entries);
- }
-
- protected void addLooseLibsToRuntimeClasspath(List entries) {
- LooseWARFile loose = (LooseWARFile) getLoadStrategy().getLooseArchive();
- if (loose == null)
- return;
-
- List looseLibs = loose.getLooseLibs();
- for (int i = 0; i < looseLibs.size(); i++) {
- LooseLibrary lib = (LooseLibrary) looseLibs.get(i);
- entries.add(createLibClasspathEntry(lib.getBinariesPath()));
- }
- }
-
- protected List calculateSourceCandidateFiles() {
- List filesList = getFiles();
- List retFiles = new Vector();
- for (Iterator iter = filesList.iterator(); iter.hasNext();) {
- File file = (File) iter.next();
- String aUri = file.getURI();
- if (aUri.startsWith(J2EEConstants.WEB_INF) && !aUri.startsWith(ArchiveConstants.WEBAPP_LIB_URI))
- retFiles.add(file);
- }
- return retFiles;
- }
-
- protected List getSourceCandidateFiles() {
- if (sourceFiles == null) {
- sourceFiles = calculateSourceCandidateFiles();
- }
- return sourceFiles;
- }
-
- protected String makeRelative(String pathString, String relToPathString) {
-
- if (pathString.startsWith(relToPathString))
- return ArchiveUtil.truncateFromFrontIgnoreCase(pathString, relToPathString);
-
- return pathString;
- }
-
- /**
- * Return the source file that matches the output file passed in
- *
- * @param aClassFile
- * The .class file or other output file to find the source for
- * @return String The matching source. Null if there is no matching source found
- */
- public File getSourceFile(File aClassFile) {
- List sourceFilesList = getSourceCandidateFiles();
- String classURI = aClassFile.getURI();
- String convertedClassURI = classURI;
- if (classURI.endsWith(".class")) //$NON-NLS-1$
- convertedClassURI = ArchiveUtil.classUriToJavaUri(aClassFile.getURI());
- else
- return null;
- convertedClassURI = makeRelative(convertedClassURI, ArchiveConstants.WEBAPP_CLASSES_URI);
- int bestLength = 32767;
- File bestMatch = null;
- File file = null;
- String aUri = null;
- for (Iterator iter = sourceFilesList.iterator(); iter.hasNext();) {
- file = (File) iter.next();
- aUri = file.getURI();
- if (aUri.endsWith(convertedClassURI) && !aUri.equals(classURI)) {
- int excessLength = aUri.length() - convertedClassURI.length();
- if (excessLength < bestLength) {
- bestMatch = file;
- bestLength = excessLength;
- }
- }
- }
- return bestMatch;
- }
-
- /**
- * Return the DeployementDescriptor.
- */
- public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException {
- return getDeploymentDescriptor();
- }
-
- @Override
- public boolean isDeploymentDescriptorSet() {
- return deploymentDescriptor != null;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.File
- */
- @Override
- public boolean isWARFile() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl
- */
- @Override
- public org.eclipse.emf.ecore.EObject makeDeploymentDescriptor(XMLResource resource) {
- WebApp webApp = ((WebapplicationPackage) EPackage.Registry.INSTANCE.getEPackage(WebapplicationPackage.eNS_URI)).getWebapplicationFactory().createWebApp();
- resource.setID(webApp, J2EEConstants.WEBAPP_ID);
- setDeploymentDescriptorGen(webApp);
- resource.getContents().add(webApp);
- return webApp;
- }
-
- public void setDeploymentDescriptor(WebApp l) {
- this.setDeploymentDescriptorGen(l);
- replaceRoot(getMofResourceMakeIfNecessary(getDeploymentDescriptorUri()), l);
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public WebApp getDeploymentDescriptorGen() {
- if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) {
- InternalEObject oldDeploymentDescriptor = (InternalEObject)deploymentDescriptor;
- deploymentDescriptor = (WebApp)eResolveProxy(oldDeploymentDescriptor);
- if (deploymentDescriptor != oldDeploymentDescriptor) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
- }
- return deploymentDescriptor;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public WebApp basicGetDeploymentDescriptor() {
- return deploymentDescriptor;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setDeploymentDescriptorGen(WebApp newDeploymentDescriptor) {
- WebApp oldDeploymentDescriptor = deploymentDescriptor;
- deploymentDescriptor = newDeploymentDescriptor;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR, oldDeploymentDescriptor, deploymentDescriptor));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR:
- if (resolve) return getDeploymentDescriptor();
- return basicGetDeploymentDescriptor();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((WebApp)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR:
- setDeploymentDescriptor((WebApp)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR:
- return deploymentDescriptor != null;
- }
- return super.eIsSet(featureID);
- }
-
- @Override
- public ClassLoader createDynamicClassLoader(ClassLoader parentCl, ClassLoader extraCl) {
- return new WarFileDynamicClassLoader(this, parentCl, extraCl);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WebModuleRefImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WebModuleRefImpl.java
deleted file mode 100644
index ab99fd5d7..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WebModuleRefImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WebModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-/**
- * @generated
- */
-public class WebModuleRefImpl extends ModuleRefImpl implements WebModuleRef {
-
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected WebModuleRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return CommonarchivePackage.Literals.WEB_MODULE_REF;
- }
-
- /*
- * @see WebModuleRef#getWebApp()
- */
- public WebApp getWebApp() throws ArchiveWrappedException {
- return (WebApp) getDeploymentDescriptor();
- }
-
- /*
- * @see ModuleRef#isWeb()
- */
- @Override
- public boolean isWeb() {
- return true;
- }
-
-} //WebModuleRefImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ExportStrategyImpl.java
deleted file mode 100644
index 64e591654..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ExportStrategyImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-
-/**
- * Concrete implementer that knows how to export meta-data for a 1.2 Application Client
- */
-public class AppClient12ExportStrategyImpl extends ExportStrategyImpl {
- /**
- * AppClient12ExportStrategy constructor comment.
- */
- public AppClient12ExportStrategyImpl() {
- super();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ImportStrategyImpl.java
deleted file mode 100644
index f42cdc92c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ImportStrategyImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-/**
- * Concrete implementer that knows how to import meta-data for a 1.2 Application Client
- */
-public class AppClient12ImportStrategyImpl extends XmlBasedImportStrategyImpl {
-
- public static class Discriminator extends ArchiveTypeDiscriminatorImpl {
- @Override
- public boolean canImport(Archive anArchive) {
- return anArchive.containsFile(J2EEConstants.APP_CLIENT_DD_URI);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return new AppClient12ImportStrategyImpl();
- }
-
- public String getUnableToOpenMessage() {
- return getXmlDDMessage(CommonArchiveResourceHandler.Application_Client_Jar_Fil, J2EEConstants.APP_CLIENT_DD_URI); // = "Application Client Jar File"
- }
-
- @Override
- public Archive createConvertedArchive() {
- return getArchiveFactory().createApplicationClientFile();
- }
- }
-
- protected static Discriminator discriminator;
-
- /**
- * AppClient22ImportStrategy constructor comment.
- */
- public AppClient12ImportStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return getDiscriminator().createImportStrategy(old, newArchive);
- }
-
- public ApplicationClientFile getApplicationClientFile() {
- return (ApplicationClientFile) getArchive();
- }
-
- public static ArchiveTypeDiscriminator getDiscriminator() {
- if (discriminator == null) {
- discriminator = new Discriminator();
- }
- return discriminator;
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public void importMetaData() throws Exception {
- loadDeploymentDescriptor();
- }
-
- public void loadDeploymentDescriptor() throws Exception {
- ApplicationClient client = null;
-
- client = (ApplicationClient) primLoadDeploymentDescriptor();
-
- getApplicationClientFile().setDeploymentDescriptor(client);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategy.java
deleted file mode 100644
index 263ad14aa..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategy.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-
-/**
- * Represents a supertype for all the archive strategies.
- */
-public interface ArchiveStrategy {
- public Archive getArchive();
-
- public void setArchive(Archive archive);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategyImpl.java
deleted file mode 100644
index 8352490c4..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ArchiveStrategyImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-
-/**
- * This an abstract type off which any implementers of the archive strategy can subclass.
- */
-public abstract class ArchiveStrategyImpl implements ArchiveStrategy {
- protected Archive archive;
-
- /**
- * ArchiveStrategy constructor comment.
- */
- public ArchiveStrategyImpl() {
- super();
- }
-
- public Archive getArchive() {
- return archive;
- }
-
- public void setArchive(Archive newArchive) {
- archive = newArchive;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ConnectorDirectorySaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ConnectorDirectorySaveStrategyImpl.java
deleted file mode 100644
index 93e9eea23..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ConnectorDirectorySaveStrategyImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveURIConverterImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-/**
- * Implementer that knows how to save an archives contents to a directory on the local file system
- */
-public class ConnectorDirectorySaveStrategyImpl extends SaveStrategyImpl {
- protected String directoryName;
- protected URIConverter uriConverter;
- /** Indicates which type of archives should be expanded */
- protected int expansionFlags;
-
- /**
- * DirectoryDumpStrategy constructor comment.
- */
- public ConnectorDirectorySaveStrategyImpl() {
- super();
- }
-
- /**
- * DirectoryDumpStrategy constructor comment.
- */
- public ConnectorDirectorySaveStrategyImpl(String dirName, int flags) {
- super();
- setDirectoryName(dirName);
- setExpansionFlags(flags);
- initialize();
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- protected SaveStrategy createNestedDirectoryStrategy(Archive anArchive) {
- String uri = org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getOSUri(getDirectoryName(), "");//$NON-NLS-1$
- return new ConnectorDirectorySaveStrategyImpl(uri, getExpansionFlags());
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- protected SaveStrategy createNestedSaveStrategy(Archive anArchive) throws IOException {
- if (shouldExpand(anArchive))
- return createNestedDirectoryStrategy(anArchive);
- return createNestedZipStrategy(anArchive);
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- protected SaveStrategy createNestedZipStrategy(Archive anArchive) throws IOException {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(anArchive.getURI()));
- return new ZipStreamSaveStrategyImpl(out);
- }
-
- /**
- * Insert the method's description here. Creation date: (11/15/00 2:26:37 PM)
- *
- * @return java.lang.String
- */
- public java.lang.String getDirectoryName() {
- return directoryName;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 10:18:21 AM)
- *
- * @return int
- */
- public int getExpansionFlags() {
- return expansionFlags;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- protected java.io.OutputStream getOutputStreamForResource(Resource aResource) throws java.io.IOException {
- return getUriConverter().createOutputStream(aResource.getURI());
- }
-
- /**
- * Insert the method's description here. Creation date: (12/08/00 4:50:32 PM)
- *
- * @return org.eclipse.emf.ecore.resource.URIConverter
- */
- public org.eclipse.emf.ecore.resource.URIConverter getUriConverter() {
- return uriConverter;
- }
-
- public void initialize() {
- ArchiveURIConverterImpl converter = new ArchiveURIConverterImpl(getArchive(), getDirectoryName());
- converter.setOutputFilepath(getDirectoryName());
- setUriConverter(converter);
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- @Override
- public boolean isDirectory() {
- return true;
- }
-
- protected void mkdirs(String directoryPath) {
- File aDirectory = new File(getDirectoryName() + File.separatorChar + directoryPath);
- aDirectory.mkdirs();
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException {
- try {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(J2EEConstants.MANIFEST_URI));
- aManifest.write(out);
- out.close();
- } catch (IOException iox) {
- throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox);
- }
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.File aFile, InputStream in) throws SaveFailureException {
- String entryName = aFile.getURI();
- if (aFile.isDirectoryEntry())
- mkdirs(entryName);
- else {
- try {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(entryName));
- org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.copy(in, out);
- } catch (IOException iox) {
- throw new SaveFailureException(aFile.getURI(), iox);
- }
- }
- }
-
- @Override
- protected void saveMofResource(org.eclipse.emf.ecore.resource.Resource aResource, OutputStream os) throws IOException {
- super.saveMofResource(aResource, os);
- os.close();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/15/00 2:26:37 PM)
- *
- * @param newDirectoryName
- * java.lang.String
- */
- public void setDirectoryName(java.lang.String newDirectoryName) {
- directoryName = newDirectoryName;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 10:18:21 AM)
- *
- * @param newExpansionFlags
- * int
- */
- public void setExpansionFlags(int newExpansionFlags) {
- expansionFlags = newExpansionFlags;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/08/00 4:50:32 PM)
- *
- * @param newUriConverter
- * org.eclipse.emf.ecore.resource.URIConverter
- */
- public void setUriConverter(org.eclipse.emf.ecore.resource.URIConverter newUriConverter) {
- uriConverter = newUriConverter;
- }
-
- protected boolean shouldExpand(Archive anArchive) {
-
- int flag = 0;
-
- if (anArchive.isWARFile())
- flag = Archive.EXPAND_WAR_FILES;
- else if (anArchive.isEARFile())
- flag = Archive.EXPAND_EAR_FILES;
- else if (anArchive.isEJBJarFile())
- flag = Archive.EXPAND_EJBJAR_FILES;
- else if (anArchive.isRARFile())
- flag = Archive.EXPAND_RAR_FILES;
- else if (anArchive.isApplicationClientFile())
- flag = Archive.EXPAND_APPCLIENT_FILES;
- else
- flag = Archive.EXPAND_ARCHIVES;
-
- return (getExpansionFlags() & flag) != 0;
-
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategy.java
deleted file mode 100644
index b6549c3e8..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategy.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-/**
- * Specialized load strategy that reads entries in an archive from a directory on the file system
- */
-public interface DirectoryArchiveLoadStrategy extends LoadStrategy {
- public String getDirectoryUri();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategyImpl.java
deleted file mode 100644
index b4fe7269e..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategyImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfigRegister;
-
-
-/**
- * Load strategy used for reading expanding archives; typically in a running server this would be an
- * EAR or WAR, although it can be any Archive
- */
-public class DirectoryArchiveLoadStrategyImpl extends DirectoryLoadStrategyImpl {
-
-
-
- public DirectoryArchiveLoadStrategyImpl(String aDirectoryUri) {
- super(aDirectoryUri);
- }
-
- @Override
- protected void addDirectory(java.io.File aFile, java.util.List aList) {
- addFiles(aFile, aList);
- }
-
- @Override
- protected java.io.File getDirectoryForList() {
- return new java.io.File(getDirectoryUri());
- }
-
-
-
- @Override
- public LooseArchive getLooseArchive() {
- if (looseArchive == null && getContainer().isEARFile()) {
- String osString = ArchiveUtil.getOSUri(getContainer().getURI());
- setLooseArchive(LooseConfigRegister.singleton().findLooseApplication(osString));
- }
- return looseArchive;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryLoadStrategyImpl.java
deleted file mode 100644
index 70490eed6..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryLoadStrategyImpl.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-
-/**
- * Implementer that knows how to read files from the local file system and treat them as file
- * entries in an archive
- *
- * @see DirectoryArchiveLoadStrategy
- */
-public abstract class DirectoryLoadStrategyImpl extends LoadStrategyImpl implements DirectoryArchiveLoadStrategy {
- /**
- * The root uri from which all relative files entries are loaded; must point to a valid local
- * directory
- */
- static boolean IS_AIX = "AIX".equals(System.getProperty("os.name")); //$NON-NLS-1$ //$NON-NLS-2$
- protected String directoryUri;
- /**
- * Used internally; the directory uri with the system dependent file separator replaced by a
- * forward slash
- */
- protected String directoryUriAsZipString;
- protected static char SEPARATOR_CHAR = java.io.File.separatorChar;
-
- public DirectoryLoadStrategyImpl(String aDirectoryUri) {
- super();
- setDirectoryUri(aDirectoryUri);
- String normalized = null;
- try {
- normalized = new File(aDirectoryUri).getCanonicalPath();
- } catch (IOException iox) {
- normalized = aDirectoryUri;
- }
- setDirectoryUriAsZipString(normalized.replace(SEPARATOR_CHAR, '/'));
-
- }
-
- protected abstract void addDirectory(java.io.File aFile, List aList);
-
- protected void addFile(java.io.File aFile, List aList) {
-
- String uri = getURIFrom(aFile);
- if (collectedLooseArchiveFiles.containsKey(uri))
- return;
-
- org.eclipse.jst.j2ee.commonarchivecore.internal.File cFile = createFile(uri);
- cFile.setSize(aFile.length());
- cFile.setLastModified(aFile.lastModified());
- aList.add(cFile);
- }
-
- protected void addFiles(java.io.File aDirectory, List aList) {
-
- String[] fileNames = aDirectory.list();
- if (fileNames == null)
- return;
- for (int i = 0; i < fileNames.length; i++) {
- String fileName = ArchiveUtil.concatUri(aDirectory.getPath(), fileNames[i], SEPARATOR_CHAR);
- if (fileNames[i] == null || (IS_AIX && ".backup".equals(fileNames[i]))) //$NON-NLS-1$
- continue;
- java.io.File aFile = new java.io.File(fileName);
- if (!aFile.exists())
- continue;
- //This could occur on some windows machines, eg C:\pagefile.sys
- //throw new RuntimeException("Error scanning directory structure");
- if (aFile.isDirectory() && !isArchive(getURIFrom(aFile))) {
- addDirectory(aFile, aList);
- } else {
- addFile(aFile, aList);
- }
- }
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- protected boolean primContains(java.lang.String uri) {
- return new java.io.File(getFileNameFrom(uri)).exists();
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException {
- return new java.io.File(getDirectoryUri()).getAbsolutePath();
- }
-
- protected abstract java.io.File getDirectoryForList();
-
- public java.lang.String getDirectoryUri() {
- return directoryUri;
- }
-
- public java.lang.String getDirectoryUriAsZipString() {
- return directoryUriAsZipString;
- }
-
- /**
- * Returns an OS filename from a relative uri
- */
- // TODO Fix the type casing in v6.0
- protected String getFileNameFrom(String uri) {
- LooseArchive aLooseArchive = getLooseArchive();
- if (aLooseArchive != null) {
- String result = null;
- switch (aLooseArchive.eClass().getClassifierID()) {
- case LooseconfigPackage.LOOSE_APPLICATION :
- result = getURIFromLooseArchivesIfAvailable(((LooseApplication) aLooseArchive).getLooseArchives(), uri);
- break;
- case LooseconfigPackage.LOOSE_WAR_FILE :
- result = getURIFromLooseArchivesIfAvailable(((LooseWARFile) aLooseArchive).getLooseLibs(), uri);
-
- break;
- }
- if (result != null)
- return result;
- }
- String name = uri;
- if (SEPARATOR_CHAR != '/')
- name = name.replace('/', SEPARATOR_CHAR);
- return getDirectoryUri() + SEPARATOR_CHAR + name;
- }
-
- private String getURIFromLooseArchivesIfAvailable(List looseArchives, String uri) {
-
- for (Iterator iter = looseArchives.iterator(); iter.hasNext();) {
- LooseArchive looseArchiveElement = (LooseArchive) iter.next();
- if (uri.equals(looseArchiveElement.getUri()))
- return looseArchiveElement.getBinariesPath();
- }
- return null;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.util.List getFiles() {
- List list = new ArrayList();
- java.io.File directory = getDirectoryForList();
- addFiles(directory, list);
- return list;
- }
-
- @Override
- public java.util.List getFiles(String subfolderPath) {
- List list = new ArrayList();
- java.io.File containerDirectory = getDirectoryForList();
- java.io.File subfolder = new java.io.File(containerDirectory, subfolderPath);
- addFiles(subfolder, list);
- return list;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.io.InputStream getInputStream(java.lang.String uri) throws IOException, FileNotFoundException {
- return new FileInputStream(getFileNameFrom(uri));
- }
-
- /**
- * Returns a relative uri from the java.io.File, to be used for a file entry; the separator will
- * be the zip standard (forward slash ("/")).
- */
-
- protected String getURIFrom(File aFile) {
- String name = ""; //$NON-NLS-1$
- String relative = null;
- String root = getDirectoryUriAsZipString();
- try {
- name = aFile.getCanonicalPath();
- relative = makeRelative(name, root);
- } catch (IOException iox) {
- name = null;
- }
- if (relative == null) {
- name = aFile.getAbsolutePath();
- relative = makeRelative(name, root);
- }
- if (relative == null) {
- name = aFile.getPath();
- root = replaceSeparators(getDirectoryUri());
- relative = makeRelative(name, root);
- }
- return relative;
- }
-
- private String replaceSeparators(String path) {
- if (File.separatorChar != '/')
- return path.replace(File.separatorChar, '/');
- return path;
- }
-
- private String makeRelative(String fileName, String root)
- {
- if ( (fileName == null) || (root == null) )
- return null;
-
- int offset = root.length();
-
- while ( (offset > 0) && root.charAt(offset - 1) == '/' )
- offset--;
-
- if ( offset < root.length() ) {
- offset++;
-
- if ( offset < root.length() )
- root = root.substring(0, offset);
- } else {
- root += '/';
- }
-
- String name = replaceSeparators(fileName);
-
- if ( name.startsWith(root) )
- name = name.substring( root.length() );
- else
- name = null;
-
- return name;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public boolean isDirectory() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public boolean isUsing(java.io.File aSystemFile) {
- java.io.File dir = new java.io.File(getDirectoryUri());
- return dir.equals(aSystemFile);
- }
-
- public void setDirectoryUri(java.lang.String newDirectoryUri) {
- directoryUri = newDirectoryUri;
- }
-
- public void setDirectoryUriAsZipString(java.lang.String newDirectoryUriAsZipString) {
- directoryUriAsZipString = newDirectoryUriAsZipString;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectorySaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectorySaveStrategyImpl.java
deleted file mode 100644
index 5e87f4531..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectorySaveStrategyImpl.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveURIConverterImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-/**
- * Implementer that knows how to save an archives contents to a directory on the local file system
- */
-public class DirectorySaveStrategyImpl extends SaveStrategyImpl {
- protected String directoryName;
- protected URIConverter uriConverter;
- /** Indicates which type of archives should be expanded */
- protected int expansionFlags;
-
- /**
- * DirectoryDumpStrategy constructor comment.
- */
- public DirectorySaveStrategyImpl() {
- super();
- }
-
- /**
- * DirectoryDumpStrategy constructor comment.
- */
- public DirectorySaveStrategyImpl(String dirName, int flags) {
- super();
- setDirectoryName(dirName);
- setExpansionFlags(flags);
- initialize();
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- protected SaveStrategy createNestedDirectoryStrategy(Archive anArchive) {
- String uri = org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getOSUri(getDirectoryName(), anArchive.getURI());
- return new DirectorySaveStrategyImpl(uri, getExpansionFlags());
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- protected SaveStrategy createNestedSaveStrategy(Archive anArchive) throws IOException {
- if (shouldExpand(anArchive))
- return createNestedDirectoryStrategy(anArchive);
- return createNestedZipStrategy(anArchive);
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- protected SaveStrategy createNestedZipStrategy(Archive anArchive) throws IOException {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(anArchive.getURI()));
- return new ZipStreamSaveStrategyImpl(out);
- }
-
- /**
- * Insert the method's description here. Creation date: (11/15/00 2:26:37 PM)
- *
- * @return java.lang.String
- */
- public java.lang.String getDirectoryName() {
- return directoryName;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 10:18:21 AM)
- *
- * @return int
- */
- public int getExpansionFlags() {
- return expansionFlags;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- protected java.io.OutputStream getOutputStreamForResource(Resource aResource) throws java.io.IOException {
- return getUriConverter().createOutputStream(aResource.getURI());
- }
-
- /**
- * Insert the method's description here. Creation date: (12/08/00 4:50:32 PM)
- *
- * @return org.eclipse.emf.ecore.resource.URIConverter
- */
- public org.eclipse.emf.ecore.resource.URIConverter getUriConverter() {
- return uriConverter;
- }
-
- public void initialize() {
- ArchiveURIConverterImpl converter = new ArchiveURIConverterImpl(getArchive(), getDirectoryName());
- converter.setOutputFilepath(getDirectoryName());
- setUriConverter(converter);
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- @Override
- public boolean isDirectory() {
- return true;
- }
-
- protected void mkdirs(String directoryPath) {
- File aDirectory = new File(getDirectoryName() + File.separatorChar + directoryPath);
- aDirectory.mkdirs();
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException {
- try {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(J2EEConstants.MANIFEST_URI));
- aManifest.write(out);
- out.close();
- if (getArchive().getOptions().isReadOnly())
- setTimestampAfterSaving(J2EEConstants.MANIFEST_URI);
- } catch (IOException iox) {
- throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox);
- }
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.File aFile, InputStream in) throws SaveFailureException {
- String entryName = aFile.getURI();
- if (aFile.isDirectoryEntry())
- mkdirs(entryName);
- else {
- try {
- OutputStream out = getUriConverter().createOutputStream(URI.createURI(entryName));
- ArchiveUtil.copy(in, out);
- setTimestampAfterSaving(aFile);
- } catch (IOException iox) {
- throw new SaveFailureException(aFile.getURI(), iox);
- }
- }
- }
-
- @Override
- protected void saveMofResource(org.eclipse.emf.ecore.resource.Resource aResource, OutputStream os) throws IOException {
- super.saveMofResource(aResource, os);
- os.close();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/15/00 2:26:37 PM)
- *
- * @param newDirectoryName
- * java.lang.String
- */
- public void setDirectoryName(java.lang.String newDirectoryName) {
- directoryName = newDirectoryName;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 10:18:21 AM)
- *
- * @param newExpansionFlags
- * int
- */
- public void setExpansionFlags(int newExpansionFlags) {
- expansionFlags = newExpansionFlags;
- }
-
- protected void setTimestampAfterSaving(org.eclipse.jst.j2ee.commonarchivecore.internal.File aFile) {
- long lastMod = aFile.getLastModified();
- if (lastMod == 0)
- return;
- String absPath = ArchiveUtil.getOSUri(getDirectoryName(), aFile.getURI());
- File ioFile = new File(absPath);
- ioFile.setLastModified(lastMod);
- }
-
- protected void setTimestampAfterSaving(String uri) {
- org.eclipse.jst.j2ee.commonarchivecore.internal.File aFile = null;
- try {
- aFile = getArchive().getFile(uri);
- } catch (FileNotFoundException mustBeANewEntry) {
- return;
- }
- setTimestampAfterSaving(aFile);
- }
-
- /**
- * Insert the method's description here. Creation date: (12/08/00 4:50:32 PM)
- *
- * @param newUriConverter
- * org.eclipse.emf.ecore.resource.URIConverter
- */
- public void setUriConverter(org.eclipse.emf.ecore.resource.URIConverter newUriConverter) {
- uriConverter = newUriConverter;
- }
-
- protected boolean shouldExpand(Archive anArchive) {
-
- int flag = 0;
-
- if (anArchive.isWARFile())
- flag = Archive.EXPAND_WAR_FILES;
- else if (anArchive.isEARFile())
- flag = Archive.EXPAND_EAR_FILES;
- else if (anArchive.isRARFile())
- flag = Archive.EXPAND_RAR_FILES;
- else if (anArchive.isEJBJarFile())
- flag = Archive.EXPAND_EJBJAR_FILES;
- else if (anArchive.isApplicationClientFile())
- flag = Archive.EXPAND_APPCLIENT_FILES;
- else
- flag = Archive.EXPAND_ARCHIVES;
-
- return (getExpansionFlags() & flag) != 0;
-
- }
-
- @Override
- protected boolean shouldIterateOver(Archive anArchive) {
- return super.shouldIterateOver(anArchive) || shouldExpand(anArchive);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ExportStrategyImpl.java
deleted file mode 100644
index cb02d1979..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ExportStrategyImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-
-/**
- * Concrete implementer that knows how to export meta-data for a 1.2 Application
- */
-public class Ear12ExportStrategyImpl extends ExportStrategyImpl {
- /**
- * Ear12ExportStrategy constructor comment.
- */
- public Ear12ExportStrategyImpl() {
- super();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ImportStrategyImpl.java
deleted file mode 100644
index 829a0e456..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ImportStrategyImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-/**
- * Concrete implementer that knows how to import meta-data for a 1.2 Application Client
- */
-public class Ear12ImportStrategyImpl extends XmlBasedImportStrategyImpl {
-
- public static class Discriminator extends ArchiveTypeDiscriminatorImpl {
- @Override
- public Archive createConvertedArchive() {
- return getArchiveFactory().createEARFile();
- }
-
- @Override
- public boolean canImport(Archive anArchive) {
- return anArchive.containsFile(J2EEConstants.APPLICATION_DD_URI);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return new Ear12ImportStrategyImpl();
- }
-
- public String getUnableToOpenMessage() {
- return getXmlDDMessage(CommonArchiveResourceHandler.EAR_File, J2EEConstants.APPLICATION_DD_URI); // = "EAR File"
- }
- }
-
- protected static Discriminator discriminator;
-
- /**
- * Ear12ImportStrategy constructor comment.
- */
- public Ear12ImportStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return getDiscriminator().createImportStrategy(old, newArchive);
- }
-
- public static ArchiveTypeDiscriminator getDiscriminator() {
- if (discriminator == null) {
- discriminator = new Discriminator();
- }
- return discriminator;
- }
-
- public EARFile getEARFile() {
- return (EARFile) getArchive();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public void importMetaData() throws Exception {
- loadDeploymentDescriptor();
- }
-
- public void loadDeploymentDescriptor() throws Exception {
- Application appl = null;
-
- appl = (Application) primLoadDeploymentDescriptor();
-
- getEARFile().setDeploymentDescriptor(appl);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ExportStrategyImpl.java
deleted file mode 100644
index cc944cfc5..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ExportStrategyImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-
-/**
- * Concrete implementer that knows how to export meta-data for a 1.1 Ejb Jar
- */
-public class EjbJar11ExportStrategyImpl extends ExportStrategyImpl {
- /**
- * EjbJar11ExportStrategy constructor comment.
- */
- public EjbJar11ExportStrategyImpl() {
- super();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ImportStrategyImpl.java
deleted file mode 100644
index eb62725db..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ImportStrategyImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-
-/**
- * Concrete implementer that knows how to import meta-data for a 1.1 Ejb Jar
- */
-public class EjbJar11ImportStrategyImpl extends XmlBasedImportStrategyImpl {
-
- public static class Discriminator extends ArchiveTypeDiscriminatorImpl {
- @Override
- public boolean canImport(Archive anArchive) {
- return anArchive.containsFile(J2EEConstants.EJBJAR_DD_URI);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return new EjbJar11ImportStrategyImpl();
- }
-
- public String getUnableToOpenMessage() {
- return getXmlDDMessage(CommonArchiveResourceHandler.EJB_Jar_File, J2EEConstants.EJBJAR_DD_URI); // = "EJB Jar File"
- }
-
- @Override
- public Archive createConvertedArchive() {
- return getArchiveFactory().createEJBJarFile();
- }
- }
-
- protected static Discriminator discriminator;
-
- /**
- * EjbJar11ImportStrategy constructor comment.
- */
- public EjbJar11ImportStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return getDiscriminator().createImportStrategy(old, newArchive);
- }
-
- public static ArchiveTypeDiscriminator getDiscriminator() {
- if (discriminator == null) {
- discriminator = new Discriminator();
- }
- return discriminator;
- }
-
- public EJBJarFile getEJBJarFile() {
- return (EJBJarFile) getArchive();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public void importMetaData() throws Exception {
- loadDeploymentDescriptor();
- }
-
- public void loadDeploymentDescriptor() throws Exception {
- EJBJar ejbJar = null;
-
- ejbJar = (EJBJar) primLoadDeploymentDescriptor();
- getEJBJarFile().setDeploymentDescriptor(ejbJar);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ExportStrategyImpl.java
deleted file mode 100644
index fd875ea3c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ExportStrategyImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ExportStrategy;
-
-
-/**
- * Abstract implementer off which other export strategies can subclass
- *
- * @see ExportStrategy
- */
-public abstract class ExportStrategyImpl extends ArchiveStrategyImpl implements ExportStrategy {
- /** The list of files already saved by this strategy during invokation of preSave() */
- protected Set savedFiles;
-
- public ExportStrategyImpl() {
- super();
- }
-
- public java.util.Set getSavedFiles() {
- if (savedFiles == null)
- savedFiles = new HashSet();
- return savedFiles;
- }
-
- public boolean hasSaved(String uri) {
- return savedFiles != null && getSavedFiles().contains(uri);
- }
-
- /**
- * The default is to do nothing; subclasses may wish to override; typical operations would be to
- * add extra elements to the outgoing archive, using SaveStrategy#save(File,
- * java.io.InputStream)
- */
- public void preSave(SaveStrategy aSaveStrategy) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException {
- //Default
- }
-
- /**
- * The file with the given uri has just been saved; add this to the list of saved files
- */
- protected void saved(String uri) {
- getSavedFiles().add(uri);
- }
-
- public void setSavedFiles(java.util.Set newSavedFiles) {
- savedFiles = newSavedFiles;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategy.java
deleted file mode 100644
index b1d85cc32..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-
-/**
- * ImportStrategy knows how to interpret the information in an archive, usually in deployment
- * descriptors, to build up a model of the contained objects.
- */
-public interface ImportStrategy extends ArchiveStrategy {
- /**
- * Helper method used for copying archives; create a new instance of this kind of strategy
- */
- public ImportStrategy createImportStrategy(Archive old, Archive newArchive);
-
- /**
- * Do whatever is necessary to bring in metadata from the archive and set the deployment
- * descriptors to the standard form that the apis can recognize
- */
- public void importMetaData() throws Exception;
-
- public boolean isEJB10();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategyImpl.java
deleted file mode 100644
index 17461739a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ImportStrategyImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-
-
-/**
- * Abstract implementation off which other import strategies can subclass
- *
- * @see ImportStrategy
- */
-public abstract class ImportStrategyImpl extends ArchiveStrategyImpl implements ImportStrategy {
- /**
- * ArchiveImportStrategy constructor comment.
- */
- public ImportStrategyImpl() {
- super();
- }
-
- public static CommonarchiveFactory getArchiveFactory() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public boolean isEJB10() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategy.java
deleted file mode 100644
index ec87290b2..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategy.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-
-
-/**
- * LoadStrategy knows how to load or read the contents of a container. This provides a delegation
- * model for reading in the contents of an archive file. Clients can implement this interface, and
- * "plug in" to an instance of an archive. Examples might include reading from a zip file, from an
- * input stream, from the local file system, or from a workbench.
- */
-public interface LoadStrategy {
- public void addOrReplaceMofResource(Resource aResource);
-
- /**
- * Release any resources being held by this object
- */
- public void close();
-
- public boolean contains(String uri);
-
- /**
- * Return the absolute path of this strategy, if it exists; cases where it might not exist is if
- * the load strategy is "virtual", e.g., a jar within a jar
- */
- public String getAbsolutePath() throws FileNotFoundException;
-
- /**
- * Return the absolute path of the root from which meta resources get loaded
- */
- public String getResourcesPath() throws FileNotFoundException;
-
- /**
- * Return the absolute path of the root from which classes and properties are loaded
- */
- public String getBinariesPath() throws FileNotFoundException;
-
-
- public Container getContainer();
-
- public ResourceSet getResourceSet();
-
- public ResourceSet primGetResourceSet();
-
- /**
- * Used internally; clients should not need to call
- */
- public FileIterator getFileIterator() throws IOException;
-
- /**
- * Used by an archive to obtain a list of it's files, which is usually deferred until the first
- * time it is invoked, as an optimization.
- */
- public List collectFiles();
-
- /**
- * Returns an input stream on an entry named by the parameter
- */
- public InputStream getInputStream(String uri) throws IOException, FileNotFoundException;
-
- /**
- * Returns an input stream on an entry named by the parameter, from the "resources path" of the
- * loose archive if it exists, Otherwise the default behavior is the same as
- * {@link #getInputStream(String)}
- */
- public InputStream getResourceInputStream(String uri) throws IOException;
-
- public Collection getLoadedMofResources();
-
- public Resource getExistingMofResource(String uri);
-
- public Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException;
-
- /**
- * An archive uses a custom class loader for java reflection within a mof resourceSet;
- * implementers of LoadStrategy may supply a mof resourceSet for which this class loader is not
- * necessary, or could even cause breakage; this test gives the strategy the chance to "opt out"
- * of the class loading game
- */
- public boolean isClassLoaderNeeded();
-
- /**
- * Returns whether this archive is reading files from a directory on the file system
- */
- public boolean isDirectory();
-
- public boolean isMofResourceLoaded(String uri);
-
- /**
- * Returns whether resources can be read by this strategy
- */
- public boolean isOpen();
-
- /**
- * Is the parameter in use by this strategy? Needed for when the archive is saved to the same
- * location from which it was read
- */
- public boolean isUsing(java.io.File aSystemFile);
-
- /**
- * Used for optimizations, where the contents of the archive have not been changed; instead of
- * iterating each file in the archive, we may be able to bulk save the whole thing
- */
- public boolean requiresIterationOnSave();
-
- public Resource makeMofResource(String uri, EList extent);
-
- public void setContainer(Container aContainer);
-
- public void setResourceSet(ResourceSet aResourceSet);
-
- public LooseArchive getLooseArchive();
-
- public void setLooseArchive(LooseArchive aLooseArchive);
-
- public java.util.List getFiles(String subfolderPath);
-
- public boolean isReadOnly();
-
- public void setReadOnly(boolean readOnly);
-
- public int getRendererType();
-
- public void setRendererType(int i);
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategyImpl.java
deleted file mode 100644
index 0d73c1643..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategyImpl.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jem.internal.java.adapters.jdk.JavaJDKAdapterFactory;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEResouceFactorySaxRegistry;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryDomRegistry;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveFactoryRegistry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ResourceLoadException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveURIConverterImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIteratorImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfigRegister;
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil;
-
-/**
- * Abstact implementer off which and load strategy may subclass
- *
- * @see LoadStrategy
- */
-public abstract class LoadStrategyImpl extends AdapterImpl implements LoadStrategy {
-
- /** flag to indicate whether underlying resources have been closed */
- protected boolean isOpen = true;
-
- /** The archive or directory to which this strategy belongs */
- protected Container container;
-
- /** ResourceSet used for mof/xmi resources */
- protected ResourceSet resourceSet;
-
- protected LooseArchive looseArchive;
-
- protected Map collectedLooseArchiveFiles = Collections.EMPTY_MAP;
-
- protected boolean readOnly = false;
-
- private int rendererType;
-
- public LoadStrategyImpl() {
- super();
- }
-
- /**
- * @see Archive
- */
- public void addOrReplaceMofResource(Resource aResource) {
- Resource existingResource = getResourceSet().getResource(aResource.getURI(), false);
- if (existingResource != null)
- getResourceSet().getResources().remove(existingResource);
- getResourceSet().getResources().add(aResource);
- }
-
- protected void updateModificationTracking(Resource res) {
- boolean trackingMods = res.isTrackingModification();
- boolean isReadOnly = (container != null) ? ((Archive) container).getOptions().isReadOnly() : false;
- boolean shouldTrackMods = !(isReadOnly || ArchiveUtil.isJavaResource(res) || ArchiveUtil.isRegisteredURIMapping(res));
- if (shouldTrackMods && !trackingMods)
- res.setTrackingModification(true);
- }
-
- /**
- * Release any resources being held by this object and set the state to closed. Subclasses
- * should override as necessary
- */
- public void close() {
- setIsOpen(false);
- if(resourceSet != null && resourceSet.eAdapters().contains(this))
- resourceSet.eAdapters().remove(this);
-
- }
-
- protected abstract boolean primContains(String uri);
-
- /**
- * @see LoadStrategy
- */
- public boolean contains(String uri) {
- if (containsUsingLooseArchive(uri))
- return true;
- return primContains(uri);
- }
-
- /*
- * Try the resources path first; if that false, see if we have a child loose archive with the
- * uri
- */
- protected boolean containsUsingLooseArchive(String uri) {
- if (getLooseArchive() == null)
- return false;
-
- LooseArchive loose = getLooseArchive();
- if (loose.getResourcesPath() == null)
- return false;
-
- java.io.File aFile = new java.io.File(loose.getResourcesPath(), uri);
- if (aFile.exists())
- return true;
-
- return LooseConfigRegister.singleton().findFirstLooseChild(uri, loose) != null;
- }
-
- protected File createDirectory(String uri){
- File aFile = null;
- aFile = getArchiveFactory().createFile();
- aFile.setDirectoryEntry(true);
- aFile.setURI(uri);
- aFile.setOriginalURI(uri);
- aFile.setLoadingContainer(getContainer());
- return aFile;
- }
-
- protected File createFile(String uri) {
- File aFile = null;
- if (isArchive(uri))
- aFile = openNestedArchive(uri);
- if (aFile == null) {
- aFile = getArchiveFactory().createFile();
- aFile.setURI(uri);
- aFile.setOriginalURI(uri);
- }
- aFile.setLoadingContainer(getContainer());
- return aFile;
- }
-
- @Override
- protected void finalize() throws Throwable {
- if(isOpen){
- close();
- }
- }
-
- /**
- * @see LoadStrategy
- */
- public java.lang.String getAbsolutePath() throws FileNotFoundException {
- throw new FileNotFoundException(CommonArchiveResourceHandler.Absolute_path_unknown_EXC_); // = "Absolute path unknown"
- }
-
- public String getResourcesPath() throws FileNotFoundException {
- return getLooseArchive() == null ? getAbsolutePath() : getLooseArchive().getResourcesPath();
- }
-
- protected String primGetResourcesPath() {
- return getLooseArchive() == null ? null : getLooseArchive().getResourcesPath();
- }
-
- public String getBinariesPath() throws FileNotFoundException {
- return getLooseArchive() == null ? getAbsolutePath() : getLooseArchive().getBinariesPath();
- }
-
- public CommonarchiveFactory getArchiveFactory() {
- return CommonArchiveFactoryRegistry.INSTANCE.getCommonArchiveFactory();
- }
-
- public Container getContainer() {
- return container;
- }
-
- public ResourceSet primGetResourceSet() {
- return resourceSet;
- }
-
- /**
- *
- * Should we iterate all the files in the archive as part of saving, or can we treat the archive
- * as one big file during save? The following rules apply, iterating the files if: 1) If the
- * archive is a module file and it is NOT read-only 2) If the load strategy is a directory 3) If
- * the archive is a utility JAR, and the files list has never been initialized, or if the
- * loading containers for all the files are the same AND not directories, AND the
- * {@link ArchiveOptions#isSaveLibrariesAsFiles()}of the archive is true.
- *
- * @see com.ibm.etools.archive.LoadStrategy#requiresIterationOnSave()
- */
- public boolean requiresIterationOnSave() {
- if (!getContainer().isArchive() || isDirectory())
- return true;
- Archive anArchive = (Archive) getContainer();
- //We should leave utility JARs intact, unless were told not to
- //The manifest may have been signed
- if (anArchive.isModuleFile())
- return !anArchive.getOptions().isReadOnly();
- else if (anArchive.getOptions().isSaveLibrariesAsFiles() && anArchive.getLoadingContainer() != null) {
- if (anArchive.isIndexed()) {
- List files = anArchive.getFiles();
- File aFile = null;
- Container firstContainer = null;
- Container lContainer = null;
- for (int i = 0; i < files.size(); i++) {
- aFile = (File) files.get(i);
- if (i == 0) {
- firstContainer = aFile.getLoadingContainer();
- if (firstContainer.getLoadStrategy().isDirectory())
- return true;
- }
- lContainer = aFile.getLoadingContainer();
- if (lContainer != firstContainer)
- return true;
- }
- }
- return false;
- } else
- return true;
- }
-
- public ResourceSet getResourceSet() {
- if (resourceSet == null) {
- initializeResourceSet();
- resourceSet.eAdapters().add(this);
- }
- return resourceSet;
- }
-
- /**
- * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(Notification)
- */
- @Override
- public void notifyChanged(Notification msg) {
- switch (msg.getEventType()) {
- case Notification.ADD :
- updateModificationTracking((Resource) msg.getNewValue());
- break;
- case Notification.ADD_MANY :
- List list = (List) msg.getNewValue();
- for (int i = 0; i < list.size(); i++) {
- updateModificationTracking((Resource) list.get(i));
- }
- }
- }
-
- /**
- * Used internally; clients should not need to call
- */
- public FileIterator getFileIterator() throws IOException {
- return new FileIteratorImpl(getContainer().getFiles());
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- public abstract List getFiles();
-
- public List collectFiles() {
- //The loose archives need to be read first
- collectFilesFromLooseArchives();
- List files = getFiles();
- files.addAll(collectedLooseArchiveFiles.values());
- collectedLooseArchiveFiles = Collections.EMPTY_MAP;
- return files;
- }
-
- protected void collectFilesFromLooseArchives() {
- if (!canHaveLooseChildren() || getLooseArchive() == null) {
- collectedLooseArchiveFiles = Collections.EMPTY_MAP;
- return;
- }
-
- collectedLooseArchiveFiles = new HashMap();
- List children = LooseConfigRegister.singleton().getLooseChildren(getLooseArchive());
-
- for (int i = 0; i < children.size(); i++) {
- LooseArchive loose = (LooseArchive) children.get(i);
- String uri = loose.getUri();
- if (!collectedLooseArchiveFiles.containsKey(uri)) {
- Archive archive = openNestedArchive(loose);
- if (archive != null) {
- collectedLooseArchiveFiles.put(uri, archive);
- archive.setLoadingContainer(getContainer());
- }
- }
- }
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- public abstract InputStream getInputStream(String uri) throws IOException, FileNotFoundException;
-
- public InputStream getResourceInputStream(String uri) throws IOException {
- return getResourceSet().getURIConverter().createInputStream(URI.createURI(uri));
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive returns an immutable collection of the loaded
- * resources in the resource set
- */
- public Collection getLoadedMofResources() {
- Collection resources = getResourceSet().getResources();
- if (resources.isEmpty())
- return Collections.EMPTY_LIST;
- List copyResources = new ArrayList();
- copyResources.addAll(resources);
-
- List result = new ArrayList(copyResources.size());
- Iterator iter = copyResources.iterator();
- while (iter.hasNext()) {
- Resource res = (Resource) iter.next();
- if (res.isLoaded())
- result.add(res);
- }
- return result;
- }
-
- /**
- * @see com.ibm.etools.commonarchive.Archive
- */
- public Resource getMofResource(String uri) throws FileNotFoundException, ResourceLoadException {
- try {
- return getResourceSet().getResource(URI.createURI(uri), true);
- } catch (WrappedException wrapEx) {
- if ((ExtendedEcoreUtil.getFileNotFoundDetector().isFileNotFound(wrapEx))) {
- FileNotFoundException fileNotFoundEx = ExtendedEcoreUtil.getInnerFileNotFoundException(wrapEx);
- throw fileNotFoundEx;
- }
- throwResourceLoadException(uri, wrapEx);
- return null; //never happens - compiler expects it though
- }
- }
-
- protected void initializeResourceSet() {
- //Not the best design here, because a load strategy should only know
- // about
- //container; however, this method will only get called when the
- // container
- //is an archive
- Archive archive = (Archive) getContainer();
- URIConverter converter = new ArchiveURIConverterImpl(archive, primGetResourcesPath());
- ResourceSet rs = new ResourceSetImpl();
- Resource.Factory.Registry reg = createResourceFactoryRegistry();
- rs.setResourceFactoryRegistry(reg);
- setResourceSet(rs);
- rs.setURIConverter(converter);
- if (archive.shouldUseJavaReflection()) {
- rs.getAdapterFactories().add(new JavaJDKAdapterFactory());
-
- // TFB: Problem here:
- // 'Archive.initializeClassLoader' calls
- // 'Archive.getJavaAdapterFactory', which
- // 'Archive.getResourceSet', which calls
- // 'LoadStrategy.initializeResourceSet', which calls
- // 'Archive.initializeClassLoader' all over again.
- //
- // This creates a second, redundant classloader,
- // and places the first classloader in the JavaJDKAdapterFactory.
- // Hence not only is the classloader created twice, but
- // both copies are active. When there are large classpaths,
- // this will large duplicate structures.
- //
- // Since the classloader will be initialized by 'getClassLoader',
- // the initialization, here, seems unnecessary.
-
- // archive.initializeClassLoader();
- }
- }
-
- protected Resource.Factory.Registry createResourceFactoryRegistry() {
- if (isReadOnly())
- return new J2EEResouceFactorySaxRegistry();
-
- Resource.Factory.Registry registry = null;
- switch (getRendererType()) {
- case ArchiveOptions.SAX :
- registry = new J2EEResouceFactorySaxRegistry();
- break;
- case ArchiveOptions.DOM :
- registry = new J2EEResourceFactoryDomRegistry();
- break;
- case ArchiveOptions.DEFAULT :
- default :
- registry = new J2EEResourceFactoryRegistry();
- break;
- }
- return registry;
- }
-
- /**
- * @return
- */
- public int getRendererType() {
- return rendererType;
- }
-
- protected boolean isArchive(String uri) {
- return ((Archive) getContainer()).isNestedArchive(uri);
- }
-
- /**
- * An archive uses a custom class loader for java reflection within a mof resourceSet;
- * implementers of LoadStrategy may supply a mof resourceSet for which this class loader is not
- * necessary, or could even cause breakage; this test gives the strategy the chance to "opt out"
- * of the class loading game
- */
- public boolean isClassLoaderNeeded() {
- return true;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy The default is false
- */
- public boolean isDirectory() {
- return false;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy#getExistingMofResource(String)
- */
- public Resource getExistingMofResource(String uri) {
- return getResourceSet().getResource(URI.createURI(uri), false);
- }
-
- public boolean isMofResourceLoaded(java.lang.String uri) {
- Resource res = getExistingMofResource(uri);
- return res != null && res.isLoaded();
- }
-
- public boolean isOpen() {
- return isOpen;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy return false by default; subclasses should override
- * if necessary
- */
- public boolean isUsing(java.io.File aSystemFile) {
- return false;
- }
-
- public Resource makeMofResource(String uri, EList extent) {
- Resource existing = getExistingMofResource(uri);
- if (existing != null)
- return existing;
- return getResourceSet().createResource(URI.createURI(uri));
- }
-
- protected Archive openNestedArchive(String uri) {
-
- try {
- return ((Archive) getContainer()).openNestedArchive(uri);
- } catch (OpenFailureException e) {
- //Caught an exception trying to open the nested archive
- J2EECorePlugin.logError(e);
- return null;
- }
-
- }
-
- protected Archive openNestedArchive(LooseArchive loose) {
-
- try {
- return ((Archive) getContainer()).openNestedArchive(loose);
- } catch (OpenFailureException e) {
- //Caught an exception trying to open the nested archive
- J2EECorePlugin.logError(e);
- return null;
- }
-
- }
-
- public void setContainer(Container newContainer) {
- container = newContainer;
- }
-
- public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet newResourceSet) {
- // fixes problem in reopen
- if (resourceSet != newResourceSet) {
-
- // remove adapter from old resource set
- if (resourceSet != null)
- resourceSet.eAdapters().remove(this);
-
- // add as adapter to new resource set if necessary
- if (newResourceSet != null && !newResourceSet.eAdapters().contains(this))
- newResourceSet.eAdapters().add(this);
-
- resourceSet = newResourceSet;
- } // no need to update if old set equals new set (by reference)
- }
-
- protected void setIsOpen(boolean newIsOpen) {
- isOpen = newIsOpen;
- }
-
- protected void throwResourceLoadException(String resourceUri, Exception ex) throws ResourceLoadException {
- throw new ResourceLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.load_resource_EXC_, (new Object[]{resourceUri, getContainer().getURI()})), ex); // = "Could not load resource "{0}" in archive "{1}""
- }
-
- /**
- * Gets the looseArchive.
- *
- * @return Returns a LooseArchive
- */
- public LooseArchive getLooseArchive() {
- return looseArchive;
- }
-
- /**
- * Sets the looseArchive.
- *
- * @param looseArchive
- * The looseArchive to set
- */
- public void setLooseArchive(LooseArchive looseArchive) {
- this.looseArchive = looseArchive;
- checkLoosePathsValid();
- }
-
- /*
- * Added to support WAS runtime; throw an ArchiveRuntimeException if one of the paths in the
- * loose config does not point to an existing file
- */
- protected void checkLoosePathsValid() {
- if (looseArchive == null)
- return;
-
- String path = looseArchive.getBinariesPath();
- if (path != null) {
- java.io.File ioFile = new java.io.File(path);
- if (!ioFile.exists())
- throw new ArchiveRuntimeException("Invalid binaries path: " + path); //$NON-NLS-1$
- }
- path = looseArchive.getResourcesPath();
- if (path != null) {
- java.io.File ioFile = new java.io.File(path);
- if (!ioFile.exists())
- throw new ArchiveRuntimeException("Invalid resources path: " + path); //$NON-NLS-1$
- }
- }
-
- protected boolean canHaveLooseChildren() {
- return container.isEARFile() || container.isWARFile();
- }
-
- public boolean isReadOnly() {
- return readOnly;
- }
-
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- /**
- * @param rendererType
- * The rendererType to set.
- */
- public void setRendererType(int rendererType) {
- this.rendererType = rendererType;
- }
-
- public java.util.List getFiles(String subfolderPath) {
- List subset = new ArrayList();
- List theFiles = getFiles();
- for (int i = 0; i < theFiles.size(); i++) {
- File aFile = (File)theFiles.get(i);
- if (aFile.getURI().startsWith(subfolderPath))
- subset.add(aFile);
- }
- return subset;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NestedArchiveLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NestedArchiveLoadStrategyImpl.java
deleted file mode 100644
index 776dabc8c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NestedArchiveLoadStrategyImpl.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.NestedJarException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.NestedArchiveIterator;
-
-
-/**
- * Load strategy used as a last resort to read entries from jars inside of jars. It is a last resort
- * because of the poor perfomance involved, as the contents of the zip entries are not cached, and
- * sequential scan searches will cause the zip stream to be inflated on each search. Whenever
- * possible,
- *
- * @link {TempFileLoadStrategy} should be used.
- */
-public class NestedArchiveLoadStrategyImpl extends LoadStrategyImpl {
- /**
- * Index to improve lookup performance - not used if in Runtime to reduce footprint
- */
- protected Map urisToPositions;
- protected LoadStrategy parent;
-
- /**
- * NestedArchiveLoadStrategyImpl constructor comment.
- */
- public NestedArchiveLoadStrategyImpl(LoadStrategy parentStrategy) {
- super();
- setParent(parentStrategy);
- }
-
- protected void buildIndex() {
- Map map = new HashMap();
- try {
- ZipInputStream zis = getZipInputStream();
- ZipEntry entry = null;
- long position = 0;
- while ((entry = zis.getNextEntry()) != null) {
- position++;
- map.put(entry.getName(), new Long(position));
- }
- } catch (IOException iox) {
- throwNestedJarException(iox);
- }
- setUrisToPositions(map);
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- protected boolean primContains(String uri) {
- if (usingIndex())
- return containsUsingIndex(uri);
- return containsSequentially(uri);
- }
-
-
- protected boolean containsSequentially(String uri) {
- ZipInputStream zis = null;
- try {
- zis = getZipInputStreamSkippedTo(uri);
- return zis != null;
- } catch (IOException ex) {
- return false;
- } finally {
- if (zis != null) {
- try {
- zis.close();
- } catch (IOException ioe) {
- //Ignore
- }
- }
- }
- }
-
-
- protected boolean containsUsingIndex(String uri) {
- return getUrisToPositions().containsKey(uri);
- }
-
-
- /**
- * Used internally; clients should not need to call
- */
- @Override
- public FileIterator getFileIterator() throws IOException {
- if (((Archive) getContainer()).getOptions().isReadOnly())
- return new NestedArchiveIterator(getContainer().getFiles(), getZipInputStream());
- return super.getFileIterator();
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.util.List getFiles() {
- List list = new ArrayList(500);
- ZipInputStream zis = null;
- try {
- zis = getZipInputStream();
- ZipEntry entry = zis.getNextEntry();
- while (entry != null) {
- if (!entry.isDirectory()) {
- File aFile = createFile(entry.getName());
- aFile.setSize(entry.getSize());
- aFile.setLastModified(entry.getTime());
- list.add(aFile);
- }
- entry = zis.getNextEntry();
- }
- } catch (IOException iox) {
- throwNestedJarException(iox);
- } finally {
- if (zis != null) {
- try {
- zis.close();
- } catch (IOException iox) {
- //Ignore
- }
- }
- }
- return list;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.io.InputStream getInputStream(String uri) throws IOException, FileNotFoundException {
- if (usingIndex())
- return getInputStreamUsingIndex(uri);
- return getInputStreamSequentially(uri);
- }
-
- protected java.io.InputStream getInputStreamSequentially(String uri) throws IOException, FileNotFoundException {
- return new java.io.BufferedInputStream(getZipInputStreamSkippedTo(uri));
- }
-
- protected java.io.InputStream getInputStreamUsingIndex(String uri) throws IOException, FileNotFoundException {
- Long position = (Long) getUrisToPositions().get(uri);
- if (position == null)
- throw new FileNotFoundException();
- ZipInputStream zis = getZipInputStream();
- long pos = position.longValue();
- for (long i = 0; i < pos; i++) {
- zis.getNextEntry();
- }
- return new java.io.BufferedInputStream(zis);
- }
-
- /**
- * Insert the method's description here. Creation date: (12/07/00 6:12:36 PM)
- *
- * @return com.ibm.etools.archive.LoadStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy getParent() {
- return parent;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/07/00 4:38:21 PM)
- *
- * @return java.util.Map
- */
- public java.util.Map getUrisToPositions() {
- if (usingIndex() && urisToPositions == null)
- buildIndex();
- return urisToPositions;
- }
-
- protected ZipInputStream getZipInputStream() throws IOException, FileNotFoundException {
- String uri = getContainer().getURI();
- InputStream in = getParent().getInputStream(uri);
- return new ZipInputStream(in);
- }
-
- protected ZipInputStream getZipInputStreamSkippedTo(String uri) throws IOException, FileNotFoundException {
- if (uri == null)
- throw new NullPointerException(CommonArchiveResourceHandler.Null_uri_EXC_); // = "Null uri"
- ZipInputStream zis = null;
- ZipEntry entry = null;
- try {
- zis = getZipInputStream();
- entry = zis.getNextEntry();
- while (entry != null) {
- if (uri.equals(entry.getName()))
- return zis;
- entry = zis.getNextEntry();
- }
- } finally {
- // entry was not found so close the stream
- if (entry == null && zis != null) {
- try {
- zis.close();
- } catch (IOException ioe) {
- //Ignore
- }
- }
- }
- throw new FileNotFoundException(uri);
- }
-
- /**
- * Insert the method's description here. Creation date: (12/07/00 6:12:36 PM)
- *
- * @param newParent
- * com.ibm.etools.archive.LoadStrategy
- */
- public void setParent(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy newParent) {
- parent = newParent;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/07/00 4:38:21 PM)
- *
- * @param newUrisToPositions
- * java.util.Map
- */
- public void setUrisToPositions(java.util.Map newUrisToPositions) {
- urisToPositions = newUrisToPositions;
- }
-
- /**
- * An exception was caught reading the nested jar; throws a runtime exception
- */
- protected void throwNestedJarException(Exception caughtException) {
- throw new NestedJarException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.nested_jar_EXC_, (new Object[]{getContainer().getURI(), getParent().getContainer().getURI()})), caughtException);// = "An error occurred reading {0} from {1}"
- }
-
- /**
- * Don't use the index in the runtime environment; reduce footprint
- */
- public boolean usingIndex() {
- return false;
- //return !com.ibm.etools.archive.util.ArchiveUtil.isRuntime();
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NullLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NullLoadStrategyImpl.java
deleted file mode 100644
index 4953ad68b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NullLoadStrategyImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * No-op implementer used for new archive instances, which have their contents added and copied from
- * other sources
- */
-public class NullLoadStrategyImpl extends LoadStrategyImpl {
- protected static List emptyList = new ArrayList(0);
-
- /**
- * NullLoadStrategy constructor comment.
- */
- public NullLoadStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public boolean contains(String uri) {
- return false;
- }
-
- @Override
- protected boolean primContains(String uri) {
- return false;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.util.List getFiles() {
- return emptyList;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.io.InputStream getInputStream(String uri) throws java.io.IOException, java.io.FileNotFoundException {
- throw new java.io.FileNotFoundException(uri);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarExportStrategyImpl.java
deleted file mode 100644
index 87e77e3b1..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarExportStrategyImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-
-/**
- * Concrete implementer that knows how to export meta-data for a J2C Resource Adapter
- */
-public class RarExportStrategyImpl extends ExportStrategyImpl {
- /**
- * RarExportStrategy constructor comment.
- */
- public RarExportStrategyImpl() {
- super();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarImportStrategyImpl.java
deleted file mode 100644
index d4ec67bb7..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarImportStrategyImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver;
-import org.eclipse.jst.j2ee.jca.Connector;
-
-
-/**
- * Concrete implementer that knows how to import meta-data for a J2C Resource Adapter
- */
-public class RarImportStrategyImpl extends XmlBasedImportStrategyImpl {
-
- public static class Discriminator extends ArchiveTypeDiscriminatorImpl {
- @Override
- public boolean canImport(Archive anArchive) {
- return anArchive.containsFile(J2EEConstants.RAR_DD_URI);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return new RarImportStrategyImpl();
- }
-
- public String getUnableToOpenMessage() {
- return getXmlDDMessage(CommonArchiveResourceHandler.RAR_File, J2EEConstants.RAR_DD_URI); // = "RAR File"
- }
-
- @Override
- public Archive createConvertedArchive() {
- return getArchiveFactory().createRARFile();
- }
- }
-
- protected static Discriminator discriminator;
-
- /**
- * RarImportStrategy constructor comment.
- */
- public RarImportStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return getDiscriminator().createImportStrategy(old, newArchive);
- }
-
- public static ArchiveTypeDiscriminator getDiscriminator() {
- if (discriminator == null) {
- discriminator = new Discriminator();
- // Connectors use their own special entity resolver for now...
- J2EEXmlDtDEntityResolver.registerDtD(J2EEConstants.CONNECTOR_SYSTEMID_1_0, "connector_1_0.dtd"); //$NON-NLS-1$
- }
- return discriminator;
- }
-
- public RARFile getRARFile() {
- return (RARFile) getArchive();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public void importMetaData() throws Exception {
- loadDeploymentDescriptor();
- }
-
- public void loadDeploymentDescriptor() throws Exception {
- Connector connector = null;
-
- connector = (Connector) primLoadDeploymentDescriptor();
- getRARFile().setDeploymentDescriptor(connector);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ReadOnlyDirectoryLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ReadOnlyDirectoryLoadStrategyImpl.java
deleted file mode 100644
index 8e64ba914..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ReadOnlyDirectoryLoadStrategyImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-
-public class ReadOnlyDirectoryLoadStrategyImpl extends DirectoryLoadStrategyImpl {
- protected java.io.File subdirectory;
-
- /**
- * ReadOnlyDirectoryLoadStrategy constructor comment.
- */
- public ReadOnlyDirectoryLoadStrategyImpl(String aDirectoryUri) {
- super(aDirectoryUri);
- }
-
- /**
- * ReadOnlyDirectoryLoadStrategy constructor comment.
- */
- public ReadOnlyDirectoryLoadStrategyImpl(String rootDirectoryUri, java.io.File subdir) {
- super(rootDirectoryUri);
- setSubdirectory(subdir);
- }
-
- /**
- * addDirectory method comment.
- */
- @Override
- protected void addDirectory(java.io.File aFile, java.util.List aList) {
- ReadOnlyDirectory dir = getArchiveFactory().createReadOnlyDirectory();
- dir.setLastModified(aFile.lastModified());
- dir.setURI(getURIFrom(aFile));
- dir.setLoadingContainer(getContainer());
- dir.setLoadStrategy(new ReadOnlyDirectoryLoadStrategyImpl(getDirectoryUri(), aFile));
- aList.add(dir);
-
- }
-
- @Override
- public boolean contains(java.lang.String uri) {
- return super.contains(uri) && (getSubdirectory() == null || subdirectoryContains(uri));
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException {
- java.io.File subdir = getSubdirectory();
- if (subdir == null) {
- return super.getAbsolutePath();
- }
- return subdir.getAbsolutePath();
- }
-
- /**
- * getDirectoryForList method comment.
- */
- @Override
- protected java.io.File getDirectoryForList() {
- if (getSubdirectory() != null)
- return getSubdirectory();
- return new java.io.File(getDirectoryUri());
- }
-
- /**
- * Insert the method's description here. Creation date: (01/08/01 1:10:47 PM)
- *
- * @return java.io.File
- */
- protected java.io.File getSubdirectory() {
- return subdirectory;
- }
-
- /**
- * Always return false, because we want to treat the entries in a file system directory as basic
- * files
- */
- @Override
- protected boolean isArchive(String uri) {
- return false;
- }
-
- /**
- * Insert the method's description here. Creation date: (01/08/01 1:10:47 PM)
- *
- * @param newSubdirectory
- * java.io.File
- */
- protected void setSubdirectory(java.io.File newSubdirectory) {
- subdirectory = newSubdirectory;
- }
-
- protected boolean subdirectoryContains(String uri) {
- if (getSubdirectory() == null)
- return false;
- java.io.File aFile = new java.io.File(getFileNameFrom(uri)).getParentFile();
- boolean contains = false;
- while (aFile != null && !contains) {
- if (getSubdirectory().equals(aFile)) {
- contains = true;
- } else {
- aFile = aFile.getParentFile();
- }
- }
- return contains;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategy.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategy.java
deleted file mode 100644
index d3bce2cb3..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter;
-
-
-/**
- * Knows how to export the contents of an archive file. This provides a delegation model saving the
- * archive. Examples might include exporting to a zip output stream, to the file system, or into a
- * workbench.
- */
-public interface SaveStrategy extends ArchiveStrategy {
- /**
- * Close and release any resources being held by this object
- */
- public void close() throws java.io.IOException;
-
- /**
- * Notify resources if necessary that save is complete for this archive, being careful not to
- * close any resources that a parent archive might still be using
- */
- public void finish() throws java.io.IOException;
-
- public SaveFilter getFilter();
-
- /**
- * Returns whether this archive is saving files to a directory on the file system
- */
- public boolean isDirectory();
-
- public void save() throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-
- public void save(ArchiveManifest aManifest) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-
- public void save(File aFile, FileIterator iterator) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-
- public void save(File aFile, java.io.InputStream in) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-
- public void saveMofResource(Resource aResource) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-
- public void setFilter(SaveFilter aFilter);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategyImpl.java
deleted file mode 100644
index bd998054a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/SaveStrategyImpl.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilterImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.utilities.Revisit;
-
-
-/**
- * Abstract implementer off which any save strategy can subclass
- *
- * @see com.ibm.etools.archive.SaveStrategy
- */
-
-public abstract class SaveStrategyImpl extends ArchiveStrategyImpl implements SaveStrategy {
- protected SaveFilter filter;
-
- /**
- * SaveStrategyImpl constructor comment.
- */
- public SaveStrategyImpl() {
- super();
- }
-
- /**
- * The default is to do nothing - subclasses should override as necessary
- */
- public void close() throws java.io.IOException {
- //Default
- }
-
- protected abstract SaveStrategy createNestedSaveStrategy(Archive anArchive) throws java.io.IOException;
-
- /**
- * The default is to do nothing - subclasses should override as necessary
- */
- public void finish() throws java.io.IOException {
- //Default
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 4:11:28 PM)
- *
- * @return com.ibm.etools.archive.SaveFilter
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter getFilter() {
- if (filter == null)
- filter = new SaveFilterImpl();
- return filter;
- }
-
- protected abstract OutputStream getOutputStreamForResource(Resource aResource) throws java.io.IOException;
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public boolean isDirectory() {
- return false;
- }
-
- protected boolean isLoadedResourceOrManifest(File aFile) {
- return getArchive().isMofResourceLoaded(aFile.getURI()) || aFile.getURI().equals(J2EEConstants.MANIFEST_URI);
- }
-
- public void save() throws SaveFailureException {
-
- saveManifest();
- saveMofResources();
- saveFiles();
-
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void save(Archive anArchive) throws SaveFailureException {
- SaveStrategy strat = null;
- try {
- strat = createNestedSaveStrategy(anArchive);
- } catch (java.io.IOException iox) {
- throw new SaveFailureException(anArchive.getURI(), iox);
- }
- anArchive.save(strat);
-
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void save(File aFile, FileIterator iterator) throws SaveFailureException {
- if (aFile.isArchive() && shouldIterateOver((Archive) aFile))
- save((Archive) aFile);
- else {
- InputStream in = null;
- if (!aFile.isDirectoryEntry()) {
- try {
- in = iterator.getInputStream(aFile);
- } catch (IOException ex) {
- throw new SaveFailureException(aFile.getURI(), ex);
- }
- }
- save(aFile, in);
- }
- }
-
- public abstract void save(File aFile, InputStream in) throws SaveFailureException;
-
- protected void saveFiles() throws SaveFailureException {
- try {
- FileIterator iterator = getArchive().getFilesForSave();
- while (iterator.hasNext()) {
- File aFile = iterator.next();
- if (shouldSave(aFile))
- save(aFile, iterator);
- }
- } catch (IOException iox) {
- throw new SaveFailureException(CommonArchiveResourceHandler.Error_occurred_iterating_f_EXC_, iox); // = "Error occurred iterating files"
- }
- }
-
- protected void saveManifest() throws SaveFailureException {
- if (!shouldSave(J2EEConstants.MANIFEST_URI))
- return;
- ArchiveManifest mf = getArchive().getManifest();
- if (mf.getManifestVersion() == null || mf.getManifestVersion().equals(""))//$NON-NLS-1$
- mf.setManifestVersion("1.0");//$NON-NLS-1$
- save(mf);
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void saveMofResource(org.eclipse.emf.ecore.resource.Resource aResource) throws SaveFailureException {
- if (!shouldSave(aResource))
- return;
- setEncoding(aResource);
- try {
- boolean wasModified = aResource.isModified();
- OutputStream os = getOutputStreamForResource(aResource);
- saveMofResource(aResource, os);
- aResource.setModified(wasModified);
- } catch (Exception e) {
- throw new SaveFailureException(aResource.getURI().toString(), e);
- }
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- protected void saveMofResource(org.eclipse.emf.ecore.resource.Resource aResource, OutputStream os) throws IOException {
- aResource.save(os, Collections.EMPTY_MAP);
- }
-
- protected void saveMofResources() throws SaveFailureException {
- Iterator iterator = getArchive().getLoadedMofResources().iterator();
- //We have to go through this process because java resources could get added during the
- //process of iterating and saving, and adding to a collection while iterating causes a
- // failure
- List xmiResources = new ArrayList();
- //We will save the xmi resources first, then the xml resources. This way the
- //any necessary id's for referenced objects will have been generated prior to save
- List xmlResources = new ArrayList();
- Resource res = null;
- while (iterator.hasNext()) {
- res = (Resource) iterator.next();
- // We don't want to save the java reflection resources or uri mapped resources
- if (!ArchiveUtil.isJavaResource(res) && !ArchiveUtil.isRegisteredURIMapping(res) && !ArchiveUtil.isPlatformMetaResource(res)) {
- Revisit.revisit();
- //For now, always use the mof5 format
- if (res instanceof CompatibilityXMIResource)
- ((CompatibilityXMIResource) res).setFormat(CompatibilityXMIResource.FORMAT_MOF5);
- if (res instanceof TranslatorResource)
- xmlResources.add(res);
- else {
- xmiResources.add(res);
- }
- }
- }
- basicSaveMofResources(xmiResources);
- basicSaveMofResources(xmlResources);
- }
-
- protected void basicSaveMofResources(List resources) throws SaveFailureException {
- Resource res = null;
- for (int i = 0; i < resources.size(); i++) {
- res = (Resource) resources.get(i);
- saveMofResource(res);
-
- }
- }
-
- protected void setEncoding(Resource aResource) {
- if (aResource instanceof org.eclipse.emf.ecore.xmi.XMLResource)
- ((org.eclipse.emf.ecore.xmi.XMLResource) aResource).setEncoding(archive.getXmlEncoding());
- }
-
- /**
- * Insert the method's description here. Creation date: (02/28/01 4:11:28 PM)
- *
- * @param newFilter
- * com.ibm.etools.archive.SaveFilter
- */
- public void setFilter(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter newFilter) {
- filter = newFilter;
- }
-
- /**
- * Answer whether the nested archive needs to be saved one file at a time, or if we can bulk
- * save it from the original
- */
- protected boolean shouldIterateOver(Archive anArchive) {
- return anArchive.getLoadStrategy().requiresIterationOnSave();
- }
-
- protected boolean shouldSave(File aFile) {
- boolean loaded = isLoadedResourceOrManifest(aFile);
- if (loaded) {
- Resource res = archive.getLoadStrategy().getExistingMofResource(aFile.getURI());
- if (res == null)
- return false;
- //must be manifest
- return !shouldSave(res);
- }
-
- if (getArchive().isModuleFile()) {
- ModuleFile m = (ModuleFile) getArchive();
- if (m.getExportStrategy() != null && m.getExportStrategy().hasSaved(aFile.getURI()))
- return false;
- }
- return shouldSave(aFile.getURI());
- }
-
- protected boolean shouldSave(Resource res) {
- if (!res.isModified() && getArchive().getOptions().saveOnlyDirtyMofResources())
- return false;
-
- return shouldSave(res.getURI().toString());
- }
-
-
- /**
- * This is the one method through which all elements of an archive (file, nested archive, mof
- * resource, or manifest) will be tested before saving. Subclasses can override to do something
- * more specific
- */
- protected boolean shouldSave(String uri) {
- return getFilter().shouldSave(uri, getArchive());
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/TempZipFileLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/TempZipFileLoadStrategyImpl.java
deleted file mode 100644
index 298cc856a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/TempZipFileLoadStrategyImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.File;
-import java.io.FileNotFoundException;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.DeleteOnExitUtility;
-
-
-/**
- * Used as an optimization for reading jars within jars. Reading from a ZipFile is much faster than
- * from a ZipInputStream, therefore, when possible, it makes sense to copy the nested jar to a temp
- * file. It is the responsibility of the caller to ensure that the temp file gets deleted on normal
- * system exit, using the helper method on java.io.File. This strategy will also delete the file
- * when closed or finalized.
- */
-public class TempZipFileLoadStrategyImpl extends ZipFileLoadStrategyImpl {
- /**
- * TemporaryZipFileLoadStrategyImpl constructor comment.
- */
- public TempZipFileLoadStrategyImpl() {
- super();
- }
-
- /**
- * TemporaryZipFileLoadStrategyImpl constructor comment.
- *
- * @param file
- * java.io.File
- * @throws java.io.IOException
- * The exception description.
- */
- public TempZipFileLoadStrategyImpl(java.io.File file) throws java.io.IOException {
- super(file);
- }
-
- @Override
- public void close() {
- super.close();
- File file = getFile();
- file.delete();
- DeleteOnExitUtility.fileHasBeenDeleted(file);
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException {
- throw new FileNotFoundException(CommonArchiveResourceHandler.Absolute_path_unknown_EXC_); // = "Absolute path unknown"
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ExportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ExportStrategyImpl.java
deleted file mode 100644
index 2120efce9..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ExportStrategyImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-
-/**
- * Concrete implementer that knows how to export meta-data for a 2.2 Web app
- */
-public class War22ExportStrategyImpl extends ExportStrategyImpl {
- /**
- * War22ExportStrategy constructor comment.
- */
- public War22ExportStrategyImpl() {
- super();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ImportStrategyImpl.java
deleted file mode 100644
index a0ac14a38..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ImportStrategyImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-
-/**
- * Concrete implementer that knows how to import meta-data for a 2.2 Web app
- */
-public class War22ImportStrategyImpl extends XmlBasedImportStrategyImpl {
-
- public static class Discriminator extends ArchiveTypeDiscriminatorImpl {
- @Override
- public boolean canImport(Archive anArchive) {
- return anArchive.containsFile(J2EEConstants.WEBAPP_DD_URI);
- }
-
- /**
- * @see com.ibm.etools.archive.ArchiveTypeDiscriminator
- */
- @Override
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return new War22ImportStrategyImpl();
- }
-
- public String getUnableToOpenMessage() {
- return getXmlDDMessage(CommonArchiveResourceHandler.WAR_File, J2EEConstants.WEBAPP_DD_URI); // = "WAR File"
- }
-
- @Override
- public Archive createConvertedArchive() {
- return getArchiveFactory().createWARFile();
- }
- }
-
- protected static Discriminator discriminator;
-
- /**
- * War22ImportStrategy constructor comment.
- */
- public War22ImportStrategyImpl() {
- super();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) {
- return getDiscriminator().createImportStrategy(old, newArchive);
- }
-
- public static ArchiveTypeDiscriminator getDiscriminator() {
- if (discriminator == null) {
- discriminator = new Discriminator();
- }
- return discriminator;
- }
-
- public WARFile getWARFile() {
- return (WARFile) getArchive();
- }
-
- /**
- * @see com.ibm.etools.archive.ImportStrategy
- */
- public void importMetaData() throws Exception {
- loadDeploymentDescriptor();
- }
-
- public void loadDeploymentDescriptor() throws Exception {
-
- WebApp webapp = null;
- webapp = (WebApp) primLoadDeploymentDescriptor();
-
- getWARFile().setDeploymentDescriptor(webapp);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/XmlBasedImportStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/XmlBasedImportStrategyImpl.java
deleted file mode 100644
index f36bfe0e0..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/XmlBasedImportStrategyImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-
-
-/**
- * Abstract implementer for archives that use xml deployment descriptors
- */
-public abstract class XmlBasedImportStrategyImpl extends ImportStrategyImpl {
- /**
- * XmlBasedImportStrategy constructor comment.
- */
- public XmlBasedImportStrategyImpl() {
- super();
- }
-
- public ModuleFile getModuleFile() {
- return (ModuleFile) getArchive();
- }
-
- protected EObject primLoadDeploymentDescriptor() throws Exception {
- Resource resource = null;
-
- resource = getModuleFile().getDeploymentDescriptorResource();
- EObject root = null;
-
- root = ArchiveUtil.getRoot(resource);
-
- return root;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipFileLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipFileLoadStrategyImpl.java
deleted file mode 100644
index cdac5d668..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipFileLoadStrategyImpl.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-
-
-/**
- * Implementer that knows how to read files from a zip/jar file on the local file system
- *
- * @see LoadStrategy
- */
-
-public class ZipFileLoadStrategyImpl extends LoadStrategyImpl {
- protected java.io.File file;
- protected ZipFile zipFile;
-
- /**
- * ZipFileLoadStrategy constructor comment.
- */
- public ZipFileLoadStrategyImpl() {
- super();
- }
-
- /**
- * ZipFileLoadStrategy constructor comment.
- */
- public ZipFileLoadStrategyImpl(java.io.File file) throws IOException {
- super();
- setFile(file);
- setZipFile(org.eclipse.jst.jee.archive.internal.ArchiveUtil.newZipFile(file));
- }
-
- @Override
- public void close() {
- super.close();
- try {
- getZipFile().close();
- } catch (Throwable t) {
- //Ignore
- }
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- protected boolean primContains(java.lang.String uri) {
- return getZipFile().getEntry(uri) != null;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException {
- return getFile().getAbsolutePath();
- }
-
- /**
- * Insert the method's description here. Creation date: (12/20/00 4:40:14 PM)
- *
- * @return java.io.File
- */
- public java.io.File getFile() {
- return file;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.util.List getFiles() {
- List list = new ArrayList();
- Enumeration entries = getZipFile().entries();
- while (entries.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- if (!entry.isDirectory()){
- if(!collectedLooseArchiveFiles.containsKey(entry.getName())) {
- File aFile = createFile(entry.getName());
- aFile.setSize(entry.getSize());
- aFile.setLastModified(entry.getTime());
- list.add(aFile);
- }
- } else if(includeEmptyDirectories) {
- File aFile = createDirectory(entry.getName());
- aFile.setDirectoryEntry(true);
- aFile.setSize(entry.getSize());
- aFile.setLastModified(entry.getTime());
- list.add(aFile);
- }
- }
- return list;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.LoadStrategyImpl
- */
- @Override
- public java.io.InputStream getInputStream(java.lang.String uri) throws IOException, FileNotFoundException {
- try {
- ZipEntry entry = getZipFile().getEntry(uri);
- if (entry == null)
- throw new FileNotFoundException(uri);
-
- return new java.io.BufferedInputStream(getZipFile().getInputStream(entry));
- } catch (IllegalStateException zipClosed) {
- throw new IOException(zipClosed.toString());
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (11/01/00 11:28:12 AM)
- *
- * @return java.util.zip.ZipFile
- */
- public java.util.zip.ZipFile getZipFile() {
- return zipFile;
- }
-
- /**
- * @see com.ibm.etools.archive.LoadStrategy
- */
- @Override
- public boolean isUsing(java.io.File aSystemFile) {
- return getFile() != null && getFile().equals(aSystemFile);
- }
-
- /**
- * Insert the method's description here. Creation date: (12/20/00 4:40:14 PM)
- *
- * @param newFile
- * java.io.File
- */
- public void setFile(java.io.File newFile) {
- file = newFile;
- }
-
-
- /**
- * Insert the method's description here. Creation date: (11/01/00 11:28:12 AM)
- *
- * @param newZipFile
- * java.util.zip.ZipFile
- */
- public void setZipFile(java.util.zip.ZipFile newZipFile) {
- zipFile = newZipFile;
- }
-
- /**
- * This field is used to determine whether empty directories should be included in the
- * file list of this archive. The default value is set to {@link #ArchiveUtil.INCLUDE_EMPTY_DIRECTORIES}
- */
- private boolean includeEmptyDirectories = ArchiveUtil.INCLUDE_EMPTY_DIRECTORIES;
-
- /**
- * If this value has not been set, the default is defined by {@link #ArchiveUtil.INCLUDE_EMPTY_DIRECTORIES}.
- *
- * If this value is <code>true></code> then empty directories will be included in {@link #getFiles()}.
- *
- * @see #setIncludeEmptyDirectories(boolean)
- */
- public boolean isIncludeEmptyDirectories() {
- return includeEmptyDirectories;
- }
-
- /**
- * If this value has not been set, the default is defined by {@link #ArchiveUtil.INCLUDE_EMPTY_DIRECTORIES}.
- *
- * @see #isIncludeEmptyDirectories()
- */
- public void setIncludeEmptyDirectories(boolean includeEmptyDirectories) {
- this.includeEmptyDirectories = includeEmptyDirectories;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipStreamSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipStreamSaveStrategyImpl.java
deleted file mode 100644
index 12c92ff59..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipStreamSaveStrategyImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.internal.emf.resource.CompatibilityURIConverter;
-import org.eclipse.wst.common.internal.emf.utilities.Revisit;
-
-
-/**
- * This is a concrete implentation of SaveStrategy. All the contents of the archive, including xmi
- * resources, will be output to a ZipOutputStream. The output stream should be passed in by the
- * client.
- */
-public class ZipStreamSaveStrategyImpl extends SaveStrategyImpl {
- protected OutputStream destinationStream;
- /** Used internally */
- protected ZipOutputStream zipOutputStream;
-
- /**
- * Wraps a new zip output stream around the parameter
- */
- public ZipStreamSaveStrategyImpl(OutputStream out) {
- setDestinationStream(out);
- setZipOutputStream(new ZipOutputStream(out));
- }
-
- @Override
- public void close() throws IOException {
- getDestinationStream().close();
- }
-
- @Override
- protected SaveStrategy createNestedSaveStrategy(Archive anArchive) {
- return new ZipStreamSaveStrategyImpl(getZipOutputStream());
- }
-
- @Override
- public void finish() throws IOException {
- getZipOutputStream().finish();
- //If this is not nested, close the stream to free up the resource
- //otherwise, don't close it because the parent may not be done
- if (!(getDestinationStream() instanceof ZipOutputStream))
- getDestinationStream().close();
- }
-
- /**
- * @return java.io.OutputStream
- */
- public java.io.OutputStream getDestinationStream() {
- return destinationStream;
- }
-
- /**
- * @see com.ibm.etools.archive.impl.SaveStrategyImpl
- */
- @Override
- protected java.io.OutputStream getOutputStreamForResource(Resource aResource) throws java.io.IOException {
- return getZipOutputStream();
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy#saveMofResource(Resource)
- */
- @Override
- public void saveMofResource(Resource aResource, OutputStream out) throws IOException {
- Revisit.revisit();
- URI uri = aResource.getURI();
- //Ensure container relative URI
- URIConverter conv = getArchive().getResourceSet().getURIConverter();
- if (conv instanceof CompatibilityURIConverter)
- uri = ((CompatibilityURIConverter) conv).deNormalize(uri);
- ZipEntry entry = new ZipEntry(uri.toString());
- zipOutputStream.putNextEntry(entry);
- super.saveMofResource(aResource, out);
- zipOutputStream.closeEntry();
- }
-
- /**
- * @return java.util.zip.ZipOutputStream
- */
- protected java.util.zip.ZipOutputStream getZipOutputStream() {
- return zipOutputStream;
- }
-
- /**
- * @see com.ibm.etools.archive.SaveStrategy
- */
- public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException {
- try {
- ZipEntry entry = new ZipEntry(J2EEConstants.MANIFEST_URI);
- getZipOutputStream().putNextEntry(entry);
- aManifest.write(getZipOutputStream());
- getZipOutputStream().closeEntry();
- } catch (IOException iox) {
- throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox);
- }
- }
-
- @Override
- public void save(Archive anArchive) throws SaveFailureException {
- try {
- ZipEntry entry = new ZipEntry(anArchive.getURI());
- getZipOutputStream().putNextEntry(entry);
- super.save(anArchive);
- getZipOutputStream().closeEntry();
- } catch (IOException iox) {
- throw new SaveFailureException(anArchive.getURI(), iox);
- }
- }
-
- @Override
- public void save(File aFile, InputStream in) throws SaveFailureException {
- try {
- String entryName = aFile.getURI();
- if (aFile.isDirectoryEntry() && !entryName.endsWith("/"))//$NON-NLS-1$
- entryName = entryName + '/';
- ZipEntry entry = new ZipEntry(entryName);
- if (aFile.getLastModified() > 0)
- entry.setTime(aFile.getLastModified());
- getZipOutputStream().putNextEntry(entry);
- if (!aFile.isDirectoryEntry()) {
- org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.copy(in, getZipOutputStream());
- }
- getZipOutputStream().closeEntry();
- } catch (IOException iox) {
- throw new SaveFailureException(aFile.getURI(), iox);
- }
- }
-
- /**
- * @param newDestinationStream
- * java.io.OutputStream
- */
- public void setDestinationStream(java.io.OutputStream newDestinationStream) {
- destinationStream = newDestinationStream;
- }
-
- /**
- * @param newZipOutputStream
- * java.util.zip.ZipOutputStream
- */
- protected void setZipOutputStream(java.util.zip.ZipOutputStream newZipOutputStream) {
- zipOutputStream = newZipOutputStream;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveFileDynamicClassLoader.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveFileDynamicClassLoader.java
deleted file mode 100644
index 937ee3882..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveFileDynamicClassLoader.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-import java.security.ProtectionDomain;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-
-
-/**
- * Class loader which loads a given set of classes stored in byte arrays. (Assumption: System
- * classes and those in the set are the only classes needed to resolve each one)
- */
-
-public class ArchiveFileDynamicClassLoader extends ClassLoader {
- protected Archive archive = null;
- protected ClassLoader extraClassLoader;
- protected boolean inEARFile;
- private static final String URL_PROTOCOL = "archive"; //$NON-NLS-1$
- private ArchiveURLStreamHandler handler;
-
- protected ProtectionDomain protectionDomain;
-
- /**
- * <p>This constructor accepts a protection domain, which is used
- * by <code>findClass</code>.</p>
- *
- * @see ArchiveFileDynamicClassLoader#findClass(String)
- */
-
- public ArchiveFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl, ProtectionDomain pDomain) {
- super(parentCl);
- setArchive(anArchive);
- setExtraClassLoader(extraCl);
- inEARFile = anArchive.getContainer() != null && anArchive.getContainer().isEARFile();
- handler = new ArchiveURLStreamHandler();
- protectionDomain = pDomain;
- }
-
- public ArchiveFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) {
- this(anArchive, parentCl, extraCl, null);
- }
-
- /**
- * <p>Loads a specified class. Called only after the parent class loader has had
- * its chance to load the class, as per the Java2 delegation model.</p>
- *
- * <p>When non-null, the receiver's protection
- * domain is passed in to the call to <code>defineClass</code>.</p>
- *
- * @see ClassLoader#defineClass(String, byte[], int)
- * @see ClassLoader#defineClass(String, byte[], int, ProtectionDomain)
- */
- @Override
- protected Class findClass(String name) throws ClassNotFoundException {
-
- Class result;
- // Load class bytes from current set of class byte[]'s
- byte[] bytes = getClassBytesFor(name);
-
- if (bytes != null) {
- if ( protectionDomain == null ) {
- result = defineClass(name, bytes, 0, bytes.length);
- } else {
- result = defineClass(name, bytes, 0, bytes.length, protectionDomain);
- }
- if (result == null) {
- throw new ClassNotFoundException(name);
- } // endif
- } else {
- throw new ClassNotFoundException(name);
- } // endif
- return result;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/17/00 9:59:57 PM)
- *
- * @return com.ibm.etools.commonarchive.Archive
- */
- public Archive getArchive() {
- return archive;
- }
-
- private byte[] getData(File file) {
- if (null != file) {
- try {
- return ArchiveUtil.inputStreamToBytes(file.getInputStream());
- } catch (FileNotFoundException e) {
- return null;
- } catch (IOException e) {
- throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.io_ex_loading_EXC_, (new Object[]{file.getName()})), e); // = "An IO exception occurred loading " }
- }
- }
- return null;
- }
-
- protected byte[] getClassBytesFor(String className) {
- if (className == null)
- return null;
- // Change the class name to a jar entry name
- String jarEntryName = ArchiveUtil.classNameToUri(className);
- return getData(getFile(jarEntryName));
- }
-
- protected EARFile getEARFile() {
- return (EARFile) getArchive().getContainer();
- }
-
- /**
- * Insert the method's description here. Creation date: (11/21/00 6:58:05 PM)
- *
- * @return java.lang.ClassLoader
- */
- public java.lang.ClassLoader getExtraClassLoader() {
- return extraClassLoader;
- }
-
- /**
- * Used for dynamic class loading in dependent jars in ears; the set is used to terminate a
- * cycle if one exists; the cycle is invalid, but you never know what people might try...
- */
- protected synchronized Class loadClass(String name, Set visitedArchives) throws ClassNotFoundException {
- if (visitedArchives.contains(getArchive()))
- throw new ClassNotFoundException(name);
- visitedArchives.add(getArchive());
- try {
- return super.loadClass(name, false);
- } catch (ClassNotFoundException ex) {
- return loadClassInDependentJarInEAR(name, visitedArchives);
- }
- }
-
- @Override
- protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
- try {
- return super.loadClass(name, resolve);
- } catch (ClassNotFoundException ex) {
- Class c = loadClassInDependentJar(name);
- if (c != null && resolve)
- resolveClass(c);
- return c;
- }
- }
-
- protected Class loadClassInDependentJar(String name) throws ClassNotFoundException {
-
- if (inEARFile) {
- return loadClassInDependentJarInEAR(name);
- } else if (getExtraClassLoader() != null) {
- return getExtraClassLoader().loadClass(name);
- }
- throw new ClassNotFoundException(name);
- }
-
- protected Class loadClassInDependentJarInEAR(String name, Set visitedArchives) throws ClassNotFoundException {
- Object obj = getResourceInDependentJarInEAR(name, visitedArchives, CLASS_TYPE);
- if (obj == null) {
- throw new ClassNotFoundException(name);
- }
- return (Class) obj;
- }
-
- protected Class loadClassInDependentJarInEAR(String name) throws ClassNotFoundException {
- Object obj = getResourceInDependentJarInEAR(name, CLASS_TYPE);
- if (obj == null) {
- throw new ClassNotFoundException(name);
- }
- return (Class) obj;
- }
-
- protected File getFileFromDependentJar(String name) {
- Object obj = getResourceInDependentJarInEAR(name, FILE_TYPE);
- if (obj != null) {
- return (File) obj;
- }
- return null;
- }
-
- protected static final int CLASS_TYPE = 0;
- protected static final int FILE_TYPE = 1;
-
- protected Object getResourceInDependentJarInEAR(String name, int type) {
- Set visitedArchives = new HashSet(5);
- visitedArchives.add(getArchive());
- return getResourceInDependentJarInEAR(name, visitedArchives, type);
- }
-
- protected Object getResourceInDependentJarInEAR(String name, Set visitedArchives, int type) {
- String[] classpath = archive.getManifest().getClassPathTokenized();
- for (int i = 0; i < classpath.length; i++) {
- try {
- String uri = ArchiveUtil.deriveEARRelativeURI(classpath[i], archive);
- if (uri == null)
- continue;
- File jarFile = getEARFile().getFile(uri);
- if (jarFile.isArchive()) {
- Archive dep = (Archive) jarFile;
- switch (type) {
- case CLASS_TYPE :
- try {
- return ((ArchiveFileDynamicClassLoader) dep.getArchiveClassLoader()).loadClass(name, visitedArchives);
- } catch (ClassNotFoundException noDice) {
- continue;
- }
- case FILE_TYPE :
- try {
- return dep.getFile(name);
- } catch (FileNotFoundException noDice) {
- continue;
- }
- }
- }
- } catch (java.io.FileNotFoundException depJarNotInEAR) {
- }
- }
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/17/00 9:59:57 PM)
- *
- * @param newArchive
- * com.ibm.etools.commonarchive.Archive
- */
- public void setArchive(Archive newArchive) {
- archive = newArchive;
- }
-
- /**
- * Insert the method's description here. Creation date: (11/21/00 6:58:05 PM)
- *
- * @param newExtraClassLoader
- * java.lang.ClassLoader
- */
- public void setExtraClassLoader(java.lang.ClassLoader newExtraClassLoader) {
- extraClassLoader = newExtraClassLoader;
- }
-
- @Override
- public InputStream getResourceAsStream(String name) {
- try {
- File file = getFile(name);
- if (null != file) {
- return file.getInputStream();
- }
- } catch (IOException e) {
- throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.io_ex_loading_EXC_, (new Object[]{name})), e); // = "An IO exception occurred loading "
- }
- return null;
- }
-
- protected File getFileFromArchive(String name) {
- try {
- return getArchive().getFile(name);
- } catch (FileNotFoundException e) {
- }
- return null;
- }
-
-
-
- protected File getFile(String name) {
- File file = getFileFromArchive(name);
- if (file == null) {
- file = getFileFromDependentJar(name);
- }
- return file;
- }
-
- @Override
- protected URL findResource(String name) {
- if (getFile(name) != null) {
- try {
- return new URL(null, URL_PROTOCOL + "://" + name, handler); //$NON-NLS-1$
- } catch (MalformedURLException e) {
- J2EECorePlugin.logError(e);
- throw new RuntimeException(e);
- }
- }
- return null;
- }
-
- private class ArchiveURLStreamHandler extends URLStreamHandler {
- public ArchiveURLStreamHandler() {
- }
-
- @Override
- protected URLConnection openConnection(URL url) throws IOException {
- return new ArchiveURLConnection(url);
- }
- }
-
- private class ArchiveURLConnection extends URLConnection {
- private String resourceName;
-
- protected ArchiveURLConnection(URL url) {
- super(url);
- resourceName = url.toString().substring(URL_PROTOCOL.length() + 3);
- }
-
- @Override
- public void connect() throws IOException {
- }
-
- @Override
- public InputStream getInputStream() throws IOException {
- return getResourceAsStream(resourceName);
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveUtil.java
deleted file mode 100644
index 9af3b687c..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveUtil.java
+++ /dev/null
@@ -1,904 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.URIMappingRegistryImpl;
-import org.eclipse.jem.java.JavaURL;
-import org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveURIConverterImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.internal.xml.GeneralXmlDocumentReader;
-import org.eclipse.jst.j2ee.internal.xml.XmlDocumentReader;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-/**
- * This is a utility class to hold helper methods common to multiple classes in the archive support
- * packages
- */
-public class ArchiveUtil {
- public static final String DOT_CLASS = ".class"; //$NON-NLS-1$
-
- public static final String DOT_JAVA = ".java"; //$NON-NLS-1$
-
- public static final String DOT_SQLJ = ".sqlj"; //$NON-NLS-1$
-
- public static final String DOT_JSP = ".jsp"; //$NON-NLS-1$
-
- protected static boolean isRuntime = false;
-
- /**
- * Flag to indicate whether the temp directory should be used for extracting nested jars for
- * read; defaults to true
- */
- protected static boolean shouldUseTempDirectoryForRead = true;
-
- /**
- * Settable name for the temp directory; must resolve to a valid file on the file system; if not
- * specified, defaults to the system temp directory
- */
- protected static String tempDirectoryName;
-
- protected static java.io.File tempDirectory;
-
- /**
- * Flag to indicate whether empty directories should be included during import; defaults to true.
- *
- * @see ZipFileLoadStrategyImpl#isIncludeEmptyDirectories()
- */
- public static boolean INCLUDE_EMPTY_DIRECTORIES = true;
-
-
- public static String classNameToJavaUri(String className) {
- return className.replace('.', '/').concat(DOT_JAVA);
- }
-
- public static String classNameToUri(String className) {
- return className.replace('.', '/').concat(DOT_CLASS);
- }
-
- /**
- * For a given uri of a .class file, derive the uri of the .java file; takes into consideration
- * inner classes by splitting on the first occurrence of '$'
- *
- * @return String a uri or null if the input is null or doesn't end with ".class"
- */
- public static String classUriToJavaUri(String classUri) {
- if (classUri == null || !classUri.endsWith(DOT_CLASS))
- return null;
-
- String truncated = truncateIgnoreCase(classUri, DOT_CLASS);
- StringTokenizer tok = new StringTokenizer(truncated, "$"); //$NON-NLS-1$
- return tok.nextToken().concat(DOT_JAVA);
- }
-
- /**
- * Concatenates the two strings with a separator, if necessary
- */
- public static String concatUri(String directoryname, String filename, char separator) {
- String uri = directoryname;
- if (!directoryname.endsWith(separator + "") && !filename.startsWith(separator + "")) //$NON-NLS-2$//$NON-NLS-1$
- uri = uri + separator;
- return uri + filename;
- }
-
- /**
- * Copy all the data from the input stream to the output stream up until the first end of file
- * character, and close the two streams
- */
- public static void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[1024];
- try {
- int n = in.read(buffer);
- while (n > 0) {
- out.write(buffer, 0, n);
- n = in.read(buffer);
- }
- } finally {
- if (!(in instanceof ZipInputStream))
- in.close();
- if (!(out instanceof ZipOutputStream))
- out.close();
- }
- }
-
- public static File createTempDirectory(String baseName, File parentDirectory) throws IOException {
-
- File tempFile = createTempFile(baseName, parentDirectory);
- tempFile.delete();
- tempFile.mkdir();
- return tempFile;
- }
-
- public static File createTempFile(String baseName) throws IOException {
- return createTempFile(baseName, getTempDirectory());
- }
-
- public static File createTempFile(String baseName, File directory) throws IOException {
- String fileName = getFileNameTail(baseName);
- if (fileName.length() < 3) {
- fileName = "WSTMP" + fileName; //$NON-NLS-1$
- }
- File tempFile = File.createTempFile(fileName, null, directory);
- return tempFile;
- }
-
- /**
- * deletes a file from the file system; for directories, recurse the subdirectories and delete
- * them as well
- *
- * @return true if successful; false if any file or sub file could not be deleted
- */
- public static boolean delete(File aFile) {
- if (aFile == null)
- return true;
- if (aFile.isDirectory()) {
- File[] files = aFile.listFiles();
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (!delete(files[i]))
- return false;
- }
- }
- }
- return aFile.delete();
- }
-
- /**
- * returns a list of all files, recursive, that can't be written
- */
- public static List getWriteProtectedFiles(File aFile, List aList) {
- if (aList == null)
- aList = new ArrayList();
- if (aFile.exists() && !aFile.canWrite())
- aList.add(aFile);
- if (aFile.isDirectory()) {
- File[] files = aFile.listFiles();
- for (int i = 0; i < files.length; i++) {
- getWriteProtectedFiles(files[i], aList);
- }
- }
- return aList;
- }
-
- /**
- * <p>Alternate method for resolving class path entries.</p>
- *
- * <p>Note: Not sure what this is for, as a classpath
- * entry such as "../targetJar.jar" seems invalid, as it
- * reaches outside of the EAR directory.</p>
- *
- * <p>While this method will remove "./" from a classpath entry,
- * it will not remove "../", which will be added back when
- * deresolving the entry. There is no meaningful name to assign
- * to an entity outside of the fileset of the container.</p>
- *
- * <p>This implementation uses eclipse URI function, as opposed to the
- * implementation in <code>deriveEARRelativeURI</code>.</p>
- *
- * @param classpathEntry The class-path entry which is to be resolved.
- * @param container The container against which to resolve the entry.
- *
- * @return The text of the resolved entry.
- */
-
- public static String deriveRelativeURI(String classpathEntry, Container container)
- {
- URI containerURI = URI.createFileURI( container.getURI() );
- // 'container.getURI()' returns a string.
-
- URI entryURI = URI.createFileURI(classpathEntry);
-
- URI resolvedURI = entryURI.resolve(containerURI);
- URI recoveredURI = resolvedURI.deresolve(containerURI);
-
- return recoveredURI.toFileString();
- }
-
- /**
- * Leverage the java.io.File apis to resolve things like "./xxx" and "../xxx" into uris of
- * entries in the ear file
- *
- * @param classpathEntry -
- * a classpath entry from the manifest of
- * @anArchive
- * @param anArchive -
- * the archive to which the dependent jar is relative
- *
- * @return a cananonicalized relative uri of an entry in an ear file representing the dependent
- * jar
- */
- public static String deriveEARRelativeURI(String classpathEntry, Archive anArchive) {
- return deriveEARRelativeURI(classpathEntry, anArchive.getURI());
- }
-
- /**
- * Leverage the java.io.File apis to resolve things like "./xxx" and "../xxx" into uris of
- * entries in the ear file
- *
- * @param classpathEntry -
- * a classpath entry from the manifest of an archive
- * @param String -
- * the uri of the archive to which the dependent jar is relative
- *
- * @return a cananonicalized relative uri of an entry in an ear file representing the dependent
- * jar
- */
- public static String deriveEARRelativeURI(String classpathEntry, String archiveUri) {
- try {
- String parent = getFileNameParent(archiveUri);
- if (parent == null || parent.equals("")) //$NON-NLS-1$
- parent = "."; //$NON-NLS-1$
- String workingDir = new java.io.File(".").getCanonicalPath(); //$NON-NLS-1$
-
- String resolvedPath = new java.io.File(parent, classpathEntry).getCanonicalPath();
- if (!resolvedPath.startsWith(workingDir))
- return null;
- if (resolvedPath.equals(workingDir))
- return null;
- int start = workingDir.endsWith(java.io.File.separator) ? workingDir.length() : workingDir.length() + 1;
- return resolvedPath.substring(start, resolvedPath.length()).replace(java.io.File.separatorChar, '/');
- } catch (java.io.IOException ex) {
- //getCanonicalPath could throw this
- return null;
- }
- }
-
- /**
- * Return "" if there is no extension
- */
- public static String getFileNameExtension(String uri) {
-
- if (uri != null) {
- int index = uri.lastIndexOf("."); //$NON-NLS-1$
- if (index != -1)
- return uri.substring(index + 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the directory from the uri, or the truncation of the segment after the last
- * occurrence of a separator
- */
- public static String getFileNameParent(String uri) {
- if (uri==null)
- return ""; //$NON-NLS-1$
- String tempURI = uri.replace('\\', '/');
- while (tempURI.endsWith("/")) //$NON-NLS-1$
- tempURI = tempURI.substring(0, tempURI.length() - 1);
- int lastIndex = tempURI.lastIndexOf('/');
- if (lastIndex == -1)
- return ""; //$NON-NLS-1$
- else if (lastIndex == 0)
- return "/"; //$NON-NLS-1$
- return uri.substring(0, lastIndex);
- }
-
- /**
- * Returns the filename from the uri, or the segment after the last occurrence of a separator
- */
- public static String getFileNameTail(String uri) {
- String tempURI = uri.replace('\\', '/');
- while (tempURI.endsWith("/")) //$NON-NLS-1$
- tempURI = tempURI.substring(0, tempURI.length() - 1);
- int lastIndex = tempURI.lastIndexOf('/');
- if (lastIndex == -1)
- return uri;
- return uri.substring(lastIndex + 1, tempURI.length());
- }
-
- /**
- * For the given object in the deployment descriptor, return the owning module file; for
- * example, retrieve the EJBJarFile that owns the EJBJar. This works even for alts
- */
- public static ModuleFile getModuleFile(EObject ddObject) {
- Resource res = ddObject.eResource();
- if (res == null)
- return null;
-
- Archive archive = getArchive(res);
- if (archive == null || !archive.isModuleFile())
- return null;
-
- if (!(res instanceof XMLResource))
- return null;
-
- XMLResource xmlRes = (XMLResource) res;
- if (xmlRes.isAlt())
- return getModuleFileUsingAltDD((EARFile) archive, res);
-
- return (ModuleFile) archive;
- }
-
- protected static ModuleFile getModuleFileUsingAltDD(EARFile ear, Resource res) {
- if (res == null)
- return null;
-
- String uri = res.getURI().toString();
- Module m = ear.getDeploymentDescriptor().getModuleHavingAltDD(uri);
- if (m == null)
- return null;
- ModuleRef ref = ear.getModuleRef(m);
- if (ref == null)
- return null;
-
- return ref.getModuleFile();
- }
-
- public static String getModuleFileTypeName(int moduleType) {
- switch (moduleType) {
- case XMLResource.APPLICATION_TYPE :
- return CommonArchiveResourceHandler.A_Application_file;
- case XMLResource.APP_CLIENT_TYPE :
- return CommonArchiveResourceHandler.An_Application_Client_JAR_file;
- case XMLResource.EJB_TYPE :
- return CommonArchiveResourceHandler.An_EJB_JAR_file;
- case XMLResource.WEB_APP_TYPE :
- return CommonArchiveResourceHandler.A_WAR_file;
- case XMLResource.RAR_TYPE :
- return CommonArchiveResourceHandler.A_RAR_file;
- }
- return null;
- }
-
- /**
- * For the given resource, return the owning module file; for example, retrieve the EJBJarFile
- * that owns the EJBJar. In the case of alts, this returns the EARFile and not the module file.
- * This method is internal; clients should use {@link #getModuleFile(EObject)}
- */
- public static Archive getArchive(Resource res) {
- if (res == null)
- return null;
-
- ResourceSet set = res.getResourceSet();
- if (set == null)
- return null;
-
- URIConverter conv = set.getURIConverter();
- if (conv == null || !(conv instanceof ArchiveURIConverterImpl))
- return null;
-
- return ((ArchiveURIConverterImpl) conv).getArchive();
- }
-
- /**
- * Concatenates the two strings and ensures the correct separator is used in the path
- */
- public static String getOSUri(String uri) {
- char sep = File.separatorChar;
- if (sep != '/')
- return uri.replace('/', sep);
- return uri.replace('\\', sep);
- }
-
- /**
- * Concatenates the two strings and ensures the correct separator is used in the path
- */
- public static String getOSUri(String directoryname, String filename) {
- String osDirName = getOSUri(directoryname);
- String osFileName = getOSUri(filename);
- return concatUri(osDirName, osFileName, File.separatorChar);
- }
-
- /**
- * Returns the first element in the extent of the resource
- *
- * @throws EmptyResourceException -
- * thrown if the extent is empty
- */
- public static EObject getRoot(Resource aResource) throws EmptyResourceException {
- EList extent = aResource.getContents();
- if (extent.size() < 1) {
- throw new EmptyResourceException(aResource.getURI().toString());
- }
- return (EObject) extent.get(0);
- }
-
- public static java.io.File getTempDirectory() {
- return tempDirectory;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 1:16:48 PM)
- *
- * @return java.lang.String
- */
- public static java.lang.String getTempDirectoryName() {
- return tempDirectoryName;
- }
-
-
- public static String[] getTokens(String aString) {
- return ManifestUtilities.getTokens(aString, null);
- }
-
- public static String[] getTokens(String aString, String delimiter) {
- return ManifestUtilities.getTokens(aString, delimiter);
- }
-
- /**
- * getValueIgnoreKeyCase method comment.
- */
- public static java.lang.String getValueIgnoreKeyCase(java.lang.String key, java.util.jar.Attributes attr) {
- return ManifestUtilities.getValueIgnoreKeyCase(key, attr);
- }
-
- public static void inform(String message) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logInfo(message);
- }
-
- /**
- * Read all the data from the input stream up until the first end of file character, add this
- * data to a byte array, and close the input stream; returns the byte array
- */
- public static byte[] inputStreamToBytes(InputStream in) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- copy(in, out);
- return out.toByteArray();
- }
-
- public static boolean isJavaResource(Resource aResource) {
- return JavaURL.isJavaURL(aResource.getURI().toString());
- }
-
- public static boolean isRegisteredURIMapping(Resource res) {
- return URIMappingRegistryImpl.INSTANCE.getURI(res.getURI()) != res.getURI();
- }
-
- public static boolean isPlatformMetaResource(Resource res) {
- URI uri = res.getURI();
- return "platform".equals(uri.scheme()) && "meta".equals(uri.segment(0)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public static boolean isNullOrEmpty(String aString) {
- return aString == null || aString.trim().length() == 0;
- }
-
- public static boolean isRuntime() {
- return isRuntime;
- }
-
- /**
- * Is it within the spec for the JAR or module file to reference the archive via the Manifest
- * Class-Path?
- */
- public static boolean isValidDependency(Archive referencedJAR, Archive referencingJAR) {
- //No other modules should reference wars
- if (referencedJAR.isWARFile())
- return false;
-
- if (referencedJAR == referencingJAR)
- return false;
-
- //Clients can reference all but the WARs, which we've already covered
- // above; WARs and EJB JARs
- //can reference all but WARs, above, or ApplicationClients
- return referencingJAR.isApplicationClientFile() || !referencedJAR.isApplicationClientFile();
- }
-
- /**
- * Loads a properties file with the given uri from the given archive
- *
- * @throws FileNotFoundException
- * if the file does not exist in the archive
- * @throws IOException
- * if an IO exception occurs reading the properties
- */
- public static Properties loadProperties(Archive archive, String uri) throws FileNotFoundException, IOException {
- InputStream in = null;
- try {
- in = archive.getInputStream(uri);
- Properties p = new Properties();
- p.load(in);
- return p;
- } finally {
- if (in != null)
- in.close();
- }
- }
-
- public static void setIsRuntime(boolean aBoolean) {
- isRuntime = aBoolean;
- }
-
- /**
- *
- */
- public static void setShouldUseTempDirectoryForRead(boolean value) {
- shouldUseTempDirectoryForRead = value;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 1:26:28 PM)
- *
- * @param newTempDirectory
- * java.io.File
- */
- public static void setTempDirectory(java.io.File newTempDirectory) {
- tempDirectory = newTempDirectory;
- tempDirectoryName = newTempDirectory.getAbsolutePath();
- }
-
- /**
- * Sets the temp directory to the specified path; creates it and sets it to be deleted on exit
- * if it does not exist.
- *
- * @param newTempDirectoryName
- * java.lang.String
- * @throws ArchiveException
- * thrown if the directory does not exist and can not be created
- */
- public static void setTempDirectoryName(java.lang.String newTempDirectoryName) throws ArchiveException {
- java.io.File dir = new java.io.File(newTempDirectoryName);
- if (!dir.exists()) {
- dir.mkdirs();
- if (!dir.exists())
- throw new ArchiveException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.make_temp_dir_EXC_, (new Object[]{newTempDirectoryName}))); // = "Unable to make temp directory: "
- DeleteOnExitUtility.markForDeletion(dir);
- }
- setTempDirectory(dir);
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 1:08:20 PM)
- *
- * @return boolean
- */
- public static boolean shouldUseTempDirectoryForRead() {
- return shouldUseTempDirectoryForRead;
- }
-
- /**
- * Convert the list of string elements to an array of file URLs; if an entry is relative, make
- * it relative to the uri root
- */
- public static java.net.URL[] toLocalURLs(List entries, String uriRoot) {
- List urls = new ArrayList();
- for (int i = 0; i < entries.size(); i++) {
- String pathEntry = (String) entries.get(i);
- java.io.File aFile = new java.io.File(pathEntry);
- if (!aFile.isAbsolute()) {
- pathEntry = getOSUri(uriRoot, pathEntry);
- aFile = new java.io.File(pathEntry);
- }
- if (!aFile.exists()) {
- //inform("Classpath element " + pathEntry + " does not
- // exist");
- continue;
- }
- if (aFile.isDirectory()) {
- if (!pathEntry.endsWith(java.io.File.separator)) {
- pathEntry = pathEntry + java.io.File.separatorChar;
- }
- } else {
- ZipFile zip = null;
- try {
- zip = org.eclipse.jst.jee.archive.internal.ArchiveUtil.newZipFile(aFile);
- } catch (Exception ex) {
- inform(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.invalid_classpath_WARN_, (new Object[]{pathEntry}))); // = "Classpath element "{0}" is not a directory or a Zip file"
- continue;
- } finally {
- if (zip != null)
- try {
- zip.close();
- } catch (IOException ignore) {
- //Ignore
- }
- }
- }
- try {
- aFile = new java.io.File(pathEntry);
- java.net.URL aUrl = aFile.toURL();
- urls.add(aUrl);
- } catch (java.net.MalformedURLException ex) {
- inform(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.invalid_cp_file_WARN_, (new Object[]{pathEntry}))); // = "Classpath element "{0}" does not point to a local file"
- }
- }
- java.net.URL[] urlArray = new java.net.URL[urls.size()];
- return (java.net.URL[]) urls.toArray(urlArray);
- }
-
- /**
- * Return a substring of the first parameter, starting at the end of the prefix
- */
- public static String truncateFromFrontIgnoreCase(String aString, String leadingSubString) {
- if (!aString.toLowerCase().startsWith(leadingSubString.toLowerCase()))
- return aString;
- return aString.substring(leadingSubString.length(), aString.length());
- }
-
- /**
- * Return a substring of the first parameter, up to the last index of the second
- */
- public static String truncateIgnoreCase(String aString, String trailingSubString) {
- int index = aString.toLowerCase().lastIndexOf(trailingSubString.toLowerCase());
- if (index != -1)
- return aString.substring(0, index);
- return aString;
- }
-
- public static String uriToClassName(String uri) {
- return truncateIgnoreCase(uri.replace('/', '.'), DOT_CLASS);
- }
-
- public static boolean isJ2EE13FastCheck(ModuleFile moduleFile) {
- if (moduleFile == null)
- return false;
- else if (moduleFile.isRARFile())
- return true;
- InputStream in = null;
- String uri = moduleFile.getDeploymentDescriptorUri();
- try {
- in = moduleFile.getInputStream(uri);
-
- DocumentType docType = XmlDocumentReader.readDocumentType(in, uri);
- if (docType == null)
- return false;
- String[] ids = getJ2EE13PublicAndSystemIdFor(moduleFile);
- if (ids == null)
- return false;
- return ids[0].equals(docType.getPublicId()) && ids[1].equals(docType.getSystemId());
- } catch (IOException ex) {
- return false;
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException ex) {
- //Ignore
- }
- }
-
- }
-
- protected static String[] getJ2EE13PublicAndSystemIdFor(ModuleFile moduleFile) {
- if (moduleFile.isEARFile())
- return new String[]{J2EEConstants.APPLICATION_PUBLICID_1_3, J2EEConstants.APPLICATION_SYSTEMID_1_3};
- else if (moduleFile.isEJBJarFile())
- return new String[]{J2EEConstants.EJBJAR_PUBLICID_2_0, J2EEConstants.EJBJAR_SYSTEMID_2_0};
- else if (moduleFile.isApplicationClientFile())
- return new String[]{J2EEConstants.APP_CLIENT_PUBLICID_1_3, J2EEConstants.APP_CLIENT_SYSTEMID_1_3};
- else if (moduleFile.isWARFile())
- return new String[]{J2EEConstants.WEBAPP_PUBLICID_2_3, J2EEConstants.WEBAPP_SYSTEMID_2_3};
- else if (moduleFile.isRARFile())
- return new String[]{J2EEConstants.CONNECTOR_PUBLICID_1_0, J2EEConstants.CONNECTOR_SYSTEMID_1_0};
- else
- return null;
- }
-
- //TODO doing the parse with SAX would be faster
- public static int getFastSpecVersion(ModuleFile moduleFile) {
- InputStream in = null;
- String uri = moduleFile.getDeploymentDescriptorUri();
- try {
- in = moduleFile.getInputStream(uri);
-
- DocumentType docType = null;
-
- InputSource source = new InputSource(in);
- GeneralXmlDocumentReader aReader = new XmlDocumentReader(source);
- aReader.setValidate(false);
- Document aDocument = aReader.parseDocument();
- if (aDocument != null) {
- docType = aDocument.getDoctype();
- }
- int version = -1;
- if (null != docType) {
- String publicID = docType.getPublicId();
- String systemID = docType.getSystemId();
- if (publicID != null && systemID != null) {
- version = lookupVersion(moduleFile, publicID, systemID);
- }
- }
- if (version == -1) {
- String schemaName = null;
- String versionString = null;
- if (aDocument != null) {
- if (null == docType) {
- NamedNodeMap map = aDocument.getDocumentElement().getAttributes();
- if (null != map) {
- Node schemaNode = map.getNamedItem("xsi:schemaLocation"); //$NON-NLS-1$
- if (null != schemaNode) {
- schemaName = schemaNode.getNodeValue();
- }
- Node versionNode = map.getNamedItem("version");//$NON-NLS-1$
- if (null != versionNode) {
- versionString = versionNode.getNodeValue();
- }
- }
- }
- }
- if (null != schemaName) {
- version = lookupVersion(moduleFile, schemaName);
- }
- if (version == -1) {
- version = parseVersionString(moduleFile, versionString);
- }
- }
-
- return version;
- } catch (IOException ex) {
- return -1;
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException ex) {
- //Ignore
- }
- }
- }
-
- private static int parseVersionString(ModuleFile moduleFile, String versionAttr) {
- int version = -1;
- if (moduleFile.isEARFile()) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isEJBJarFile()) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.EJB_2_1_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) {
- version = J2EEVersionConstants.EJB_1_1_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_0_TEXT)) {
- version = J2EEVersionConstants.EJB_2_0_ID;
- } else {
- version = J2EEVersionConstants.EJB_2_1_ID;
- }
- } else if (moduleFile.isApplicationClientFile()) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isWARFile()) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.WEB_2_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) {
- version = J2EEVersionConstants.WEB_2_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) {
- version = J2EEVersionConstants.WEB_2_3_ID;
- } else {
- version = J2EEVersionConstants.WEB_2_4_ID;
- }
- } else if (moduleFile.isRARFile()) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.JCA_1_5_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_0_TEXT)) {
- version = J2EEVersionConstants.JCA_1_0_ID;
- } else {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
-
- }
-
- private static int lookupVersion(ModuleFile moduleFile, String schemaName) {
- int version = -1;
- if (moduleFile.isEARFile()) {
- if (schemaName.equals(J2EEConstants.APPLICATION_SCHEMA_1_4)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isEJBJarFile()) {
- if ((schemaName.indexOf(J2EEConstants.EJBJAR_SCHEMA_2_1_NS)) != -1) {
- version = J2EEVersionConstants.EJB_2_1_ID;
- }
- } else if (moduleFile.isApplicationClientFile()) {
- if (schemaName.equals(J2EEConstants.APP_CLIENT_SCHEMA_1_4)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isWARFile()) {
- if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_2_4)) {
- version = J2EEVersionConstants.WEB_2_4_ID;
- }
- } else if (moduleFile.isRARFile()) {
- if (schemaName.equals(J2EEConstants.CONNECTOR_SCHEMA_1_5)) {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
- }
-
- private static int lookupVersion(ModuleFile moduleFile, String publicID, String systemID) {
- int version = -1;
- if (moduleFile.isEARFile()) {
- if (publicID.equals(J2EEConstants.APPLICATION_PUBLICID_1_3) && (systemID.equals(J2EEConstants.APPLICATION_SYSTEMID_1_3)||systemID.equals(J2EEConstants.APPLICATION_ALT_SYSTEMID_1_3))) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (publicID.equals(J2EEConstants.APPLICATION_PUBLICID_1_2) && (systemID.equals(J2EEConstants.APPLICATION_SYSTEMID_1_2)||systemID.equals(J2EEConstants.APPLICATION_ALT_SYSTEMID_1_2))) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isEJBJarFile()) {
- if (publicID.equals(J2EEConstants.EJBJAR_PUBLICID_2_0) && (systemID.equals(J2EEConstants.EJBJAR_SYSTEMID_2_0)||systemID.equals(J2EEConstants.EJBJAR_ALT_SYSTEMID_2_0))) {
- version = J2EEVersionConstants.EJB_2_0_ID;
- } else if (publicID.equals(J2EEConstants.EJBJAR_PUBLICID_1_1) && (systemID.equals(J2EEConstants.EJBJAR_SYSTEMID_1_1)||systemID.equals(J2EEConstants.EJBJAR_ALT_SYSTEMID_1_1))) {
- version = J2EEVersionConstants.EJB_1_1_ID;
- } else {
- version = J2EEVersionConstants.EJB_2_1_ID;
- }
- } else if (moduleFile.isApplicationClientFile()) {
- if (publicID.equals(J2EEConstants.APP_CLIENT_PUBLICID_1_3) && (systemID.equals(J2EEConstants.APP_CLIENT_SYSTEMID_1_3)||systemID.equals(J2EEConstants.APP_CLIENT_ALT_SYSTEMID_1_3))) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (publicID.equals(J2EEConstants.APP_CLIENT_PUBLICID_1_2) && (systemID.equals(J2EEConstants.APP_CLIENT_SYSTEMID_1_2)||systemID.equals(J2EEConstants.APP_CLIENT_ALT_SYSTEMID_1_2))) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (moduleFile.isWARFile()) {
- if (publicID.equals(J2EEConstants.WEBAPP_PUBLICID_2_3) && (systemID.equals(J2EEConstants.WEBAPP_SYSTEMID_2_3)||systemID.equals(J2EEConstants.WEBAPP_ALT_SYSTEMID_2_3))) {
- version = J2EEVersionConstants.WEB_2_3_ID;
- } else if (publicID.equals(J2EEConstants.WEBAPP_PUBLICID_2_2) && (systemID.equals(J2EEConstants.WEBAPP_SYSTEMID_2_2)||systemID.equals(J2EEConstants.WEBAPP_ALT_SYSTEMID_2_2))) {
- version = J2EEVersionConstants.WEB_2_2_ID;
- } else {
- version = J2EEVersionConstants.WEB_2_4_ID;
- }
- } else if (moduleFile.isRARFile()) {
- if (publicID.equals(J2EEConstants.CONNECTOR_PUBLICID_1_0) && (systemID.equals(J2EEConstants.CONNECTOR_SYSTEMID_1_0)||systemID.equals(J2EEConstants.CONNECTOR_ALT_SYSTEMID_1_0))) {
- version = J2EEVersionConstants.JCA_1_0_ID;
- } else {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ClasspathUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ClasspathUtil.java
deleted file mode 100644
index da7dcfd25..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ClasspathUtil.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntry;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.RuntimeClasspathEntryImpl;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-public class ClasspathUtil {
-
- public static void processManifest(String inPath, List rtClasspath, Set processedPaths) {
- ArrayList paths = getManifestPaths(inPath);
- for (int i = 0; i < paths.size(); i++) {
- RuntimeClasspathEntry entry = (RuntimeClasspathEntry) paths.get(i);
- if (!processedPaths.contains(entry)) {
- processedPaths.add(entry);
- rtClasspath.add(entry);
- processManifest(entry.getAbsolutePath(), rtClasspath, processedPaths);
- }
- }
- }
-
- protected static RuntimeClasspathEntry createRuntimeClasspathEntry(String absolutePath, String manifestValue) {
- RuntimeClasspathEntry entry = new RuntimeClasspathEntryImpl();
- entry.setAbsolutePath(absolutePath);
- entry.setManifestValue(manifestValue);
- return entry;
- }
-
- protected static ArrayList getManifestPaths(String path) {
- ArrayList manifestPaths = new ArrayList();
- File f = new File(path);
- if (f.exists()) {
- if (f.isDirectory()) {
- File manifestFile = new File(path + File.separator + "META-INF" + File.separator + "MANIFEST.MF"); //$NON-NLS-1$ //$NON-NLS-2$
- if (manifestFile.exists()) {
- FileInputStream inputStream = null;
- try {
- inputStream = new FileInputStream(manifestFile);
- Manifest manifest = new Manifest(inputStream);
- manifestPaths = getManifestClassPaths(manifest, f.getParent());
- } catch (IOException e) {
- //Ignore
- } finally {
- if (null != inputStream) {
- try {
- inputStream.close();
- } catch (IOException ex) {
- Logger.getLogger().logError(ex);
- }
- }
- }
- }
- } else {
- JarFile jarFile = null;
- try {
- jarFile = new JarFile(f);
- Manifest manifest = jarFile.getManifest();
- if (manifest != null)
- manifestPaths = getManifestClassPaths(manifest, f.getParent());
- } catch (IOException e) {
- //Ignore
- } finally {
- if (jarFile != null)
- try {
- jarFile.close();
- } catch (IOException ex) {
- //Ignore
- }
- }
- }
- }
- return manifestPaths;
- }
-
- protected static ArrayList getManifestClassPaths(Manifest manifest, String archivePath) {
- ArrayList pathList = new ArrayList();
- Attributes main = manifest.getMainAttributes();
- String classPath = main.getValue(Attributes.Name.CLASS_PATH);
- if (classPath != null) {
- StringTokenizer st = new StringTokenizer(classPath, " "); //$NON-NLS-1$
- while (st.hasMoreTokens()) {
- String token = st.nextToken();
- String path = archivePath + File.separator + token;
- path = normalizePath(path);
- if (new File(path).exists()) {
- pathList.add(createRuntimeClasspathEntry(path, token));
- }
- }
- }
- return pathList;
- }
-
- public static String normalizePath(String path) {
- File f = new File(path);
- try {
- f = f.getCanonicalFile();
- } catch (Exception ex) {
- //Ignore
- }
- return f.getPath();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveAdapterFactory.java
deleted file mode 100644
index 166b88989..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveAdapterFactory.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ClientModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ConnectorModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WebModuleRef;
-
-
-public class CommonarchiveAdapterFactory extends AdapterFactoryImpl {
- protected static CommonarchivePackage modelPackage;
-
- public CommonarchiveAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = (CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI);
- }
- }
-
- @Override
- public boolean isFactoryForType(Object type) {
- if (type == modelPackage) {
- return true;
- }
- if (type instanceof EObject) {
- return ((EObject) type).eClass().eContainer() == modelPackage;
- }
- return false;
- }
-
- protected CommonarchiveSwitch sw = new CommonarchiveSwitch() {
- @Override
- public Object caseContainer(Container object) {
- return createContainerAdapter();
- }
-
- @Override
- public Object caseWARFile(WARFile object) {
- return createWARFileAdapter();
- }
-
- @Override
- public Object caseModuleFile(ModuleFile object) {
- return createModuleFileAdapter();
- }
-
- @Override
- public Object caseEARFile(EARFile object) {
- return createEARFileAdapter();
- }
-
- @Override
- public Object caseApplicationClientFile(ApplicationClientFile object) {
- return createApplicationClientFileAdapter();
- }
-
- @Override
- public Object caseEJBJarFile(EJBJarFile object) {
- return createEJBJarFileAdapter();
- }
-
- @Override
- public Object caseRARFile(RARFile object) {
- return createRARFileAdapter();
- }
-
- @Override
- public Object caseArchive(Archive object) {
- return createArchiveAdapter();
- }
-
- @Override
- public Object caseFile(File object) {
- return createFileAdapter();
- }
-
- @Override
- public Object caseReadOnlyDirectory(ReadOnlyDirectory object) {
- return createReadOnlyDirectoryAdapter();
- }
- };
-
- @Override
- public Adapter createAdapter(Notifier target) {
- return (Adapter) sw.doSwitch((EObject) target);
- }
-
- /**
- * By default create methods return null so that we can easily ignore cases. It's useful to
- * ignore a case when inheritance will catch all the cases anyway.
- */
-
- public Adapter createContainerAdapter() {
- return null;
- }
-
- public Adapter createEJBComponentAdapter() {
- return null;
- }
-
- public Adapter createModuleComponentAdapter() {
- return null;
- }
-
- public Adapter createServletComponentAdapter() {
- return null;
- }
-
- public Adapter createWARFileAdapter() {
- return null;
- }
-
- public Adapter createModuleFileAdapter() {
- return null;
- }
-
- public Adapter createEARFileAdapter() {
- return null;
- }
-
- public Adapter createApplicationClientFileAdapter() {
- return null;
- }
-
- public Adapter createEJBJarFileAdapter() {
- return null;
- }
-
- public Adapter createRARFileAdapter() {
- return null;
- }
-
- public Adapter createArchiveAdapter() {
- return null;
- }
-
- public Adapter createFileAdapter() {
- return null;
- }
-
- public Adapter createEJBClientJarFileAdapter() {
- return null;
- }
-
- public Adapter createReadOnlyDirectoryAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createModuleRefAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEJBModuleRefAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createWebModuleRefAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createClientModuleRefAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createConnectorModuleRefAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.common.J2EEEObject <em>J2EEE Object</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.j2ee.common.J2EEEObject
- * @generated
- */
- public Adapter createJ2EEEObjectAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc --> This default
- * implementation returns null. <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public boolean isFactoryForTypeGen(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected CommonarchiveSwitch modelSwitch =
- new CommonarchiveSwitch() {
- @Override
- public Object caseFile(File object) {
- return createFileAdapter();
- }
- @Override
- public Object caseArchive(Archive object) {
- return createArchiveAdapter();
- }
- @Override
- public Object caseEJBJarFile(EJBJarFile object) {
- return createEJBJarFileAdapter();
- }
- @Override
- public Object caseWARFile(WARFile object) {
- return createWARFileAdapter();
- }
- @Override
- public Object caseEARFile(EARFile object) {
- return createEARFileAdapter();
- }
- @Override
- public Object caseApplicationClientFile(ApplicationClientFile object) {
- return createApplicationClientFileAdapter();
- }
- @Override
- public Object caseModuleFile(ModuleFile object) {
- return createModuleFileAdapter();
- }
- @Override
- public Object caseContainer(Container object) {
- return createContainerAdapter();
- }
- @Override
- public Object caseReadOnlyDirectory(ReadOnlyDirectory object) {
- return createReadOnlyDirectoryAdapter();
- }
- @Override
- public Object caseRARFile(RARFile object) {
- return createRARFileAdapter();
- }
- @Override
- public Object caseModuleRef(ModuleRef object) {
- return createModuleRefAdapter();
- }
- @Override
- public Object caseEJBModuleRef(EJBModuleRef object) {
- return createEJBModuleRefAdapter();
- }
- @Override
- public Object caseWebModuleRef(WebModuleRef object) {
- return createWebModuleRefAdapter();
- }
- @Override
- public Object caseClientModuleRef(ClientModuleRef object) {
- return createClientModuleRefAdapter();
- }
- @Override
- public Object caseConnectorModuleRef(ConnectorModuleRef object) {
- return createConnectorModuleRefAdapter();
- }
- @Override
- public Object caseJ2EEEObject(J2EEEObject object) {
- return createJ2EEEObjectAdapter();
- }
- @Override
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createAdapterGen(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * By default create methods return null so that we can easily ignore cases. It's useful to
- * ignore a case when inheritance will catch all the cases anyway.
- */
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createContainerAdapterGen() {
-
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createWARFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createModuleFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createApplicationClientFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEARFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createEJBJarFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createRARFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createArchiveAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createFileAdapterGen() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createReadOnlyDirectoryAdapterGen() {
- return null;
- }
-
-} //CommonarchiveAdapterFactory
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveSwitch.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveSwitch.java
deleted file mode 100644
index 7689c0dae..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveSwitch.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ClientModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ConnectorModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBJarFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ReadOnlyDirectory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WebModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl;
-
-
-public class CommonarchiveSwitch {
- /**
- * The cached model package
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- protected static CommonarchivePackage modelPackage;
-
- protected static CommonarchiveFactory factory;
-
- public CommonarchiveSwitch() {
- factory = (CommonarchiveFactory) CommonarchiveFactoryImpl.getPackage().getEFactoryInstance();
- modelPackage = CommonarchiveFactoryImpl.getPackage();
- }
-
- public Object doSwitch(EObject theEObject) {
- EClass theEClass = theEObject.eClass();
- if (theEClass.eContainer() != modelPackage)
- return defaultCase(theEObject);
-
- switch (theEClass.getClassifierID()) {
- case CommonarchivePackage.WAR_FILE : {
- WARFile castedObject = (WARFile) theEObject;
- Object result = caseWARFile(castedObject);
- if (result == null)
- result = caseModuleFile(castedObject);
- if (result == null)
- result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.EAR_FILE : {
- EARFile castedObject = (EARFile) theEObject;
- Object result = caseEARFile(castedObject);
- if (result == null)
- result = caseModuleFile(castedObject);
- if (result == null)
- result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.APPLICATION_CLIENT_FILE : {
- ApplicationClientFile castedObject = (ApplicationClientFile) theEObject;
- Object result = caseApplicationClientFile(castedObject);
- if (result == null)
- result = caseModuleFile(castedObject);
- if (result == null)
- result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.EJB_JAR_FILE : {
- EJBJarFile castedObject = (EJBJarFile) theEObject;
- Object result = caseEJBJarFile(castedObject);
- if (result == null)
- result = caseModuleFile(castedObject);
- if (result == null)
- result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.RAR_FILE : {
- RARFile castedObject = (RARFile) theEObject;
- Object result = caseRARFile(castedObject);
- if (result == null)
- result = caseModuleFile(castedObject);
- if (result == null)
- result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.ARCHIVE : {
- Archive castedObject = (Archive) theEObject;
- Object result = caseArchive(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.FILE : {
- File castedObject = (File) theEObject;
- Object result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.READ_ONLY_DIRECTORY : {
- ReadOnlyDirectory castedObject = (ReadOnlyDirectory) theEObject;
- Object result = caseReadOnlyDirectory(castedObject);
- if (result == null)
- result = caseContainer(castedObject);
- if (result == null)
- result = caseFile(castedObject);
- if (result == null)
- result = defaultCase(theEObject);
- return result;
- }
- default :
- return defaultCase(theEObject);
- }
- } // doSwitch
-
- public Object caseContainer(Container object) {
- return null;
- }
-
- public Object caseWARFile(WARFile object) {
- return null;
- }
-
- public Object caseModuleFile(ModuleFile object) {
- return null;
- }
-
- public Object caseEARFile(EARFile object) {
- return null;
- }
-
- public Object caseApplicationClientFile(ApplicationClientFile object) {
- return null;
- }
-
- public Object caseEJBJarFile(EJBJarFile object) {
- return null;
- }
-
- public Object caseRARFile(RARFile object) {
- return null;
- }
-
- public Object caseArchive(Archive object) {
- return null;
- }
-
- public Object caseFile(File object) {
- return null;
- }
-
- public Object caseReadOnlyDirectory(ReadOnlyDirectory object) {
- return null;
- }
-
- public Object defaultCase(EObject object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseModuleRef(ModuleRef object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEJBModuleRef(EJBModuleRef object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseWebModuleRef(WebModuleRef object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseClientModuleRef(ClientModuleRef object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseConnectorModuleRef(ConnectorModuleRef object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>J2EEE Object</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>J2EEE Object</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseJ2EEEObject(J2EEEObject object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object doSwitchGen(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case CommonarchivePackage.FILE: {
- File file = (File)theEObject;
- Object result = caseFile(file);
- if (result == null) result = caseJ2EEEObject(file);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.ARCHIVE: {
- Archive archive = (Archive)theEObject;
- Object result = caseArchive(archive);
- if (result == null) result = caseContainer(archive);
- if (result == null) result = caseFile(archive);
- if (result == null) result = caseJ2EEEObject(archive);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.EJB_JAR_FILE: {
- EJBJarFile ejbJarFile = (EJBJarFile)theEObject;
- Object result = caseEJBJarFile(ejbJarFile);
- if (result == null) result = caseModuleFile(ejbJarFile);
- if (result == null) result = caseArchive(ejbJarFile);
- if (result == null) result = caseContainer(ejbJarFile);
- if (result == null) result = caseFile(ejbJarFile);
- if (result == null) result = caseJ2EEEObject(ejbJarFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.WAR_FILE: {
- WARFile warFile = (WARFile)theEObject;
- Object result = caseWARFile(warFile);
- if (result == null) result = caseModuleFile(warFile);
- if (result == null) result = caseArchive(warFile);
- if (result == null) result = caseContainer(warFile);
- if (result == null) result = caseFile(warFile);
- if (result == null) result = caseJ2EEEObject(warFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.EAR_FILE: {
- EARFile earFile = (EARFile)theEObject;
- Object result = caseEARFile(earFile);
- if (result == null) result = caseModuleFile(earFile);
- if (result == null) result = caseArchive(earFile);
- if (result == null) result = caseContainer(earFile);
- if (result == null) result = caseFile(earFile);
- if (result == null) result = caseJ2EEEObject(earFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.APPLICATION_CLIENT_FILE: {
- ApplicationClientFile applicationClientFile = (ApplicationClientFile)theEObject;
- Object result = caseApplicationClientFile(applicationClientFile);
- if (result == null) result = caseModuleFile(applicationClientFile);
- if (result == null) result = caseArchive(applicationClientFile);
- if (result == null) result = caseContainer(applicationClientFile);
- if (result == null) result = caseFile(applicationClientFile);
- if (result == null) result = caseJ2EEEObject(applicationClientFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.MODULE_FILE: {
- ModuleFile moduleFile = (ModuleFile)theEObject;
- Object result = caseModuleFile(moduleFile);
- if (result == null) result = caseArchive(moduleFile);
- if (result == null) result = caseContainer(moduleFile);
- if (result == null) result = caseFile(moduleFile);
- if (result == null) result = caseJ2EEEObject(moduleFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.CONTAINER: {
- Container container = (Container)theEObject;
- Object result = caseContainer(container);
- if (result == null) result = caseFile(container);
- if (result == null) result = caseJ2EEEObject(container);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.READ_ONLY_DIRECTORY: {
- ReadOnlyDirectory readOnlyDirectory = (ReadOnlyDirectory)theEObject;
- Object result = caseReadOnlyDirectory(readOnlyDirectory);
- if (result == null) result = caseContainer(readOnlyDirectory);
- if (result == null) result = caseFile(readOnlyDirectory);
- if (result == null) result = caseJ2EEEObject(readOnlyDirectory);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.RAR_FILE: {
- RARFile rarFile = (RARFile)theEObject;
- Object result = caseRARFile(rarFile);
- if (result == null) result = caseModuleFile(rarFile);
- if (result == null) result = caseArchive(rarFile);
- if (result == null) result = caseContainer(rarFile);
- if (result == null) result = caseFile(rarFile);
- if (result == null) result = caseJ2EEEObject(rarFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.MODULE_REF: {
- ModuleRef moduleRef = (ModuleRef)theEObject;
- Object result = caseModuleRef(moduleRef);
- if (result == null) result = caseJ2EEEObject(moduleRef);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.EJB_MODULE_REF: {
- EJBModuleRef ejbModuleRef = (EJBModuleRef)theEObject;
- Object result = caseEJBModuleRef(ejbModuleRef);
- if (result == null) result = caseModuleRef(ejbModuleRef);
- if (result == null) result = caseJ2EEEObject(ejbModuleRef);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.WEB_MODULE_REF: {
- WebModuleRef webModuleRef = (WebModuleRef)theEObject;
- Object result = caseWebModuleRef(webModuleRef);
- if (result == null) result = caseModuleRef(webModuleRef);
- if (result == null) result = caseJ2EEEObject(webModuleRef);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.CLIENT_MODULE_REF: {
- ClientModuleRef clientModuleRef = (ClientModuleRef)theEObject;
- Object result = caseClientModuleRef(clientModuleRef);
- if (result == null) result = caseModuleRef(clientModuleRef);
- if (result == null) result = caseJ2EEEObject(clientModuleRef);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case CommonarchivePackage.CONNECTOR_MODULE_REF: {
- ConnectorModuleRef connectorModuleRef = (ConnectorModuleRef)theEObject;
- Object result = caseConnectorModuleRef(connectorModuleRef);
- if (result == null) result = caseModuleRef(connectorModuleRef);
- if (result == null) result = caseJ2EEEObject(connectorModuleRef);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseContainerGen(Container object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseWARFileGen(WARFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseModuleFileGen(ModuleFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseApplicationClientFileGen(ApplicationClientFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEARFileGen(EARFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseEJBJarFileGen(EJBJarFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseRARFileGen(RARFile object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseArchiveGen(Archive object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseFileGen(File object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseReadOnlyDirectoryGen(ReadOnlyDirectory object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object defaultCaseGen(EObject object) {
- return null;
- }
-
-} //CommonarchiveSwitch
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/DeleteOnExitUtility.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/DeleteOnExitUtility.java
deleted file mode 100644
index 92c0dca8a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/DeleteOnExitUtility.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-import java.io.File;
-
-
-/**
- * @author jsholl
- */
-public class DeleteOnExitUtility {
-
- public static void markForDeletion(File file) {
- org.eclipse.jst.jee.archive.internal.DeleteOnExitUtility.markForDeletion(file);
- }
-
- public static void fileHasBeenDeleted(File file) {
- org.eclipse.jst.jee.archive.internal.DeleteOnExitUtility.fileHasBeenDeleted(file);
- }
-
- public static void runCleanup() {
- org.eclipse.jst.jee.archive.internal.DeleteOnExitUtility.runCleanup();
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/EARFileUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/EARFileUtil.java
deleted file mode 100644
index c22e9599b..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/EARFileUtil.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-
-
-public class EARFileUtil {
-
- /**
- * Constructor for EARFileUtil.
- */
- private EARFileUtil() {
- super();
- }
-
- /**
- * Returns a list of all module files which are a spec level too high for the EAR file. If the
- * EAR is 1.3, returns an empty list. Otherwise returns any J2EE 1.3 modules.
- */
- public static List getIncompatible13ModuleFiles(EARFile earFile) {
- if (isJ2EE13(earFile))
- return Collections.EMPTY_LIST;
-
- List moduleFiles = earFile.getModuleFiles();
- List result = new ArrayList();
- for (int i = 0; i < moduleFiles.size(); i++) {
- ModuleFile aModuleFile = (ModuleFile) moduleFiles.get(i);
- if (isJ2EE13(aModuleFile))
- result.add(aModuleFile);
- }
- return result;
- }
-
- /**
- * Returns a list of all module files which are a spec level too high for the EAR file. If the
- * EAR is 1.4, returns an empty list. Otherwise returns any J2EE 1.4 modules.
- */
- public static List getIncompatible14ModuleFiles(EARFile earFile) {
- if (isJ2EE14(earFile))
- return Collections.EMPTY_LIST;
-
- List moduleFiles = earFile.getModuleFiles();
- List result = new ArrayList();
- for (int i = 0; i < moduleFiles.size(); i++) {
- ModuleFile aModuleFile = (ModuleFile) moduleFiles.get(i);
- if (isJ2EE14(aModuleFile))
- result.add(aModuleFile);
- }
- return result;
- }
-
- public static boolean isJ2EE13(ModuleFile aModuleFile) {
- try {
- XMLResource xmlResource = (XMLResource) aModuleFile.getDeploymentDescriptorResource();
- return xmlResource.getJ2EEVersionID() == J2EEVersionConstants.J2EE_1_3_ID;
- } catch (FileNotFoundException ex) {
- return false;
- }
- }
-
- public static boolean isJ2EE14(ModuleFile aModuleFile) {
- try {
- XMLResource xmlResource = (XMLResource) aModuleFile.getDeploymentDescriptorResource();
- return xmlResource.getJ2EEVersionID() == J2EEVersionConstants.J2EE_1_4_ID;
- } catch (FileNotFoundException ex) {
- return false;
- }
- }
-
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/FileDups.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/FileDups.java
deleted file mode 100644
index 688badf49..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/FileDups.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-
-import com.ibm.icu.util.StringTokenizer;
-
-/**
- * Insert the type's description here. Creation date: (4/11/2001 10:28:44 AM)
- *
- * @author: Administrator
- */
-public class FileDups {
- private static int sFiles = 0;
- private static int sDups = 0;
- private static int sJARs = 0;
- private static String[] excludedEntryNames = new String[]{"com/ibm/ivj/ejb/runtime/_CopyHelper_Stub.class", //$NON-NLS-1$
- "org/omg/stub/javax/ejb/_HomeHandle_Stub.class", //$NON-NLS-1$
- "org/omg/stub/javax/ejb/_Handle_Stub.class", //$NON-NLS-1$
- "org/omg/stub/javax/ejb/_EJBObject_Stub.class", //$NON-NLS-1$
- "org/omg/stub/javax/ejb/_EJBHome_Stub.class", //$NON-NLS-1$
- "org/omg/stub/java/lang/_Cloneable_Stub.class", //$NON-NLS-1$
- "com/ibm/websphere/csi/_TransactionalObject_Stub.class", //$NON-NLS-1$
- "com/ibm/websphere/csi/_CSIServant_Stub.class", //$NON-NLS-1$
- "com/ibm/ejs/container/_EJSWrapper_Tie.class", //$NON-NLS-1$
- "com/ibm/ejs/container/_EJSWrapper_Stub.class" //$NON-NLS-1$
- };
- private static HashSet excluded = new HashSet(Arrays.asList(excludedEntryNames));
-
- private static void addEntry(String entry, Map map, String jarName) {
- sFiles++;
-
- Object current = map.get(entry);
- if (current == null) {
- // This is the first time the entry is found
- map.put(entry, jarName);
- } else if (current instanceof String) {
- // There is one other entry
- map.remove(entry);
-
- String other = (String) current;
- LinkedList list = new LinkedList();
- list.addFirst(other);
- list.addFirst(jarName);
- map.put(entry, list);
-
- sDups++;
- } else {
- // There are more than one other instances
- LinkedList list = (LinkedList) current;
- list.addFirst(jarName);
-
- sDups++;
- }
- }
-
- /**
- * Starts the application.
- *
- * @param args
- * an array of command-line arguments
- */
- public static void main(java.lang.String[] args) {
- if (args.length != 1) {
- StringBuffer sb = new StringBuffer();
- sb.append("FileDups utility\r\n\r\n"); //$NON-NLS-1$
- sb.append("Synopsis:\r\n"); //$NON-NLS-1$
- sb.append("Analyzes JAR and ZIP files in a directory for duplicate entries with the same name. This excludes all entries in the \"META-INF\" directory of the archive. This does not check timestamps or size.\r\n\r\n"); //$NON-NLS-1$
- sb.append("Usage: FileDups dirName\r\n"); //$NON-NLS-1$
- System.out.println(sb.toString());
- return;
- }
-
- TreeMap map = new TreeMap();
-
- try {
- for (int i = 0; i < args.length; i++) {
- File root = new File(args[i]);
- processDirectory(root, map);
- }
-
- TreeMap outputMap = new TreeMap();
-
- Set set = map.entrySet();
- Iterator it = set.iterator();
- while (it.hasNext()) {
- Map.Entry me = (Map.Entry) it.next();
- Object o = me.getValue();
- if (o instanceof LinkedList) {
- StringBuffer jars = new StringBuffer();
-
- LinkedList list = (LinkedList) o;
- Iterator entryIter = list.iterator();
- while (entryIter.hasNext()) {
- jars.append(entryIter.next());
- jars.append("\r\n"); //$NON-NLS-1$
- }
-
- LinkedList outputList = (LinkedList) outputMap.get(jars.toString());
- if (outputList == null) {
- outputList = new LinkedList();
- outputMap.put(jars.toString(), outputList);
- }
- outputList.addFirst(me.getKey());
- }
- }
-
- Set outSet = outputMap.entrySet();
- it = outSet.iterator();
- while (it.hasNext()) {
- Map.Entry me = (Map.Entry) it.next();
- String jars = (String) me.getKey();
- StringTokenizer tokens = new StringTokenizer(jars, "\r\n"); //$NON-NLS-1$
-
- while (tokens.hasMoreTokens()) {
- System.out.println(tokens.nextToken());
- }
-
- LinkedList list = (LinkedList) me.getValue();
- Iterator entryIter = list.iterator();
- while (entryIter.hasNext()) {
- System.out.println(" " + (String) entryIter.next()); //$NON-NLS-1$
- }
- }
-
- System.out.println("\r\nSearched " + sJARs + " jars, found " + sDups + " dups in " + sFiles + " files."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- } catch (Exception x) {
- J2EECorePlugin.logError(x);
- }
- }
-
- private static void processDirectory(File root, Map map) throws java.io.IOException {
- File[] files = root.listFiles();
- for (int i = 0; i < files.length; i++) {
- File f = files[i];
- if (f.isDirectory())
- processDirectory(f, map);
- else {
- String name = f.getName().toLowerCase();
- if (name.endsWith(".zip") || name.endsWith(".jar")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- processFile(f, map);
- }
- }
- }
- }
-
- private static void processFile(File file, Map map) throws java.io.IOException {
- HashSet filesInFile = new HashSet();
-
- sJARs++;
- ZipFile zip = null;
- try {
- zip = org.eclipse.jst.jee.archive.internal.ArchiveUtil.newZipFile(file);
- Enumeration eNum = zip.entries();
- while (eNum.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) eNum.nextElement();
- String name = entry.getName();
- if (!name.startsWith("META-INF") && !excluded.contains(name)) //$NON-NLS-1$
- filesInFile.add(name);
- }
- } catch (Exception x) {
- System.out.println("*Error searching in " + file.getAbsolutePath()); //$NON-NLS-1$
- } finally {
- try {
- if (zip != null)
- zip.close();
- } catch (java.io.IOException ignored) {
- //Ignore
- }
- }
-
- // Now add the packages to the map
- String filename = file.getPath();
-
- Iterator it = filesInFile.iterator();
- while (it.hasNext()) {
- String entryName = (String) it.next();
- addEntry(entryName, map, filename);
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java
deleted file mode 100644
index 95e983f70..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/J2EEFileUtil.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.EmptyResourceException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ZipFileLoadStrategyImpl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.internal.xml.GeneralXmlDocumentReader;
-import org.eclipse.jst.j2ee.internal.xml.XmlDocumentReader;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-import com.ibm.icu.util.StringTokenizer;
-
-
-/**
- * This is a utility class to hold helper methods common to multiple classes in the archive support
- * packages
- */
-public class J2EEFileUtil {
- public static final String DOT_CLASS = ".class"; //$NON-NLS-1$
-
- public static final String DOT_JAVA = ".java"; //$NON-NLS-1$
-
- public static final String DOT_SQLJ = ".sqlj"; //$NON-NLS-1$
-
- public static final String DOT_JSP = ".jsp"; //$NON-NLS-1$
-
- protected static boolean isRuntime = false;
-
- /**
- * Flag to indicate whether the temp directory should be used for extracting nested jars for
- * read; defaults to true
- */
- protected static boolean shouldUseTempDirectoryForRead = true;
-
- /**
- * Settable name for the temp directory; must resolve to a valid file on the file system; if not
- * specified, defaults to the system temp directory
- */
- protected static String tempDirectoryName;
-
- protected static java.io.File tempDirectory;
-
- /**
- * Flag to indicate whether empty directories should be included during import; defaults to true.
- *
- * @see ZipFileLoadStrategyImpl#isIncludeEmptyDirectories()
- */
- public static boolean INCLUDE_EMPTY_DIRECTORIES = true;
-
-
- protected static ModuleFile getModuleFileUsingAltDD(EARFile ear, Resource res) {
- if (res == null)
- return null;
-
- String uri = res.getURI().toString();
- Module m = ear.getDeploymentDescriptor().getModuleHavingAltDD(uri);
- if (m == null)
- return null;
- ModuleRef ref = ear.getModuleRef(m);
- if (ref == null)
- return null;
-
- return ref.getModuleFile();
- }
-
- public static String getModuleFileTypeName(int moduleType) {
- switch (moduleType) {
- case XMLResource.APPLICATION_TYPE :
- return CommonArchiveResourceHandler.A_Application_file;
- case XMLResource.APP_CLIENT_TYPE :
- return CommonArchiveResourceHandler.An_Application_Client_JAR_file;
- case XMLResource.EJB_TYPE :
- return CommonArchiveResourceHandler.An_EJB_JAR_file;
- case XMLResource.WEB_APP_TYPE :
- return CommonArchiveResourceHandler.A_WAR_file;
- case XMLResource.RAR_TYPE :
- return CommonArchiveResourceHandler.A_RAR_file;
- }
- return null;
- }
-
- /**
- * Concatenates the two strings and ensures the correct separator is used in the path
- */
- public static String getOSUri(String uri) {
- char sep = File.separatorChar;
- if (sep != '/')
- return uri.replace('/', sep);
- return uri.replace('\\', sep);
- }
-
-
- /**
- * Returns the first element in the extent of the resource
- *
- * @throws EmptyResourceException -
- * thrown if the extent is empty
- */
- public static EObject getRoot(Resource aResource) throws EmptyResourceException {
- EList extent = aResource.getContents();
- if (extent.size() < 1) {
- throw new EmptyResourceException(aResource.getURI().toString());
- }
- return (EObject) extent.get(0);
- }
-
- public static java.io.File getTempDirectory() {
- return tempDirectory;
- }
-
- /**
- * Insert the method's description here. Creation date: (12/19/00 1:16:48 PM)
- *
- * @return java.lang.String
- */
- public static java.lang.String getTempDirectoryName() {
- return tempDirectoryName;
- }
-
- public static String[] getTokens(String aString) {
- return getTokens(aString, null);
- }
-
- public static String[] getTokens(String aString, String delimiter) {
-
- StringTokenizer tok = (delimiter == null) ? new StringTokenizer(aString) : new StringTokenizer(aString, delimiter);
- int size = tok.countTokens();
- String[] tokens = new String[size];
- for (int i = 0; i < size && tok.hasMoreTokens(); i++) {
- tokens[i] = tok.nextToken();
- }
- return tokens;
- }
-
- /**
- * getValueIgnoreKeyCase method comment.
- */
- public static java.lang.String getValueIgnoreKeyCase(java.lang.String key, java.util.jar.Attributes attr) {
- Iterator keysAndValues = attr.entrySet().iterator();
- while (keysAndValues.hasNext()) {
- Map.Entry entry = (Map.Entry) keysAndValues.next();
- String entryKey = entry.getKey().toString();
- if (entryKey.equalsIgnoreCase(key))
- return entry.getValue() == null ? null : entry.getValue().toString();
- }
- return null;
- }
-
-
- public static boolean isJ2EE13FastCheck(ModuleFile moduleFile) {
- if (moduleFile == null)
- return false;
- else if (moduleFile.isRARFile())
- return true;
- InputStream in = null;
- String uri = moduleFile.getDeploymentDescriptorUri();
- try {
- in = moduleFile.getInputStream(uri);
-
- DocumentType docType = XmlDocumentReader.readDocumentType(in, uri);
- if (docType == null)
- return false;
- String[] ids = getJ2EE13PublicAndSystemIdFor(moduleFile);
- if (ids == null)
- return false;
- return ids[0].equals(docType.getPublicId()) && ids[1].equals(docType.getSystemId());
- } catch (IOException ex) {
- return false;
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException ex) {
- //Ignore
- }
- }
-
- }
-
- protected static String[] getJ2EE13PublicAndSystemIdFor(ModuleFile moduleFile) {
- if (moduleFile.isEARFile())
- return new String[]{J2EEConstants.APPLICATION_PUBLICID_1_3, J2EEConstants.APPLICATION_SYSTEMID_1_3};
- else if (moduleFile.isEJBJarFile())
- return new String[]{J2EEConstants.EJBJAR_PUBLICID_2_0, J2EEConstants.EJBJAR_SYSTEMID_2_0};
- else if (moduleFile.isApplicationClientFile())
- return new String[]{J2EEConstants.APP_CLIENT_PUBLICID_1_3, J2EEConstants.APP_CLIENT_SYSTEMID_1_3};
- else if (moduleFile.isWARFile())
- return new String[]{J2EEConstants.WEBAPP_PUBLICID_2_3, J2EEConstants.WEBAPP_SYSTEMID_2_3};
- else if (moduleFile.isRARFile())
- return new String[]{J2EEConstants.CONNECTOR_PUBLICID_1_0, J2EEConstants.CONNECTOR_SYSTEMID_1_0};
- else
- return null;
- }
-
-
- public static int getFastSpecVersion(String fileURI) {
- InputStream in = null;
- try {
- in = new FileInputStream(fileURI);
-
- DocumentType docType = null;
-
- InputSource source = new InputSource(in);
- GeneralXmlDocumentReader aReader = new XmlDocumentReader(source);
- aReader.setValidate(false);
- Document aDocument = aReader.parseDocument();
- if (aDocument != null) {
- docType = aDocument.getDoctype();
- }
- int version = -1;
- if (null != docType) {
- String publicID = docType.getPublicId();
- String systemID = docType.getSystemId();
- if (publicID != null && systemID != null) {
- version = lookupVersion(fileURI, publicID, systemID);
- }
- }
- if (version == -1) {
- String schemaName = null;
- String versionString = null;
- if (aDocument != null) {
- if (null == docType) {
- NamedNodeMap map = aDocument.getDocumentElement().getAttributes();
- if (null != map) {
- Node schemaNode = map.getNamedItem("xsi:schemaLocation"); //$NON-NLS-1$
- if (null != schemaNode) {
- schemaName = schemaNode.getNodeValue();
- }
- Node versionNode = map.getNamedItem("version");//$NON-NLS-1$
- if (null != versionNode) {
- versionString = versionNode.getNodeValue();
- }
- }
- }
- }
- if (null != schemaName) {
- version = lookupVersion(fileURI, schemaName);
- }
- if (version == -1) {
- version = parseVersionString(fileURI, versionString);
- }
- }
-
- return version;
- } catch (IOException ex) {
- return -1;
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException ex) {
- //Ignore
- }
- }
- }
-
- private static int parseVersionString(String fileURI, String versionAttr) {
- int version = -1;
- if (isEARFile(fileURI)) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_4_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
- version = J2EEVersionConstants.JEE_5_0_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_6_0_TEXT)) {
- version = J2EEVersionConstants.JEE_6_0_ID;
- }
- } else if (isEJBJarFile(fileURI)) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.EJB_2_1_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) {
- version = J2EEVersionConstants.EJB_1_1_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_0_TEXT)) {
- version = J2EEVersionConstants.EJB_2_0_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_1_TEXT)) {
- version = J2EEVersionConstants.EJB_2_1_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
- version = J2EEVersionConstants.EJB_3_0_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_1_TEXT)) {
- version = J2EEVersionConstants.EJB_3_1_ID;
- }
- } else if (isApplicationClientFile(fileURI)) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_4_TEXT)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
- version = J2EEVersionConstants.JEE_5_0_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_6_0_TEXT)) {
- version = J2EEVersionConstants.JEE_6_0_ID;
- }
- } else if (isWARFile(fileURI)) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.WEB_2_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) {
- version = J2EEVersionConstants.WEB_2_2_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) {
- version = J2EEVersionConstants.WEB_2_3_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) {
- version = J2EEVersionConstants.WEB_2_4_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_2_5_TEXT)) {
- version = J2EEVersionConstants.WEB_2_5_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
- version = J2EEVersionConstants.WEB_3_0_ID;
- }
- } else if (isRARFile(fileURI)) {
- if (null == versionAttr) {
- version = J2EEVersionConstants.JCA_1_5_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_0_TEXT)) {
- version = J2EEVersionConstants.JCA_1_0_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_5_TEXT)) {
- version = J2EEVersionConstants.JCA_1_5_ID;
- } else if (versionAttr.equals(J2EEVersionConstants.VERSION_1_6_TEXT)) {
- version = J2EEVersionConstants.JCA_1_6_ID;
- } else {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
-
- }
-
- private static int lookupVersion(String fileURI, String schemaName) {
- int version = -1;
- if (isEARFile(fileURI)) {
- if (schemaName.equals(J2EEConstants.APPLICATION_SCHEMA_6)) {
- version = J2EEVersionConstants.JEE_6_0_ID;
- } else if (schemaName.equals(J2EEConstants.APPLICATION_SCHEMA_5)) {
- version = J2EEVersionConstants.JEE_5_0_ID;
- } else if (schemaName.equals(J2EEConstants.APPLICATION_SCHEMA_1_4)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (isEJBJarFile(fileURI)) {
- if ((schemaName.indexOf(J2EEConstants.EJBJAR_SCHEMA_3_1_NS)) != -1) {
- version = J2EEVersionConstants.EJB_3_1_ID;
- } else if ((schemaName.indexOf(J2EEConstants.EJBJAR_SCHEMA_3_0_NS)) != -1) {
- version = J2EEVersionConstants.EJB_3_0_ID;
- } else if ((schemaName.indexOf(J2EEConstants.EJBJAR_SCHEMA_2_1_NS)) != -1) {
- version = J2EEVersionConstants.EJB_2_1_ID;
- }
- } else if (isApplicationClientFile(fileURI)) {
- if (schemaName.equals(J2EEConstants.APP_CLIENT_SCHEMA_6)) {
- version = J2EEVersionConstants.JEE_6_0_ID;
- } else if (schemaName.equals(J2EEConstants.APP_CLIENT_SCHEMA_5)) {
- version = J2EEVersionConstants.JEE_5_0_ID;
- } else if (schemaName.equals(J2EEConstants.APP_CLIENT_SCHEMA_1_4)) {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (isWARFile(fileURI)) {
- if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_3_0)) {
- version = J2EEVersionConstants.WEB_3_0_ID;
- } else if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_2_5)) {
- version = J2EEVersionConstants.WEB_2_5_ID;
- } else if (schemaName.equals(J2EEConstants.WEBAPP_SCHEMA_2_4)) {
- version = J2EEVersionConstants.WEB_2_4_ID;
- }
- } else if (isRARFile(fileURI)) {
- if (schemaName.equals(J2EEConstants.CONNECTOR_SCHEMA_1_6)) {
- version = J2EEVersionConstants.JCA_1_6_ID;
- } else if (schemaName.equals(J2EEConstants.CONNECTOR_SCHEMA_1_5)) {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
- }
-
- private static int lookupVersion(String fileURI, String publicID, String systemID) {
- int version = -1;
- if (isEARFile(fileURI)) {
- if (publicID.equals(J2EEConstants.APPLICATION_PUBLICID_1_3) && (systemID.equals(J2EEConstants.APPLICATION_SYSTEMID_1_3)||systemID.equals(J2EEConstants.APPLICATION_ALT_SYSTEMID_1_3))) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (publicID.equals(J2EEConstants.APPLICATION_PUBLICID_1_2) && (systemID.equals(J2EEConstants.APPLICATION_SYSTEMID_1_2)||systemID.equals(J2EEConstants.APPLICATION_ALT_SYSTEMID_1_2))) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (isEJBJarFile(fileURI)) {
- if (publicID.equals(J2EEConstants.EJBJAR_PUBLICID_2_0) && (systemID.equals(J2EEConstants.EJBJAR_SYSTEMID_2_0)||systemID.equals(J2EEConstants.EJBJAR_ALT_SYSTEMID_2_0))) {
- version = J2EEVersionConstants.EJB_2_0_ID;
- } else if (publicID.equals(J2EEConstants.EJBJAR_PUBLICID_1_1) && (systemID.equals(J2EEConstants.EJBJAR_SYSTEMID_1_1)||systemID.equals(J2EEConstants.EJBJAR_ALT_SYSTEMID_1_1))) {
- version = J2EEVersionConstants.EJB_1_1_ID;
- } else {
- version = J2EEVersionConstants.EJB_2_1_ID;
- }
- } else if (isApplicationClientFile(fileURI)) {
- if (publicID.equals(J2EEConstants.APP_CLIENT_PUBLICID_1_3) && (systemID.equals(J2EEConstants.APP_CLIENT_SYSTEMID_1_3)||systemID.equals(J2EEConstants.APP_CLIENT_ALT_SYSTEMID_1_3))) {
- version = J2EEVersionConstants.J2EE_1_3_ID;
- } else if (publicID.equals(J2EEConstants.APP_CLIENT_PUBLICID_1_2) && (systemID.equals(J2EEConstants.APP_CLIENT_SYSTEMID_1_2)||systemID.equals(J2EEConstants.APP_CLIENT_ALT_SYSTEMID_1_2))) {
- version = J2EEVersionConstants.J2EE_1_2_ID;
- } else {
- version = J2EEVersionConstants.J2EE_1_4_ID;
- }
- } else if (isWARFile(fileURI)) {
- if (publicID.equals(J2EEConstants.WEBAPP_PUBLICID_2_3) && (systemID.equals(J2EEConstants.WEBAPP_SYSTEMID_2_3)||systemID.equals(J2EEConstants.WEBAPP_ALT_SYSTEMID_2_3))) {
- version = J2EEVersionConstants.WEB_2_3_ID;
- } else if (publicID.equals(J2EEConstants.WEBAPP_PUBLICID_2_2) && (systemID.equals(J2EEConstants.WEBAPP_SYSTEMID_2_2)||systemID.equals(J2EEConstants.WEBAPP_ALT_SYSTEMID_2_2))) {
- version = J2EEVersionConstants.WEB_2_2_ID;
- } else {
- version = J2EEVersionConstants.WEB_2_4_ID;
- }
- } else if (isRARFile(fileURI)) {
- if (publicID.equals(J2EEConstants.CONNECTOR_PUBLICID_1_0) && (systemID.equals(J2EEConstants.CONNECTOR_SYSTEMID_1_0)||systemID.equals(J2EEConstants.CONNECTOR_ALT_SYSTEMID_1_0))) {
- version = J2EEVersionConstants.JCA_1_0_ID;
- } else {
- version = J2EEVersionConstants.JCA_1_5_ID;
- }
- }
- return version;
- }
-
- private static boolean isRARFile(String fileURI) {
-
- return (fileURI.indexOf(J2EEConstants.RAR_SHORT_NAME) != -1);
- }
-
- private static boolean isWARFile(String fileURI) {
-
- return (fileURI.indexOf(J2EEConstants.WEBAPP_DD_SHORT_NAME) != -1);
- }
-
- private static boolean isApplicationClientFile(String fileURI) {
- return (fileURI.indexOf(J2EEConstants.APP_CLIENT_DD_SHORT_NAME) != -1);
- }
-
- private static boolean isEJBJarFile(String fileURI) {
- return (fileURI.indexOf(J2EEConstants.EJBJAR_DD_SHORT_NAME) != -1);
- }
-
- private static boolean isEARFile(String fileURI) {
- return (fileURI.indexOf(J2EEConstants.APPLICATION_DD_SHORT_NAME) != -1);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.java
deleted file mode 100644
index 07f59e5aa..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectStreamClass;
-import java.io.StreamCorruptedException;
-import java.lang.reflect.Array;
-
-public class ObjectInputStreamCustomResolver extends java.io.ObjectInputStream {
- private ClassLoader cl;
-
- /**
- * Constructor
- */
-
- public ObjectInputStreamCustomResolver(InputStream is, ClassLoader loader) throws IOException, StreamCorruptedException {
-
- super(is);
-
- if (loader != null)
- cl = loader;
-
- }
-
- /**
- * Gets the java type class given a signature letter.
- */
-
- private Class getType(char type) {
-
- switch (type) {
- case 'B' :
- return byte.class;
- case 'C' :
- return char.class;
- case 'D' :
- return double.class;
- case 'F' :
- return float.class;
- case 'I' :
- return int.class;
- case 'J' :
- return long.class;
- case 'S' :
- return short.class;
- case 'Z' :
- return boolean.class;
- default :
- return null;
- }
-
- }
-
- /**
- * This overrides the default resolveClass() method to use a custom class loader.
- */
-
- @Override
- protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
-
- String className = classDesc.getName();
-
- //UtilsTrace.trace(" ObjectInputStreamCustomResolver: Resolving " + className);
-
- // Handle arrays of classes differently
-
- if (className.startsWith("[")) {//$NON-NLS-1$
-
- Class component = null;
- int dimNum;
-
- for (dimNum = 1; className.charAt(dimNum) == '['; dimNum++)
-
- if (className.charAt(dimNum) == 'L') {
- component = cl.loadClass(className.substring(dimNum + 1, className.length() - 1));
- } else {
- if (className.length() != dimNum + 1)
- throw new ClassNotFoundException(className); // malformed
- component = getType(className.charAt(dimNum));
- }
-
- int dimensions[] = new int[dimNum];
- for (int i = 0; i < dimNum; i++)
- dimensions[i] = 0;
-
- return Array.newInstance(component, dimensions).getClass();
-
- }
- return cl.loadClass(className);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/RarFileDynamicClassLoader.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/RarFileDynamicClassLoader.java
deleted file mode 100644
index c4e6444ac..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/RarFileDynamicClassLoader.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jun 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-import java.security.ProtectionDomain;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.RARFile;
-
-public class RarFileDynamicClassLoader extends ArchiveFileDynamicClassLoader {
-
- public RarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl, ProtectionDomain pDomain) {
- super(anArchive, parentCl, extraCl, pDomain);
- }
-
- public RarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) {
- super(anArchive, parentCl, extraCl);
- }
-
- @Override
- protected File getFile(String name) {
- List children = getRarFile().getArchiveFiles();
- for (int i = 0; i < children.size(); i++) {
- try {
- return ((Archive) children.get(i)).getFile(name);
- } catch (java.io.FileNotFoundException ex) {
- continue;
- }
- }
- return getFileFromDependentJar(name);
- }
-
- private RARFile getRarFile() {
- return (RARFile) getArchive();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/WarFileDynamicClassLoader.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/WarFileDynamicClassLoader.java
deleted file mode 100644
index cfd406476..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/WarFileDynamicClassLoader.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jun 23, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.commonarchivecore.internal.util;
-
-import java.security.ProtectionDomain;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-
-
-/**
- * @author dfholttp
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class WarFileDynamicClassLoader extends ArchiveFileDynamicClassLoader {
-
- private boolean allowLoadingFromWAR = true;
-
- public WarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl, ProtectionDomain pDomain) {
- super(anArchive, parentCl, extraCl, pDomain);
- allowLoadingFromWAR = anArchive.getOptions().getClassLoadingMode() == ArchiveOptions.LOAD_MODE_COMPAT;
- }
-
- public WarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) {
- this(anArchive, parentCl, extraCl, null);
- }
-
- @Override
- protected File getFile(String name) {
- //search classes directory first, then war, then nested archives.
- //search classes directory
- String swizzledName = ArchiveUtil.concatUri(ArchiveConstants.WEBAPP_CLASSES_URI, name, '/');
- try {
- return getWarFile().getFile(swizzledName);
- } catch (java.io.FileNotFoundException ex) {
- }
- //search war if running with compatibility
- if (allowLoadingFromWAR) {
- File file = getFileFromArchive(name);
- if (file != null) {
- return file;
- }
- }
- //search nested archives
- List children = getWarFile().getLibs();
- for (int i = 0; i < children.size(); i++) {
- try {
- return ((Archive) children.get(i)).getFile(name);
- } catch (java.io.FileNotFoundException ex) {
- continue;
- }
- }
- //finally search jars in ear
- return getFileFromDependentJar(name);
- }
-
- private WARFile getWarFile() {
- return (WARFile) getArchive();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseApplication.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseApplication.java
deleted file mode 100644
index 47bc61a80..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseApplication.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * @generated
- */
-public interface LooseApplication extends LooseArchive {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The list of LooseArchives references
- */
- EList getLooseArchives();
-
-} //LooseApplication
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseArchive.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseArchive.java
deleted file mode 100644
index 9f5f05e8a..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseArchive.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-
-
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-
-/**
- * @generated
- */
-public interface LooseArchive extends J2EEEObject {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the Uri attribute
- */
- String getUri();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the Uri attribute
- */
- void setUri(String value);
-
- boolean isEAR();
-
- boolean isWAR();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the BinariesPath attribute
- */
- String getBinariesPath();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the BinariesPath attribute
- */
- void setBinariesPath(String value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the ResourcesPath attribute
- */
- String getResourcesPath();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the ResourcesPath attribute
- */
- void setResourcesPath(String value);
-
- /**
- * @generated This field/method will be replaced during code generation
- * @return The LooseApp reference
- */
- LooseApplication getLooseApp();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the LooseApp reference
- */
- void setLooseApp(LooseApplication value);
-
- boolean isModule();
-
-} //LooseArchive
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfigRegister.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfigRegister.java
deleted file mode 100644
index 17c670796..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfigRegister.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Container;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.wst.common.internal.emf.utilities.StringUtil;
-
-
-/**
- * Used internally for loose module support
- */
-public class LooseConfigRegister {
-
- /**
- * The system property used to specify the absolute path to the loose config document;
- * "was.loose.config"
- */
- public static final String LOOSE_CONFIG_PROPERTY = "was.loose.config"; //$NON-NLS-1$
-
- protected static LooseConfigRegister singleton;
-
- protected LooseConfiguration looseConfiguration;
-
- protected ResourceSet resourceSet;
-
- /** Have we previously loaded or tried to load the loose configuration? */
- protected boolean loadAttempted = false;
-
- private Map looseEarMap;
-
- /**
- * Constructor for LooseConfigRegister.
- */
- protected LooseConfigRegister() {
- super();
- initialize();
- }
-
- public static LooseConfigRegister singleton() {
- if (singleton == null)
- singleton = new LooseConfigRegister();
-
- return singleton;
- }
-
- /**
- * Searches for the ear file in the fluffed LooseConfiguration object, and attempts to load the
- * LooseApplication on demand from the existing mappings if it is not already loaded.
- *
- * @param earFileURI
- * @return
- */
- public LooseApplication findLooseApplication(String earFileURI) {
- // System.out.println(getClass().getName() + ".findLooseApplication(String
- // earFileURI=\""+earFileURI+"\")");
- if (getLooseConfiguration() != null) {
- List apps = getLooseConfiguration().getApplications();
- for (int i = 0; i < apps.size(); i++) {
- LooseApplication app = (LooseApplication) apps.get(i);
- // System.out.println(getClass().getName() + ".findLooseApplication():
- // app["+i+"].getURI()=\""+app.getUri()+"\"" );
- if (app.getUri().equals(earFileURI))
- return app;
- }
- }
- // System.out.println(getClass().getName() + ".findLooseApplication(): did not find loaded
- // LooseApplication, loading new value." );
- if (getDocumentURI() == null || getDocumentURI().trim().length() == 0) {
- URI looseConfig = (URI) getLooseEarMap().get(earFileURI);
- // System.out.println(getClass().getName() + ".findLooseApplication(): looseConfig URI
- // from map \""+looseConfig+"\"");
- LooseApplication application = loadLooseApplication(looseConfig);
- // System.out.println(getClass().getName() + ".findLooseApplication():
- // looseApplication="+application);
- if (application != null) {
- List modules = application.getLooseArchives();
- // System.out.println(getClass().getName() + ".findLooseApplication():
- // looseApplication contains " + modules.size() + " modules.");
- for (int i = 0; i < modules.size(); i++)
- // System.out.println(getClass().getName() + ".findLooseApplication():
- // modules.get("+i+"):"+ modules.get(i));
- getLooseConfiguration().getApplications().add(application);
- return application;
- }
- }
- return null;
- }
-
- /**
- * @param earFileURI
- * The containing EAR -- the absolute file system URI will be determined
- * automatically
- * @param looseApplicationResource
- * The absolute file system URI of a document containing a LooseApplication as its
- * root
- */
- public void addLooseMapping(Container container, String looseApplicationResource) {
- if (container != null)
- addLooseMapping(ArchiveUtil.getOSUri(container.getURI()), looseApplicationResource);
- }
-
- /**
- * @param earFileURI
- * The absolute file system URI of the EAR file of the given mapping
- * @param looseApplicationResource
- * The absolute file system URI of a document containing a LooseApplication as its
- * root
- */
- public void addLooseMapping(String earFileURI, String looseApplicationResource) {
- if (earFileURI != null) {
- // System.out.println(getClass().getName() + ".addLooseMapping(String
- // earFileURI=\""+earFileURI+"\", String
- // looseApplicationResource=\""+looseApplicationResource+"\")");
- if (getLooseEarMap().containsKey(earFileURI)) {
- // System.out.println(getClass().getName() + ".addLooseMapping(): Found existing key
- // with same earFileURI, looking for loaded app.");
- LooseApplication app = findLooseApplicationIfLoaded(earFileURI);
- // System.out.println(getClass().getName() + ".addLooseMapping(): Loaded app=" +
- // app);
- if (app != null) {
- Resource res = loadLooseApplicationResource(URI.createURI(looseApplicationResource));
- // System.out.println(getClass().getName() + ".addLooseMapping(): clearing
- // resource:" + res);
- res.unload();
- removeLooseApplication(app);
- }
- }
- getLooseEarMap().put(earFileURI, URI.createURI(looseApplicationResource));
- }
- }
-
- /**
- * @param earFileURI
- * @return
- */
- public LooseApplication findLooseApplicationIfLoaded(String earFileURI) {
- // System.out.println(getClass().getName() + ".findLooseApplicationIfLoaded(String
- // earFileURI=\""+earFileURI+"\")");
- if (getLooseConfiguration() != null) {
- List apps = getLooseConfiguration().getApplications();
- for (int i = 0; i < apps.size(); i++) {
- LooseApplication app = (LooseApplication) apps.get(i);
- // System.out.println(getClass().getName() + ".findLooseApplicationIfLoaded():
- // app["+i+"].getURI()=\""+app.getUri()+"\"" );
- if (app.getUri().equals(earFileURI))
- return app;
- }
- }
- return null;
- }
-
- /**
- * Allows adding LooseApplications dynmically.
- *
- * @param application
- * An application created and persisted by an external entity
- */
- public void addLooseApplication(LooseApplication application) {
- getLooseConfiguration().getApplications().add(application);
- }
-
- /**
- * Allows removing LooseApplications dynmically.
- *
- * @param application
- * An application created and persisted by an external entity
- */
- public void removeLooseApplication(LooseApplication application) {
- // System.out.println(getClass().getName() + ".removeLooseApplication(LooseApplication
- // application=\""+application+"\")");
- getLooseConfiguration().getApplications().remove(application);
- }
-
- /**
- * @param earFileURI
- * The absolute file system URI of the EAR file of the given mapping
- */
- public void removeLooseMapping(String earFileURI) {
- // System.out.println(getClass().getName() + ".removeLooseMapping(String
- // earFileURI=\""+earFileURI+"\")");
- if (earFileURI != null)
- getLooseEarMap().remove(earFileURI);
- }
-
- public LooseModule findLooseModule(LooseApplication app, String uri, String altDD) {
- List archives = app.getLooseArchives();
- for (int i = 0; i < archives.size(); i++) {
- LooseArchive element = (LooseArchive) archives.get(i);
- if (!element.isModule())
- continue;
-
- if (StringUtil.stringsEqual(uri, element.getUri()) && StringUtil.stringsEqual(altDD, ((LooseModule) element).getAltDD()))
- return (LooseModule) element;
- }
- return null;
- }
-
- public LooseModule findLooseModule(Module m, EARFile ear) {
- LooseApplication app = findLooseApplication(ear.getURI());
- return app == null ? null : findLooseModule(app, m.getUri(), m.getAltDD());
- }
-
- /**
- * Clears the loose configuration; the next time it is requested it will be reloaded;
- */
- public void flush() {
- loadAttempted = false;
- looseConfiguration = null;
- resourceSet = new ResourceSetImpl();
- }
-
- protected void initialize() {
- resourceSet = new ResourceSetImpl();
- }
-
- protected void loadLooseConfiguration() {
- Resource res = loadLooseConfigurationResource();
- if (res != null && !res.getContents().isEmpty())
- setLooseConfiguration((LooseConfiguration) res.getContents().get(0));
- else
- /*
- * if the document is empty then fluff up a LooseConfiguration object
- */
- setLooseConfiguration(LooseconfigFactory.eINSTANCE.createLooseConfiguration());
- loadAttempted = true;
- }
-
- protected Resource loadLooseConfigurationResource() {
- String uri = getDocumentURI();
- if (ArchiveUtil.isNullOrEmpty(uri))
- return null;
- try {
- return resourceSet.getResource(URI.createURI(uri), true);
- } catch (Exception ex) {
- throw new ArchiveRuntimeException("Exception occurred loading loose configuration", ex); //$NON-NLS-1$
- }
- }
-
- protected LooseApplication loadLooseApplication(URI looseAppURI) {
- Resource res = loadLooseApplicationResource(looseAppURI);
- if (res != null && !res.getContents().isEmpty())
- return (LooseApplication) res.getContents().get(0);
- return null;
- }
-
- protected Resource loadLooseApplicationResource(URI looseConfigURI) {
- if (looseConfigURI == null)
- return null;
- try {
- return resourceSet.getResource(looseConfigURI, true);
- } catch (Exception ex) {
- throw new ArchiveRuntimeException("Exception occurred loading loose application", ex); //$NON-NLS-1$
- }
- }
-
- /**
- * Gets the looseConfiguration. Basic accessor with no initialization
- *
- * @return Returns a LooseConfiguration
- */
- public LooseConfiguration primGetLooseConfiguration() {
- return looseConfiguration;
- }
-
- /** The value of the loose config property */
- protected String getDocumentURI() {
- return System.getProperty(LOOSE_CONFIG_PROPERTY);
- }
-
- /**
- * Gets the looseConfiguration. Tries to load it using the system property was.loose.config, if
- * necessary.
- *
- * @return Returns a LooseConfiguration or null
- */
- public LooseConfiguration getLooseConfiguration() {
- if (looseConfiguration == null && !loadAttempted)
- loadLooseConfiguration();
- return looseConfiguration;
- }
-
- /**
- * Assumption: the parameter must be a type that can have children, e.g., LooseWAR or
- * LooseApplication
- */
- public List getLooseChildren(LooseArchive loose) {
- if (loose != null) {
- if (loose.isEAR())
- return ((LooseApplication) loose).getLooseArchives();
- else if (loose.isWAR())
- return ((LooseWARFile) loose).getLooseLibs();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Assumption: the parameter must be a type that can have children, e.g., LooseWAR or
- * LooseApplication
- */
- public LooseArchive findFirstLooseChild(String uri, LooseArchive loose) {
- List children = getLooseChildren(loose);
- for (int i = 0; i < children.size(); i++) {
- LooseArchive child = (LooseArchive) children.get(i);
- if (StringUtil.stringsEqual(uri, child.getUri()))
- return loose;
- }
- return null;
- }
-
- /**
- * Sets the looseConfiguration.
- *
- * @param looseConfiguration
- * The looseConfiguration to set
- */
- public void setLooseConfiguration(LooseConfiguration config) {
- looseConfiguration = config;
- }
-
- /**
- * Have we previously loaded or tried to load the loose configuration?
- *
- * @return Returns a boolean
- */
- public boolean getLoadAttempted() {
- return loadAttempted;
- }
-
- /**
- * @return Returns the looseEarMap.
- */
- public Map getLooseEarMap() {
- if (looseEarMap == null)
- looseEarMap = new HashMap();
- return looseEarMap;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfiguration.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfiguration.java
deleted file mode 100644
index 6d8cf8ef9..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseConfiguration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-
-/**
- * @generated
- */
-public interface LooseConfiguration extends J2EEEObject {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The list of Applications references
- */
- EList getApplications();
-
-} //LooseConfiguration
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseLibrary.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseLibrary.java
deleted file mode 100644
index 086e364fd..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseLibrary.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-/**
- * @generated
- */
-public interface LooseLibrary extends LooseArchive {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The LooseWAR reference
- */
- LooseWARFile getLooseWAR();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param l
- * The new value of the LooseWAR reference
- */
- void setLooseWAR(LooseWARFile value);
-
-} //LooseLibrary
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseModule.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseModule.java
deleted file mode 100644
index cea00926d..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseModule.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-/**
- * @generated
- */
-public interface LooseModule extends LooseArchive {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The value of the AltDD attribute
- */
- String getAltDD();
-
- /**
- * @generated This field/method will be replaced during code generation
- * @param value
- * The new value of the AltDD attribute
- */
- void setAltDD(String value);
-
-} //LooseModule
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseWARFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseWARFile.java
deleted file mode 100644
index 07fe55820..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseWARFile.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * @generated
- */
-public interface LooseWARFile extends LooseModule {
- /**
- * @generated This field/method will be replaced during code generation
- * @return The list of LooseLibs references
- */
- EList getLooseLibs();
-
-} //LooseWARFile
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigFactory.java
deleted file mode 100644
index 6d52f7359..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.LooseconfigPackage
- * @generated
- */
-public interface LooseconfigFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- LooseconfigFactory eINSTANCE = org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Loose Application</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Loose Application</em>'.
- * @generated
- */
- LooseApplication createLooseApplication();
-
- /**
- * Returns a new object of class '<em>Loose Library</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Loose Library</em>'.
- * @generated
- */
- LooseLibrary createLooseLibrary();
-
- /**
- * Returns a new object of class '<em>Loose Module</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Loose Module</em>'.
- * @generated
- */
- LooseModule createLooseModule();
-
- /**
- * Returns a new object of class '<em>Loose Configuration</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Loose Configuration</em>'.
- * @generated
- */
- LooseConfiguration createLooseConfiguration();
-
- /**
- * Returns a new object of class '<em>Loose WAR File</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Loose WAR File</em>'.
- * @generated
- */
- LooseWARFile createLooseWARFile();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- LooseconfigPackage getLooseconfigPackage();
-
-} //LooseconfigFactory
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigPackage.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigPackage.java
deleted file mode 100644
index b4356f46f..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/LooseconfigPackage.java
+++ /dev/null
@@ -1,731 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.jst.j2ee.common.CommonPackage;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.LooseconfigFactory
- * @model kind="package"
- * @generated
- */
-public interface LooseconfigPackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "looseconfig"; //$NON-NLS-1$
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "commonarchive.looseconfig.xmi"; //$NON-NLS-1$
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "org.eclipse.jst.j2ee.commonarchivecore.looseconfig"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- LooseconfigPackage eINSTANCE = org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseArchiveImpl <em>Loose Archive</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseArchiveImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseArchive()
- * @generated
- */
- int LOOSE_ARCHIVE = 1;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_ARCHIVE__URI = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Binaries Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_ARCHIVE__BINARIES_PATH = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Resources Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_ARCHIVE__RESOURCES_PATH = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Loose App</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_ARCHIVE__LOOSE_APP = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Loose Archive</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_ARCHIVE_FEATURE_COUNT = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseApplicationImpl <em>Loose Application</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseApplicationImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseApplication()
- * @generated
- */
- int LOOSE_APPLICATION = 0;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION__URI = LOOSE_ARCHIVE__URI;
-
- /**
- * The feature id for the '<em><b>Binaries Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH;
-
- /**
- * The feature id for the '<em><b>Resources Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH;
-
- /**
- * The feature id for the '<em><b>Loose App</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP;
-
- /**
- * The feature id for the '<em><b>Loose Archives</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION__LOOSE_ARCHIVES = LOOSE_ARCHIVE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Loose Application</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_APPLICATION_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseLibraryImpl <em>Loose Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseLibraryImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseLibrary()
- * @generated
- */
- int LOOSE_LIBRARY = 2;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY__URI = LOOSE_ARCHIVE__URI;
-
- /**
- * The feature id for the '<em><b>Binaries Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH;
-
- /**
- * The feature id for the '<em><b>Resources Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH;
-
- /**
- * The feature id for the '<em><b>Loose App</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP;
-
- /**
- * The feature id for the '<em><b>Loose WAR</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY__LOOSE_WAR = LOOSE_ARCHIVE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Loose Library</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_LIBRARY_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseModuleImpl <em>Loose Module</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseModuleImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseModule()
- * @generated
- */
- int LOOSE_MODULE = 3;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE__URI = LOOSE_ARCHIVE__URI;
-
- /**
- * The feature id for the '<em><b>Binaries Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH;
-
- /**
- * The feature id for the '<em><b>Resources Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH;
-
- /**
- * The feature id for the '<em><b>Loose App</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP;
-
- /**
- * The feature id for the '<em><b>Alt DD</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE__ALT_DD = LOOSE_ARCHIVE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Loose Module</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_MODULE_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseConfigurationImpl <em>Loose Configuration</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseConfigurationImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseConfiguration()
- * @generated
- */
- int LOOSE_CONFIGURATION = 4;
-
- /**
- * The feature id for the '<em><b>Applications</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_CONFIGURATION__APPLICATIONS = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Loose Configuration</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_CONFIGURATION_FEATURE_COUNT = CommonPackage.J2EEE_OBJECT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseWARFileImpl <em>Loose WAR File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseWARFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseWARFile()
- * @generated
- */
- int LOOSE_WAR_FILE = 5;
-
- /**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__URI = LOOSE_MODULE__URI;
-
- /**
- * The feature id for the '<em><b>Binaries Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__BINARIES_PATH = LOOSE_MODULE__BINARIES_PATH;
-
- /**
- * The feature id for the '<em><b>Resources Path</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__RESOURCES_PATH = LOOSE_MODULE__RESOURCES_PATH;
-
- /**
- * The feature id for the '<em><b>Loose App</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__LOOSE_APP = LOOSE_MODULE__LOOSE_APP;
-
- /**
- * The feature id for the '<em><b>Alt DD</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__ALT_DD = LOOSE_MODULE__ALT_DD;
-
- /**
- * The feature id for the '<em><b>Loose Libs</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE__LOOSE_LIBS = LOOSE_MODULE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Loose WAR File</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LOOSE_WAR_FILE_FEATURE_COUNT = LOOSE_MODULE_FEATURE_COUNT + 1;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication <em>Loose Application</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose Application</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication
- * @generated
- */
- EClass getLooseApplication();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication#getLooseArchives <em>Loose Archives</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Loose Archives</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication#getLooseArchives()
- * @see #getLooseApplication()
- * @generated
- */
- EReference getLooseApplication_LooseArchives();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive <em>Loose Archive</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose Archive</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive
- * @generated
- */
- EClass getLooseArchive();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getUri <em>Uri</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Uri</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getUri()
- * @see #getLooseArchive()
- * @generated
- */
- EAttribute getLooseArchive_Uri();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getBinariesPath <em>Binaries Path</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Binaries Path</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getBinariesPath()
- * @see #getLooseArchive()
- * @generated
- */
- EAttribute getLooseArchive_BinariesPath();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getResourcesPath <em>Resources Path</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Resources Path</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getResourcesPath()
- * @see #getLooseArchive()
- * @generated
- */
- EAttribute getLooseArchive_ResourcesPath();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getLooseApp <em>Loose App</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the container reference '<em>Loose App</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive#getLooseApp()
- * @see #getLooseArchive()
- * @generated
- */
- EReference getLooseArchive_LooseApp();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary <em>Loose Library</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose Library</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary
- * @generated
- */
- EClass getLooseLibrary();
-
- /**
- * Returns the meta object for the container reference '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary#getLooseWAR <em>Loose WAR</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the container reference '<em>Loose WAR</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary#getLooseWAR()
- * @see #getLooseLibrary()
- * @generated
- */
- EReference getLooseLibrary_LooseWAR();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule <em>Loose Module</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose Module</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule
- * @generated
- */
- EClass getLooseModule();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule#getAltDD <em>Alt DD</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Alt DD</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule#getAltDD()
- * @see #getLooseModule()
- * @generated
- */
- EAttribute getLooseModule_AltDD();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration <em>Loose Configuration</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose Configuration</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration
- * @generated
- */
- EClass getLooseConfiguration();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration#getApplications <em>Applications</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Applications</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration#getApplications()
- * @see #getLooseConfiguration()
- * @generated
- */
- EReference getLooseConfiguration_Applications();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile <em>Loose WAR File</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Loose WAR File</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile
- * @generated
- */
- EClass getLooseWARFile();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile#getLooseLibs <em>Loose Libs</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Loose Libs</em>'.
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile#getLooseLibs()
- * @see #getLooseWARFile()
- * @generated
- */
- EReference getLooseWARFile_LooseLibs();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- LooseconfigFactory getLooseconfigFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseApplicationImpl <em>Loose Application</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseApplicationImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseApplication()
- * @generated
- */
- EClass LOOSE_APPLICATION = eINSTANCE.getLooseApplication();
-
- /**
- * The meta object literal for the '<em><b>Loose Archives</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference LOOSE_APPLICATION__LOOSE_ARCHIVES = eINSTANCE.getLooseApplication_LooseArchives();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseArchiveImpl <em>Loose Archive</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseArchiveImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseArchive()
- * @generated
- */
- EClass LOOSE_ARCHIVE = eINSTANCE.getLooseArchive();
-
- /**
- * The meta object literal for the '<em><b>Uri</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LOOSE_ARCHIVE__URI = eINSTANCE.getLooseArchive_Uri();
-
- /**
- * The meta object literal for the '<em><b>Binaries Path</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LOOSE_ARCHIVE__BINARIES_PATH = eINSTANCE.getLooseArchive_BinariesPath();
-
- /**
- * The meta object literal for the '<em><b>Resources Path</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LOOSE_ARCHIVE__RESOURCES_PATH = eINSTANCE.getLooseArchive_ResourcesPath();
-
- /**
- * The meta object literal for the '<em><b>Loose App</b></em>' container reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference LOOSE_ARCHIVE__LOOSE_APP = eINSTANCE.getLooseArchive_LooseApp();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseLibraryImpl <em>Loose Library</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseLibraryImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseLibrary()
- * @generated
- */
- EClass LOOSE_LIBRARY = eINSTANCE.getLooseLibrary();
-
- /**
- * The meta object literal for the '<em><b>Loose WAR</b></em>' container reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference LOOSE_LIBRARY__LOOSE_WAR = eINSTANCE.getLooseLibrary_LooseWAR();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseModuleImpl <em>Loose Module</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseModuleImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseModule()
- * @generated
- */
- EClass LOOSE_MODULE = eINSTANCE.getLooseModule();
-
- /**
- * The meta object literal for the '<em><b>Alt DD</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LOOSE_MODULE__ALT_DD = eINSTANCE.getLooseModule_AltDD();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseConfigurationImpl <em>Loose Configuration</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseConfigurationImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseConfiguration()
- * @generated
- */
- EClass LOOSE_CONFIGURATION = eINSTANCE.getLooseConfiguration();
-
- /**
- * The meta object literal for the '<em><b>Applications</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference LOOSE_CONFIGURATION__APPLICATIONS = eINSTANCE.getLooseConfiguration_Applications();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseWARFileImpl <em>Loose WAR File</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseWARFileImpl
- * @see org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseconfigPackageImpl#getLooseWARFile()
- * @generated
- */
- EClass LOOSE_WAR_FILE = eINSTANCE.getLooseWARFile();
-
- /**
- * The meta object literal for the '<em><b>Loose Libs</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference LOOSE_WAR_FILE__LOOSE_LIBS = eINSTANCE.getLooseWARFile_LooseLibs();
-
- }
-
-} //LooseconfigPackage
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseApplicationImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseApplicationImpl.java
deleted file mode 100644
index ed25b9afc..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseApplicationImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public class LooseApplicationImpl extends LooseArchiveImpl implements LooseApplication {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList looseArchives = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseApplicationImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_APPLICATION;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getLooseArchives() {
- if (looseArchives == null) {
- looseArchives = new EObjectContainmentWithInverseEList(LooseArchive.class, this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP);
- }
- return looseArchives;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- return ((InternalEList)getLooseArchives()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- return ((InternalEList)getLooseArchives()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- return getLooseArchives();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- getLooseArchives().clear();
- getLooseArchives().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- getLooseArchives().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES:
- return looseArchives != null && !looseArchives.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- @Override
- public boolean isEAR() {
- return true;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseArchiveImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseArchiveImpl.java
deleted file mode 100644
index beb6ba0bc..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseArchiveImpl.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEEObjectImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public abstract class LooseArchiveImpl extends J2EEEObjectImpl implements LooseArchive {
- /**
- * The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- * @see #getUri()
- * @generated
- * @ordered
- */
- protected static final String URI_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String uri = URI_EDEFAULT;
- /**
- * The default value of the '{@link #getBinariesPath() <em>Binaries Path</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #getBinariesPath()
- * @generated
- * @ordered
- */
- protected static final String BINARIES_PATH_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String binariesPath = BINARIES_PATH_EDEFAULT;
- /**
- * The default value of the '{@link #getResourcesPath() <em>Resources Path</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @see #getResourcesPath()
- * @generated
- * @ordered
- */
- protected static final String RESOURCES_PATH_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String resourcesPath = RESOURCES_PATH_EDEFAULT;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseArchiveImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_ARCHIVE;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getUri() {
- return uri;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setUri(String newUri) {
- String oldUri = uri;
- uri = newUri;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_ARCHIVE__URI, oldUri, uri));
- }
-
- public boolean isEAR() {
- return false;
- }
-
- public boolean isWAR() {
- return false;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getBinariesPath() {
- return binariesPath;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setBinariesPath(String newBinariesPath) {
- String oldBinariesPath = binariesPath;
- binariesPath = newBinariesPath;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_ARCHIVE__BINARIES_PATH, oldBinariesPath, binariesPath));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getResourcesPath() {
- return resourcesPath;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setResourcesPath(String newResourcesPath) {
- String oldResourcesPath = resourcesPath;
- resourcesPath = newResourcesPath;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_ARCHIVE__RESOURCES_PATH, oldResourcesPath, resourcesPath));
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public LooseApplication getLooseApp() {
- if (eContainerFeatureID != LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP) return null;
- return (LooseApplication)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetLooseApp(LooseApplication newLooseApp, NotificationChain msgs) {
- NotificationChain innerMsgs = eBasicSetContainer((InternalEObject)newLooseApp, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP, msgs);
- return innerMsgs;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setLooseApp(LooseApplication newLooseApp) {
- if (newLooseApp != eInternalContainer() || (eContainerFeatureID != LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP && newLooseApp != null)) {
- if (EcoreUtil.isAncestor(this, newLooseApp))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newLooseApp != null)
- msgs = ((InternalEObject)newLooseApp).eInverseAdd(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs);
- msgs = basicSetLooseApp(newLooseApp, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP, newLooseApp, newLooseApp));
- }
-
- public boolean isModule() {
- return false;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- NotificationChain innerMsgs = msgs;
- if (eInternalContainer() != null){
- innerMsgs = eBasicRemoveFromContainer(msgs);
- }
- return basicSetLooseApp((LooseApplication)otherEnd, innerMsgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- return basicSetLooseApp(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- return eInternalContainer().eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__URI:
- return getUri();
- case LooseconfigPackage.LOOSE_ARCHIVE__BINARIES_PATH:
- return getBinariesPath();
- case LooseconfigPackage.LOOSE_ARCHIVE__RESOURCES_PATH:
- return getResourcesPath();
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- return getLooseApp();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__URI:
- setUri((String)newValue);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__BINARIES_PATH:
- setBinariesPath((String)newValue);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__RESOURCES_PATH:
- setResourcesPath((String)newValue);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- setLooseApp((LooseApplication)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__URI:
- setUri(URI_EDEFAULT);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__BINARIES_PATH:
- setBinariesPath(BINARIES_PATH_EDEFAULT);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__RESOURCES_PATH:
- setResourcesPath(RESOURCES_PATH_EDEFAULT);
- return;
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- setLooseApp((LooseApplication)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_ARCHIVE__URI:
- return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
- case LooseconfigPackage.LOOSE_ARCHIVE__BINARIES_PATH:
- return BINARIES_PATH_EDEFAULT == null ? binariesPath != null : !BINARIES_PATH_EDEFAULT.equals(binariesPath);
- case LooseconfigPackage.LOOSE_ARCHIVE__RESOURCES_PATH:
- return RESOURCES_PATH_EDEFAULT == null ? resourcesPath != null : !RESOURCES_PATH_EDEFAULT.equals(resourcesPath);
- case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP:
- return getLooseApp() != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (uri: "); //$NON-NLS-1$
- result.append(uri);
- result.append(", binariesPath: "); //$NON-NLS-1$
- result.append(binariesPath);
- result.append(", resourcesPath: "); //$NON-NLS-1$
- result.append(resourcesPath);
- result.append(')');
- return result.toString();
- }
-
-} //LooseArchiveImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseConfigurationImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseConfigurationImpl.java
deleted file mode 100644
index f4d711cf6..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseConfigurationImpl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.j2ee.common.internal.impl.J2EEEObjectImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public class LooseConfigurationImpl extends J2EEEObjectImpl implements LooseConfiguration {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList applications = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseConfigurationImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_CONFIGURATION;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getApplications() {
- if (applications == null) {
- applications = new EObjectContainmentEList(LooseApplication.class, this, LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS);
- }
- return applications;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS:
- return ((InternalEList)getApplications()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS:
- return getApplications();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS:
- getApplications().clear();
- getApplications().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS:
- getApplications().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS:
- return applications != null && !applications.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //LooseConfigurationImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseLibraryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseLibraryImpl.java
deleted file mode 100644
index 97f9413cc..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseLibraryImpl.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public class LooseLibraryImpl extends LooseArchiveImpl implements LooseLibrary {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseLibraryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_LIBRARY;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public LooseWARFile getLooseWAR() {
- if (eContainerFeatureID != LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR) return null;
- return (LooseWARFile)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetLooseWAR(LooseWARFile newLooseWAR, NotificationChain msgs) {
- NotificationChain msgs2 = eBasicSetContainer((InternalEObject)newLooseWAR, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR, msgs);
- return msgs2;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setLooseWAR(LooseWARFile newLooseWAR) {
- if (newLooseWAR != eInternalContainer() || (eContainerFeatureID != LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR && newLooseWAR != null)) {
- if (EcoreUtil.isAncestor(this, newLooseWAR))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newLooseWAR != null)
- msgs = ((InternalEObject)newLooseWAR).eInverseAdd(this, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS, LooseWARFile.class, msgs);
- msgs = basicSetLooseWAR(newLooseWAR, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR, newLooseWAR, newLooseWAR));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- NotificationChain msgs2 = msgs;
- if (eInternalContainer() != null)
- msgs2 = eBasicRemoveFromContainer(msgs2);
- return basicSetLooseWAR((LooseWARFile)otherEnd, msgs2);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- return basicSetLooseWAR(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- return eInternalContainer().eInverseRemove(this, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS, LooseWARFile.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- return getLooseWAR();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- setLooseWAR((LooseWARFile)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- setLooseWAR((LooseWARFile)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR:
- return getLooseWAR() != null;
- }
- return super.eIsSet(featureID);
- }
-
-} //LooseLibraryImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseModuleImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseModuleImpl.java
deleted file mode 100644
index 1575cdcd2..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseModuleImpl.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public class LooseModuleImpl extends LooseArchiveImpl implements LooseModule {
- /**
- * The default value of the '{@link #getAltDD() <em>Alt DD</em>}' attribute. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getAltDD()
- * @generated
- * @ordered
- */
- protected static final String ALT_DD_EDEFAULT = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected String altDD = ALT_DD_EDEFAULT;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseModuleImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_MODULE;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public String getAltDD() {
- return altDD;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public void setAltDD(String newAltDD) {
- String oldAltDD = altDD;
- altDD = newAltDD;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, LooseconfigPackage.LOOSE_MODULE__ALT_DD, oldAltDD, altDD));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_MODULE__ALT_DD:
- return getAltDD();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_MODULE__ALT_DD:
- setAltDD((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_MODULE__ALT_DD:
- setAltDD(ALT_DD_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_MODULE__ALT_DD:
- return ALT_DD_EDEFAULT == null ? altDD != null : !ALT_DD_EDEFAULT.equals(altDD);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (altDD: "); //$NON-NLS-1$
- result.append(altDD);
- result.append(')');
- return result.toString();
- }
-
-} //LooseModuleImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseWARFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseWARFileImpl.java
deleted file mode 100644
index 4c9b32532..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseWARFileImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-/**
- * @generated
- */
-public class LooseWARFileImpl extends LooseModuleImpl implements LooseWARFile {
- /**
- * @generated This field/method will be replaced during code generation.
- */
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected EList looseLibs = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected LooseWARFileImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return LooseconfigPackage.Literals.LOOSE_WAR_FILE;
- }
-
- @Override
- public boolean isWAR() {
- return true;
- }
-
- /**
- * @generated This field/method will be replaced during code generation
- */
- public EList getLooseLibs() {
- if (looseLibs == null) {
- looseLibs = new EObjectContainmentWithInverseEList(LooseLibrary.class, this, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR);
- }
- return looseLibs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- return ((InternalEList)getLooseLibs()).basicAdd(otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- return ((InternalEList)getLooseLibs()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- return getLooseLibs();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- getLooseLibs().clear();
- getLooseLibs().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- getLooseLibs().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS:
- return looseLibs != null && !looseLibs.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //LooseWARFileImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigFactoryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigFactoryImpl.java
deleted file mode 100644
index 1c04a1f50..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigFactoryImpl.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-
-public class LooseconfigFactoryImpl extends EFactoryImpl implements LooseconfigFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static LooseconfigFactory init() {
- try {
- LooseconfigFactory theLooseconfigFactory = (LooseconfigFactory)EPackage.Registry.INSTANCE.getEFactory("commonarchive.looseconfig.xmi"); //$NON-NLS-1$
- if (theLooseconfigFactory != null) {
- return theLooseconfigFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new LooseconfigFactoryImpl();
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseconfigFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case LooseconfigPackage.LOOSE_APPLICATION: return createLooseApplication();
- case LooseconfigPackage.LOOSE_LIBRARY: return createLooseLibrary();
- case LooseconfigPackage.LOOSE_MODULE: return createLooseModule();
- case LooseconfigPackage.LOOSE_CONFIGURATION: return createLooseConfiguration();
- case LooseconfigPackage.LOOSE_WAR_FILE: return createLooseWARFile();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseApplication createLooseApplication() {
- LooseApplicationImpl looseApplication = new LooseApplicationImpl();
- return looseApplication;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseLibrary createLooseLibrary() {
- LooseLibraryImpl looseLibrary = new LooseLibraryImpl();
- return looseLibrary;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseWARFile createLooseWARFile() {
- LooseWARFileImpl looseWARFile = new LooseWARFileImpl();
- return looseWARFile;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseModule createLooseModule() {
- LooseModuleImpl looseModule = new LooseModuleImpl();
- return looseModule;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseConfiguration createLooseConfiguration() {
- LooseConfigurationImpl looseConfiguration = new LooseConfigurationImpl();
- return looseConfiguration;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseconfigPackage getLooseconfigPackage() {
- return (LooseconfigPackage)getEPackage();
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public static LooseconfigPackage getPackage() {
- return LooseconfigPackage.eINSTANCE;
- }
-
-} //LooseconfigFactoryImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigPackageImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigPackageImpl.java
deleted file mode 100644
index f2f8a856e..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/impl/LooseconfigPackageImpl.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl;
-
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
-import org.eclipse.jst.j2ee.common.CommonPackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin;
-import org.eclipse.jst.j2ee.internal.J2EEInit;
-
-/**
- * @lastgen class LooseconfigPackageImpl extends EPackageImpl implements LooseconfigPackage,
- * EPackage {}
- */
-public class LooseconfigPackageImpl extends EPackageImpl implements LooseconfigPackage {
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseApplicationEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseArchiveEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseLibraryEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseModuleEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseConfigurationEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private EClass looseWARFileEClass = null;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- private LooseconfigPackageImpl() {
- super(eNS_URI, LooseconfigFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public static LooseconfigPackage init() {
- if (isInited) return (LooseconfigPackage)EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI);
-
- // Obtain or create and register package
- LooseconfigPackageImpl theLooseconfigPackage =
- (LooseconfigPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof
- LooseconfigPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new
- LooseconfigPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- J2EEInit.initEMFModels();
- JavaRefPackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- CommonarchivePackageImpl theCommonarchivePackage = (CommonarchivePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI) instanceof CommonarchivePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI) : CommonarchivePackage.eINSTANCE);
-
- // Create package meta-data objects
- theLooseconfigPackage.createPackageContents();
- theCommonarchivePackage.createPackageContents();
-
- // Initialize created meta-data
- theLooseconfigPackage.initializePackageContents();
- theCommonarchivePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theLooseconfigPackage.freeze();
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(LooseconfigPackage.eNS_URI, theLooseconfigPackage);
-
- return theLooseconfigPackage;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseApplication() {
- return looseApplicationEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getLooseApplication_LooseArchives() {
- return (EReference)looseApplicationEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseArchive() {
- return looseArchiveEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getLooseArchive_Uri() {
- return (EAttribute)looseArchiveEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getLooseArchive_BinariesPath() {
- return (EAttribute)looseArchiveEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getLooseArchive_ResourcesPath() {
- return (EAttribute)looseArchiveEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getLooseArchive_LooseApp() {
- return (EReference)looseArchiveEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseLibrary() {
- return looseLibraryEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getLooseLibrary_LooseWAR() {
- return (EReference)looseLibraryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseWARFile() {
- return looseWARFileEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getLooseWARFile_LooseLibs() {
- return (EReference)looseWARFileEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseModule() {
- return looseModuleEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EAttribute getLooseModule_AltDD() {
- return (EAttribute)looseModuleEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EClass getLooseConfiguration() {
- return looseConfigurationEClass;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public EReference getLooseConfiguration_Applications() {
- return (EReference)looseConfigurationEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseconfigFactory getLooseconfigFactory() {
- return (LooseconfigFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- looseApplicationEClass = createEClass(LOOSE_APPLICATION);
- createEReference(looseApplicationEClass, LOOSE_APPLICATION__LOOSE_ARCHIVES);
-
- looseArchiveEClass = createEClass(LOOSE_ARCHIVE);
- createEAttribute(looseArchiveEClass, LOOSE_ARCHIVE__URI);
- createEAttribute(looseArchiveEClass, LOOSE_ARCHIVE__BINARIES_PATH);
- createEAttribute(looseArchiveEClass, LOOSE_ARCHIVE__RESOURCES_PATH);
- createEReference(looseArchiveEClass, LOOSE_ARCHIVE__LOOSE_APP);
-
- looseLibraryEClass = createEClass(LOOSE_LIBRARY);
- createEReference(looseLibraryEClass, LOOSE_LIBRARY__LOOSE_WAR);
-
- looseModuleEClass = createEClass(LOOSE_MODULE);
- createEAttribute(looseModuleEClass, LOOSE_MODULE__ALT_DD);
-
- looseConfigurationEClass = createEClass(LOOSE_CONFIGURATION);
- createEReference(looseConfigurationEClass, LOOSE_CONFIGURATION__APPLICATIONS);
-
- looseWARFileEClass = createEClass(LOOSE_WAR_FILE);
- createEReference(looseWARFileEClass, LOOSE_WAR_FILE__LOOSE_LIBS);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
-
- boolean hasLock = false;
- try {
- hasLock = J2EEInit.aquireInitializePackageContentsLock();
- } catch (InterruptedException e) {
- J2EECorePlugin.logError(e);
- }
-
- try{
- // Add supertypes to classes
- looseApplicationEClass.getESuperTypes().add(this.getLooseArchive());
- looseArchiveEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject());
- looseLibraryEClass.getESuperTypes().add(this.getLooseArchive());
- looseModuleEClass.getESuperTypes().add(this.getLooseArchive());
- looseConfigurationEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject());
- looseWARFileEClass.getESuperTypes().add(this.getLooseModule());
-
- // Initialize classes and features; add operations and parameters
- initEClass(looseApplicationEClass, LooseApplication.class, "LooseApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getLooseApplication_LooseArchives(), this.getLooseArchive(), this.getLooseArchive_LooseApp(), "looseArchives", null, 0, -1, LooseApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(looseArchiveEClass, LooseArchive.class, "LooseArchive", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEAttribute(getLooseArchive_Uri(), ecorePackage.getEString(), "uri", null, 0, 1, LooseArchive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getLooseArchive_BinariesPath(), ecorePackage.getEString(), "binariesPath", null, 0, 1, LooseArchive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEAttribute(getLooseArchive_ResourcesPath(), ecorePackage.getEString(), "resourcesPath", null, 0, 1, LooseArchive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- initEReference(getLooseArchive_LooseApp(), this.getLooseApplication(), this.getLooseApplication_LooseArchives(), "looseApp", null, 0, 1, LooseArchive.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- addEOperation(looseArchiveEClass, ecorePackage.getEBoolean(), "isModule", 0, 1); //$NON-NLS-1$
-
- initEClass(looseLibraryEClass, LooseLibrary.class, "LooseLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getLooseLibrary_LooseWAR(), this.getLooseWARFile(), this.getLooseWARFile_LooseLibs(), "looseWAR", null, 0, 1, LooseLibrary.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(looseModuleEClass, LooseModule.class, "LooseModule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEAttribute(getLooseModule_AltDD(), ecorePackage.getEString(), "altDD", null, 0, 1, LooseModule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(looseConfigurationEClass, LooseConfiguration.class, "LooseConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getLooseConfiguration_Applications(), this.getLooseApplication(), null, "applications", null, 0, -1, LooseConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
-
- initEClass(looseWARFileEClass, LooseWARFile.class, "LooseWARFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getLooseWARFile_LooseLibs(), this.getLooseLibrary(), this.getLooseLibrary_LooseWAR(), "looseLibs", null, 0, -1, LooseWARFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
- }finally{
- if( hasLock )
- J2EEInit.releaseInitializePackageContentsLock();
- }
- }
-
-} //LooseconfigPackageImpl
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigAdapterFactory.java
deleted file mode 100644
index e0617b4d7..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigAdapterFactory.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.util;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-
-/**
- * @lastgen class LooseconfigAdapterFactory extends AdapterFactoryImpl {}
- */
-public class LooseconfigAdapterFactory extends AdapterFactoryImpl {
- /**
- * @generated This field/method will be replaced during code generation.
- */
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- protected static LooseconfigPackage modelPackage;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseconfigAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = LooseconfigPackage.eINSTANCE;
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- @Override
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected LooseconfigSwitch modelSwitch =
- new LooseconfigSwitch() {
- @Override
- public Object caseLooseApplication(LooseApplication object) {
- return createLooseApplicationAdapter();
- }
- @Override
- public Object caseLooseArchive(LooseArchive object) {
- return createLooseArchiveAdapter();
- }
- @Override
- public Object caseLooseLibrary(LooseLibrary object) {
- return createLooseLibraryAdapter();
- }
- @Override
- public Object caseLooseModule(LooseModule object) {
- return createLooseModuleAdapter();
- }
- @Override
- public Object caseLooseConfiguration(LooseConfiguration object) {
- return createLooseConfigurationAdapter();
- }
- @Override
- public Object caseLooseWARFile(LooseWARFile object) {
- return createLooseWARFileAdapter();
- }
- @Override
- public Object caseJ2EEEObject(J2EEEObject object) {
- return createJ2EEEObjectAdapter();
- }
- @Override
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- @Override
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * By default create methods return null so that we can easily ignore cases. It's useful to
- * ignore a case when inheritance will catch all the cases anyway.
- */
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseApplicationAdapter() {
-
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseArchiveAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseLibraryAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseWARFileAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.common.J2EEEObject <em>J2EEE Object</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.j2ee.common.J2EEEObject
- * @generated
- */
- public Adapter createJ2EEEObjectAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc --> This default
- * implementation returns null. <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseModuleAdapter() {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Adapter createLooseConfigurationAdapter() {
- return null;
- }
-
-} //LooseconfigAdapterFactory
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigSwitch.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigSwitch.java
deleted file mode 100644
index 2d42f60a5..000000000
--- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/looseconfig/internal/util/LooseconfigSwitch.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.util;
-
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.common.J2EEEObject;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseApplication;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseConfiguration;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseLibrary;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseModule;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseWARFile;
-import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseconfigPackage;
-
-
-/**
- * @lastgen class LooseconfigSwitch {}
- */
-public class LooseconfigSwitch {
- /**
- * The cached model package
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- protected static LooseconfigPackage modelPackage;
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public LooseconfigSwitch() {
- if (modelPackage == null) {
- modelPackage = LooseconfigPackage.eINSTANCE;
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case LooseconfigPackage.LOOSE_APPLICATION: {
- LooseApplication looseApplication = (LooseApplication)theEObject;
- Object result = caseLooseApplication(looseApplication);
- if (result == null) result = caseLooseArchive(looseApplication);
- if (result == null) result = caseJ2EEEObject(looseApplication);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case LooseconfigPackage.LOOSE_ARCHIVE: {
- LooseArchive looseArchive = (LooseArchive)theEObject;
- Object result = caseLooseArchive(looseArchive);
- if (result == null) result = caseJ2EEEObject(looseArchive);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case LooseconfigPackage.LOOSE_LIBRARY: {
- LooseLibrary looseLibrary = (LooseLibrary)theEObject;
- Object result = caseLooseLibrary(looseLibrary);
- if (result == null) result = caseLooseArchive(looseLibrary);
- if (result == null) result = caseJ2EEEObject(looseLibrary);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case LooseconfigPackage.LOOSE_MODULE: {
- LooseModule looseModule = (LooseModule)theEObject;
- Object result = caseLooseModule(looseModule);
- if (result == null) result = caseLooseArchive(looseModule);
- if (result == null) result = caseJ2EEEObject(looseModule);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case LooseconfigPackage.LOOSE_CONFIGURATION: {
- LooseConfiguration looseConfiguration = (LooseConfiguration)theEObject;
- Object result = caseLooseConfiguration(looseConfiguration);
- if (result == null) result = caseJ2EEEObject(looseConfiguration);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case LooseconfigPackage.LOOSE_WAR_FILE: {
- LooseWARFile looseWARFile = (LooseWARFile)theEObject;
- Object result = caseLooseWARFile(looseWARFile);
- if (result == null) result = caseLooseModule(looseWARFile);
- if (result == null) result = caseLooseArchive(looseWARFile);
- if (result == null) result = caseJ2EEEObject(looseWARFile);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseApplication(LooseApplication object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseArchive(LooseArchive object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseLibrary(LooseLibrary object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseWARFile(LooseWARFile object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>J2EEE Object</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>J2EEE Object</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseJ2EEEObject(J2EEEObject object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseModule(LooseModule object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object caseLooseConfiguration(LooseConfiguration object) {
- return null;
- }
-
- /**
- * @generated This field/method will be replaced during code generation.
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //LooseconfigSwitch
-
-
-

Back to the top