diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.core/commonArchive')
157 files changed, 0 insertions, 27454 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive.properties deleted file mode 100644 index 837df5427..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} must be implemented in subclass -key_class_reflection_ERROR_=IWAE0002E Unable to reflect the class "{0}" in order to compare the primary key field "{1}" from entity "{2}" -key_field_reflection_ERROR_=IWAE0003E Unable to reflect the type of the primary key field "{0}" from entity "{1}" -removing_key_field_INFO_=IWAE0004I Removing invalid prim-key-field "{0}" from entity "{1}" -repair_usage_ERROR_=IWAE0005E RepairArchiveCommand usage: cannot write to destinationPath: {0} -invalid_archive_EXC_=IWAE0006E Archive is not a valid {0} because the deployment descriptor can not be found (case sensitive): {1} -load_resource_EXC_=IWAE0007E Could not load resource "{0}" in archive "{1}" -nested_jar_EXC_=IWAE0008E An error occurred reading {0} from {1} -make_temp_dir_EXC_=IWAE0009E Unable to make temp directory: {0} -invalid_classpath_WARN_=IWAE0010W Classpath element "{0}" is not a directory or a Zip file -invalid_cp_file_WARN_=IWAE0011W Classpath element "{0}" does not point to a local file -io_ex_loading_EXC_=IWAE0012E An IO exception occurred loading {0} -tx_bean_mgd_WARN_=IWAE0013W EJB 1.0 Import: Not mapping TX_BEAN_MANAGED control descriptor for {0} -error_saving_EXC_=IWAE0014E Error saving {0} -io_ex_manifest_EXC_=IWAE0015E An IOException occurred reading the manifest in archive: {0} -io_ex_reopen_EXC_=IWAE0016E IOException occurred while reopening {0} -unable_replace_EXC_=IWAE0017E Unable to replace original archive: {0} -duplicate_file_EXC_=IWAE0018E The archive named {0} already contains a file named {1} -duplicate_entry_EXC_=IWAE0019E A file or resource with uri {0} already exists in the archive named {1} -file_exist_as_dir_EXC_=IWAE0020E A file named {0} exists and is a directory -uncontained_module_EXC_=IWAE0021E Module {0} is not contained by an EAR file -dd_in_ear_load_EXC_=IWAE0022E Exception occurred loading deployment descriptor for module "{0}" in EAR file "{1}" -nested_open_fail_EXC_=IWAE0023E Unable to open module file "{0}" in EAR file "{1}" -duplicate_module_EXC_=IWAE0024E The deployment descriptor for the EAR file "{0}" already contains a module having uri "{1}" -no_sec_role_EXC_=IWAE0025E {0}: EAR File deployment descriptor does not contain a security role named {1} -dup_sec_role_EXC_=IWAE0026E {0}: EAR File deployment descriptor already contains a security role named {1} -dup_sec_role_module_EXC_=IWAE0027E Deployment descriptor for {0} already contains a security role named {1} -dup_resource_EXC_=IWAE0028E Resource named "{0}" already exists in archive "{1}" -error_saving_EXC_=IWAE0030E Error saving {0} -add_copy_class_dir_EXC_=IWAE0031E The method "addCopyClass" is not supported for directories. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E The method "addCopyLib" is not supported for directories. URI: {0} -list_components_war_EXC_=IWAE0033E Exception occurred listing components in WAR file: {0} -open_nested_EXC_=IWAE0034E Could not open the nested archive "{0}" in "{1}" -make_temp_file_WARN_=IWAE0035W Warning: Unable to create temp file for {0}. This will impact performance. -file_not_found_EXC_=IWAE0036E URI Name: {0}; File name: {1} -could_not_open_EXC_=IWAE0037E Could not open {0} -could_not_find_dir_EXC_=IWAE0038E Unable to open directory {0} -not_a_dir_EXC_=IWAE0039E Unable to open directory because file is not a directory: {0} -inferred_dds_EXC_=IWAE0040E The EJB JAR file "{0}" was inferred to be of version 1.0 because the manifest does not declare enterprise beans but serialized deployment descriptors exist in the JAR. -filename_exception_EXC_=IWAE0041E Filename: {0}; Exception: {1} -no_dds_10_EXC_=IWAE0042E No deployment descriptors in EJB 1.0 JAR file: {0} -manifest_dd_load_EXC_=IWAE0043E The JAR manifest declares an enterprise bean for which the deployment descriptor file can not be loaded: {0} -manifest_dd_find_EXC_=IWAE0044E The JAR manifest declares an enterprise bean for which the deployment descriptor file can not be found: {0} -io_ex_reading_dd_EXC_=IWAE0045E IO Exception occurred reading {0} -ser_not_dd_EXC_=IWAE0046E The serialized object in file "{0}" is not a an instance of javax.ejb.deployment.DeploymentDescriptor -reading_dd_EXC_=IWAE0047E Exception occurred reading {0} -missing_class_EXC_=IWAE0048E Could not deserialize {0} because a required class could not be found. Exception: {1} -Converted=Converted -Stack_trace_of_nested_exce_EXC_=IWAE0049E Stack trace of nested exception: -IOException_occurred_while_EXC_=IWAE0050E IOException occurred while copying manifest -Extract_destination_is_the_EXC_=IWAE0051E Extract destination is the same path as source file -Parameter_should_not_be_nu_EXC_=IWAE0052E Parameter should not be null -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E Archive is not a valid EJB JAR file (1.0) because no serialized deployment descriptors can be found, either in the manifest or in entries with a ".ser" extension -_The_following_files_could_EXC_=IWAE0056E The following files could not be loaded: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand failed - exception stack trace: -FixPrimKeyCommand_usage___=FixPrimKeyCommand usage: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E FixPrimKeyCommand usage: sourceJarFilePath must point to a valid EJB JAR file or directory of an inflated EJB JAR file -Repair_command_failed_-_ex_EXC_=IWAE0059E Repair command failed - exception stack trace: -Repairs_all_entries_in_the=Repairs all entries in the META-INF and/or WEB-INF directories to be the correct case -RepairArchiveCommand_usage=RepairArchiveCommand usage: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E RepairArchiveCommand usage: sourceJarFilePath must point to a valid archive or directory of an inflated archive -Application_Client_Jar_Fil=Application Client JAR File -EAR_File=EAR File -EJB_Jar_File=EJB JAR File -RAR_File=RAR File -WAR_File=WAR File -Error_occurred_iterating_f_EXC_=IWAE0061E Error occurred iterating files -End_of_list_reached_EXC_=IWAE0062E Reached end of list -Internal_Error__Iterator_o_EXC_=IWAE0063E Internal Error: Iterator out of sync with zip entries -Error_iterating_the_archiv_EXC_=IWAE0064E Error iterating the archive -Absolute_path_unknown_EXC_=IWAE0065E Absolute path unknown -Original_archive_is_not_a__EXC_=IWAE0066E Original archive is not a directory -Null_uri_EXC_=IWAE0067E Null uri -Module_file=Module file -A_WAR_file=WAR file -An_EJB_JAR_file=EJB JAR file -An_Application_Client_JAR_file=Application Client JAR file -A_RAR_file=RAR file -A_Application_file=Application file -A_file_does_not_exist_for_module=A file does not exist for module element having uri: {0} -File_not_correct_type=The file {0} in EAR file {1} is not the correct type based on the application deployment descriptor. Expected type: {2}"; -Module_not_in_EAR=Module is not in an EAR: {0} -Module_file_does_not_exist_2=Module file does not exist for Module ref. Module = {0} -FileImpl._Error_0=Recursive containment not allowed for diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_de.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_de.properties deleted file mode 100644 index 817d73f34..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_de.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} muss in einer Unterklasse implementiert werden. -key_class_reflection_ERROR_=IWAE0002E Die Klasse "{0}" kann zum Vergleichen des Prim\u00e4rschl\u00fcsselfelds "{1}" aus der Entit\u00e4t "{2}" nicht wiedergegeben werden. -key_field_reflection_ERROR_=IWAE0003E Der Typs des Prim\u00e4rschl\u00fcsselfelds "{0}" aus der Entit\u00e4t "{1}" kann nicht wiedergegeben werden. -removing_key_field_INFO_=IWAE0004I Das ung\u00fcltige Prim\u00e4rschl\u00fcsselfeld "{0}" wird aus der Entit\u00e4t "{1}" entfernt. -repair_usage_ERROR_=IWAE0005E Syntax f\u00fcr RepairArchiveCommand: Schreiben in destinationPath {0} ist nicht m\u00f6glich. -invalid_archive_EXC_=IWAE0006E Das Archiv ist kein g\u00fcltiger Wert f\u00fcr {0}, weil der Implementierungsdeskriptor nicht gefunden wurde (Gro\u00df-/Kleinschreibung muss beachtet werden): {1} -load_resource_EXC_=IWAE0007E Das Laden der Ressource "{0}" in Archiv "{1}" ist nicht m\u00f6glich. -nested_jar_EXC_=IWAE0008E Beim Lesen von {0} aus {1} ist ein Fehler aufgetreten. -make_temp_dir_EXC_=IWAE0009E Das tempor\u00e4re Verzeichnis {0} kann nicht erstellt werden. -invalid_classpath_WARN_=IWAE0010W Das Klassenpfadelement "{0}" ist kein Verzeichnis und keine komprimierte Datei. -invalid_cp_file_WARN_=IWAE0011W Das Klassenpfadelement "{0}" verweist nicht auf eine lokale Datei. -io_ex_loading_EXC_=IWAE0012E Beim Laden von {0} ist eine E/A-Ausnahmebedingung aufgetreten. -tx_bean_mgd_WARN_=IWAE0013W Import mit EJB 1.0: Steuerungsdeskriptor TX_BEAN_MANAGED f\u00fcr {0} wird nicht zugeordnet. -error_saving_EXC_=IWAE0014E Fehler beim Speichern von {0}. -io_ex_manifest_EXC_=IWAE0015E Beim Lesen des Manifestes im Archiv {0} ist eine E/A-Ausnahmebedingung aufgetreten. -io_ex_reopen_EXC_=IWAE0016E Beim erneuten \u00d6ffnen von {0} ist eine E/A-Ausnahmebedingung aufgetreten. -unable_replace_EXC_=IWAE0017E Das Originalarchiv {0} kann nicht ersetzt werden. -duplicate_file_EXC_=IWAE0018E Das Archiv mit dem Namen {0} enth\u00e4lt bereits eine Datei mit dem Namen {1}. -duplicate_entry_EXC_=IWAE0019E Eine Datei oder Ressource mit der URI {0} ist bereits im Archiv mit dem Namen {1} vorhanden. -file_exist_as_dir_EXC_=IWAE0020E Eine Datei mit dem Namen {0} ist vorhanden und ist ein Verzeichnis. -uncontained_module_EXC_=IWAE0021E Das Modul {0} ist nicht in einer EAR-Datei enthalten. -dd_in_ear_load_EXC_=IWAE0022E Beim Laden des Implementierungsdeskriptors f\u00fcr das Modul "{0}" in der EAR-Datei "{1}" ist eine Ausnahmebedingung aufgetreten. -nested_open_fail_EXC_=IWAE0023E Die Moduldatei "{0}" in der EAR-Datei "{1}" kann nicht ge\u00f6ffnet werden. -duplicate_module_EXC_=IWAE0024E Der Implementierungsdeskriptor f\u00fcr die EAR-Datei "{0}" enth\u00e4lt bereits ein Modul mit der URI "{1}". -no_sec_role_EXC_=IWAE0025E {0}: Der Implementierungsdeskriptor f\u00fcr die EAR-Datei enth\u00e4lt keine Sicherheitsberechtigungsklasse mit dem Namen {1}. -dup_sec_role_EXC_=IWAE0026E {0}: Der Implementierungsdeskriptor f\u00fcr die EAR-Datei enth\u00e4lt bereits eine Sicherheitsberechtigungsklasse mit dem Namen {1}. -dup_sec_role_module_EXC_=IWAE0027E Der Implementierungsdeskriptor f\u00fcr {0} enth\u00e4lt bereits eine Sicherheitsberechtigungsklasse mit dem Namen {1}. -dup_resource_EXC_=IWAE0028E Die Ressource mit dem Namen "{0}" ist im Archiv "{1}" bereits vorhanden. -error_saving_EXC_=IWAE0030E Fehler beim Speichern von {0}. -add_copy_class_dir_EXC_=IWAE0031E Die Methode "addCopyClass" wird f\u00fcr Verzeichnisse nicht unterst\u00fctzt. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E Die Methode "addCopyLib" wird f\u00fcr Verzeichnisse nicht unterst\u00fctzt. URI: {0} -list_components_war_EXC_=IWAE0033E Beim Auflisten der Komponenten in der WAR-Datei {0} ist eine Ausnahmebedingung aufgetreten. -open_nested_EXC_=IWAE0034E Das verschachtelte Archiv "{0}" in "{1}" konnte nicht ge\u00f6ffnet werden. -make_temp_file_WARN_=IWAE0035W Warnung: Die tempor\u00e4re Datei f\u00fcr {0} kann nicht erstellt werden. Dies beeintr\u00e4chtigt die Leistung. -file_not_found_EXC_=IWAE0036E URI-Name: {0}, Dateiname: {1} -could_not_open_EXC_=IWAE0037E {0} konnte nicht ge\u00f6ffnet werden. -could_not_find_dir_EXC_=IWAE0038E Das Verzeichnis {0} kann nicht ge\u00f6ffnet werden. -not_a_dir_EXC_=IWAE0039E Das Verzeichnis kann nicht ge\u00f6ffnet werden, weil die Datei kein Verzeichnis ist: {0} -inferred_dds_EXC_=IWAE0040E Es wurde festgestellt, dass die EJB-JAR-Datei "{0}" aus Version 1.0 stammt, weil das Manifest keine Enterprise-Beans deklariert, in der JAR jedoch serialisierte Implementierungsdeskriptoren vorhanden sind. -filename_exception_EXC_=IWAE0041E Dateiname: {0}, Ausnahmebedingung: {1} -no_dds_10_EXC_=IWAE0042E Keine Implementierungsdeskriptoren in EJB 1.0 JAR-Datei {0} -manifest_dd_load_EXC_=IWAE0043E Das JAR-Manifest deklariert eine Enterprise-Bean, deren Implementierungsdeskriptordatei nicht geladen werden kann: {0} -manifest_dd_find_EXC_=IWAE0044E Das JAR-Manifest deklariert eine Enterprise-Bean, deren Implementierungsdeskriptordatei nicht gefunden werden kann: {0} -io_ex_reading_dd_EXC_=IWAE0045E Beim Lesen von {0} ist eine E/A-Ausnahmebedingung aufgetreten. -ser_not_dd_EXC_=IWAE0046E Das serialisierte Objekt in der Datei "{0}" ist kein Exemplar von javax.ejb.deployment.DeploymentDescriptor. -reading_dd_EXC_=IWAE0047E Beim Lesen von {0} ist eine E/A-Ausnahmebedingung aufgetreten. -missing_class_EXC_=IWAE0048E {0} konnte nicht entserialisiert werden, weil eine erforderliche Klasse nicht gefunden wurde. Ausnahmebedingung: {1} -Converted=Konvertiert -Stack_trace_of_nested_exce_EXC_=IWAE0049E Stack-Trace der verschachtelten Ausnahmebedingung: -IOException_occurred_while_EXC_=IWAE0050E Beim Kopieren des Manifestes ist eine E/A-Ausnahmebedingung aufgetreten. -Extract_destination_is_the_EXC_=IWAE0051E Das Extraktionsziel weist denselben Pfad auf wie die Quellendatei. -Parameter_should_not_be_nu_EXC_=IWAE0052E Der Parameter sollte nicht Null sein. -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E Das Archiv ist keine g\u00fcltige EJB-JAR-Datei (1.0), weil weder im Manifest noch in Eintr\u00e4gen mit der Erweiterung ".ser" serialisierte Implementierungsdeskriptoren gefunden wurden. -_The_following_files_could_EXC_=IWAE0056E Die folgenden Dateien konnten nicht geladen werden: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand ist fehlgeschlagen - Stack-Trace f\u00fcr Ausnahmebedingung: -FixPrimKeyCommand_usage___=Syntax f\u00fcr FixPrimKeyCommand: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E Syntax f\u00fcr FixPrimKeyCommand: sourceJarFilePath muss auf eine g\u00fcltige EJB-JAR-Datei oder das Verzeichnis einer komprimierten EJB-JAR-Datei verweisen. -Repair_command_failed_-_ex_EXC_=IWAE0059E Befehl REPAIR ist fehlgeschlagen - Stack-Trace f\u00fcr Ausnahmebedingung: -Repairs_all_entries_in_the=Alle Eintr\u00e4ge in den Verzeichnissen META-INF und/oder WEB-INF werden in die korrekte Schreibweise berichtigt. -RepairArchiveCommand_usage=Syntax f\u00fcr RepairArchiveCommand: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E Syntax f\u00fcr RepairArchiveCommand: sourceJarFilePath muss auf ein g\u00fcltiges Archiv oder ein Verzeichnis eines komprimierten Archivs verweisen. -Application_Client_Jar_Fil=JAR-Datei f\u00fcr Anwendungsclient -EAR_File=EAR-Datei -EJB_Jar_File=EJB-JAR-Datei -RAR_File=RAR-Datei -WAR_File=WAR-Datei -Error_occurred_iterating_f_EXC_=IWAE0061E Bie der Dateiiteration ist ein Fehler aufgetreten. -End_of_list_reached_EXC_=IWAE0062E Das Ende der Liste wurde erreicht. -Internal_Error__Iterator_o_EXC_=IWAE0063E Interner Fehler: Der Iterator ist nicht mehr mit den ZIP-Eintr\u00e4gen synchron. -Error_iterating_the_archiv_EXC_=IWAE0064E Bei der Iteration des Archivs ist ein Fehler aufgetreten. -Absolute_path_unknown_EXC_=IWAE0065E Der absolute Pfad ist unbekannt. -Original_archive_is_not_a__EXC_=IWAE0066E Das Originalarchiv ist kein Verzeichnis. -Null_uri_EXC_=IWAE0067E Null-URI -Module_file=Moduldatei -A_WAR_file=WAR-Datei -An_EJB_JAR_file=EJB-JAR-Datei -An_Application_Client_JAR_file=JAR-Datei f\u00fcr Anwendungsclient -A_RAR_file=RAR-Datei -A_Application_file=Anwendungsdatei -A_file_does_not_exist_for_module=Eine Datei ist f\u00fcr das Modulelement mit der folgenden URI nicht vorhanden: {0} -File_not_correct_type=Die Datei {0} in der EAR-Datei {1} weist nicht den korrekten Typ basierend auf dem Anwendungsimplementierungsdeskriptor auf. Erwarteter Typ: {2}"; -Module_not_in_EAR=Das Modul ist nicht in einer EAR enthalten: {0} -Module_file_does_not_exist_2=Die Moduldatei ist nicht f\u00fcr den Modulverweis vorhanden. Modul = {0} -FileImpl._Error_0=Rekursiver Einschluss nicht zul\u00e4ssig f\u00fcr diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_es.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_es.properties deleted file mode 100644 index 395da1d92..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_es.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} debe implementarse en la subclase -key_class_reflection_ERROR_=IWAE0002E No se puede reflejar la clase "{0}" para poder comparar el campo de clave primaria "{1}" de la entidad "{2}" -key_field_reflection_ERROR_=IWAE0003E No se puede reflejar el tipo del campo de clave primaria "{0}" de la entidad "{1}" -removing_key_field_INFO_=IWAE0004I Eliminando campo de clave primaria no v\u00e1lido "{0}" de la entidad "{1}" -repair_usage_ERROR_=IWAE0005E Uso de RepairArchiveCommand: no se puede escribir en destinationPath: {0} -invalid_archive_EXC_=IWAE0006E El archivador no es un {0} v\u00e1lido ya que el descriptor de despliegue no puede encontrarse (sensible a may\u00fasculas y min\u00fasculas): {1} -load_resource_EXC_=IWAE0007E No se ha podido cargar el recurso "{0}" en el archivador "{1}" -nested_jar_EXC_=IWAE0008E Se ha producido un error al leer {0} desde {1} -make_temp_dir_EXC_=IWAE0009E No se puede crear el directorio temporal: {0} -invalid_classpath_WARN_=IWAE0010W El elemento de la v\u00eda de acceso de clases "{0}" no es un directorio ni un archivo Zip -invalid_cp_file_WARN_=IWAE0011W El elemento de la v\u00eda de acceso de clases "{0}" no apunta a un archivo local -io_ex_loading_EXC_=IWAE0012E Se ha producido una excepci\u00f3n de E/S al cargar {0} -tx_bean_mgd_WARN_=IWAE0013W Importaci\u00f3n de EJB 1.0: El descriptor de control TX_BEAN_MANAGED no se correlaciona para {0} -error_saving_EXC_=IWAE0014E Error al guardar {0} -io_ex_manifest_EXC_=IWAE0015E Se ha producido una excepci\u00f3n de E/S al leer el manifiesto en el archivador: {0} -io_ex_reopen_EXC_=IWAE0016E Se ha producido una excepci\u00f3n de E/S al reabrir {0} -unable_replace_EXC_=IWAE0017E No se puede sustituir el archivador original: {0} -duplicate_file_EXC_=IWAE0018E El archivador denominado {0} ya contiene un archivo denominado {1} -duplicate_entry_EXC_=IWAE0019E Un archivo o recurso con el uri {0} ya existe en el archivador denominado {1} -file_exist_as_dir_EXC_=IWAE0020E Existe un archivo denominado {0} y es un directorio -uncontained_module_EXC_=IWAE0021E El m\u00f3dulo {0} no est\u00e1 contenido dentro de un archivo EAR -dd_in_ear_load_EXC_=IWAE0022E Se ha producido una excepci\u00f3n al cargar el descriptor de despliegue para el m\u00f3dulo "{0}" en el archivo EAR "{1}" -nested_open_fail_EXC_=IWAE0023E No se puede abrir el archivo de m\u00f3dulo "{0}" en el archivo EAR "{1}" -duplicate_module_EXC_=IWAE0024E El descriptor de despliegue del archivo EAR "{0}" ya contiene un m\u00f3dulo que tiene el uri "{1}" -no_sec_role_EXC_=IWAE0025E {0}: El descriptor de despliegue del archivo EAR no contiene un cometido de seguridad denominado {1} -dup_sec_role_EXC_=IWAE0026E {0}: El descriptor de despliegue del archivo EAR ya contiene un cometido de seguridad denominado {1} -dup_sec_role_module_EXC_=IWAE0027E El descriptor de despliegue de {0} ya contiene un cometido de seguridad denominado {1} -dup_resource_EXC_=IWAE0028E El recurso denominado "{0}" ya existe en el archivador "{1}" -error_saving_EXC_=IWAE0030E Error al guardar {0} -add_copy_class_dir_EXC_=IWAE0031E El m\u00e9todo "addCopyClass" no est\u00e1 soportado para directorios. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E El m\u00e9todo "addCopyLib" no est\u00e1 soportado para directorios. URI: {0} -list_components_war_EXC_=IWAE0033E Se ha producido una excepci\u00f3n al listar componentes del archivo WAR: {0} -open_nested_EXC_=IWAE0034E No se ha podido abrir el archivador anidado "{0}" en "{1}" -make_temp_file_WARN_=IWAE0035W Aviso: No se puede crear el archivo temporal para {0}. Esto afectar\u00e1 al rendimiento. -file_not_found_EXC_=IWAE0036E Nombre de URI: {0}; Nombre de archivo: {1} -could_not_open_EXC_=IWAE0037E No se ha podido abrir {0} -could_not_find_dir_EXC_=IWAE0038E No se puede abrir el directorio {0} -not_a_dir_EXC_=IWAE0039E No se puede abrir el directorio ya que el archivo no es un directorio: {0} -inferred_dds_EXC_=IWAE0040E Se ha inferido que el archivo JAR EJB "{0}" es de la versi\u00f3n 1.0 ya que el manifiesto no declara beans de empresa pero existen descriptores de despliegue serializados en el JAR. -filename_exception_EXC_=IWAE0041E Nombre de archivo: {0}; Excepci\u00f3n: {1} -no_dds_10_EXC_=IWAE0042E No hay descriptores de despliegue en el archivo JAR EJB 1.0: {0} -manifest_dd_load_EXC_=IWAE0043E El manifiesto de JAR declara un bean de empresa para el que el archivo de descriptor de despliegue no puede cargarse: {0} -manifest_dd_find_EXC_=IWAE0044E El manifiesto de JAR declara un bean de empresa para el que el archivo de descriptor de despliegue no puede encontrarse: {0} -io_ex_reading_dd_EXC_=IWAE0045E Se ha producido una excepci\u00f3n de E/S al leer {0} -ser_not_dd_EXC_=IWAE0046E El objeto serializado del archivo "{0}" no es una instancia de javax.ejb.deployment.DeploymentDescriptor -reading_dd_EXC_=IWAE0047E Se ha producido una excepci\u00f3n al leer {0} -missing_class_EXC_=IWAE0048E No se ha podido deserializar {0} ya que no se ha podido encontrar una clase necesaria. Excepci\u00f3n: {1} -Converted=Convertido -Stack_trace_of_nested_exce_EXC_=IWAE0049E Rastreo de pila de excepci\u00f3n anidada: -IOException_occurred_while_EXC_=IWAE0050E Se ha producido una excepci\u00f3n de E/S al copiar el manifiesto -Extract_destination_is_the_EXC_=IWAE0051E El destino de la extracci\u00f3n es la misma v\u00eda de acceso que el archivo fuente -Parameter_should_not_be_nu_EXC_=IWAE0052E El par\u00e1metro no debe ser nulo -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E El archivador no es un archivo JAR EJB (1.0) v\u00e1lido ya que no se han podido encontrar descriptores de despliegue serializados, ya sea en el manifiesto o en las entradas con una extensi\u00f3n ".ser" -_The_following_files_could_EXC_=IWAE0056E No se han podido cargar los siguientes archivos: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand ha fallado - rastreo de pila de excepci\u00f3n: -FixPrimKeyCommand_usage___=Uso de FixPrimKeyCommand: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E Uso de FixPrimKeyCommand: sourceJarFilePath debe apuntar a un archivo JAR EJB v\u00e1lido o a un directorio de un archivo JAR EJB inflado -Repair_command_failed_-_ex_EXC_=IWAE0059E El mandato de reparaci\u00f3n ha fallado - rastreo de pila de excepci\u00f3n: -Repairs_all_entries_in_the=Repara todas las entradas de los directorios META-INF y/o WEB-INF para que tengan las may\u00fasculas y min\u00fasculas correctas -RepairArchiveCommand_usage=Uso de RepairArchiveCommand: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E Uso de RepairArchiveCommand: sourceJarFilePath debe apuntar a un archivador v\u00e1lido o a un directorio de un archivador inflado -Application_Client_Jar_Fil=Archivo JAR de cliente de aplicaciones -EAR_File=Archivo EAR -EJB_Jar_File=Archivo JAR EJB -RAR_File=Archivo RAR -WAR_File=Archivo WAR -Error_occurred_iterating_f_EXC_=IWAE0061E Se ha producido un error al iterar archivos -End_of_list_reached_EXC_=IWAE0062E Se ha llegado al final de la lista -Internal_Error__Iterator_o_EXC_=IWAE0063E Error interno: El iterador est\u00e1 desincronizado con las entradas zip -Error_iterating_the_archiv_EXC_=IWAE0064E Error al iterar el archivador -Absolute_path_unknown_EXC_=IWAE0065E V\u00eda de acceso absoluta desconocida -Original_archive_is_not_a__EXC_=IWAE0066E El archivador original no es un directorio -Null_uri_EXC_=IWAE0067E Uri nulo -Module_file=Archivo de m\u00f3dulo -A_WAR_file=Archivo WAR -An_EJB_JAR_file=Archivo JAR EJB -An_Application_Client_JAR_file=Archivo JAR de cliente de aplicaciones -A_RAR_file=Archivo RAR -A_Application_file=Archivo de aplicaci\u00f3n -A_file_does_not_exist_for_module=No existe ning\u00fan archivo para el elemento del m\u00f3dulo que tiene el uri: {0} -File_not_correct_type=El archivo {0} del archivo EAR {1} no es el tipo correcto de acuerdo con el descriptor de despliegue de aplicaci\u00f3n. Tipo esperado: {2}"; -Module_not_in_EAR=El m\u00f3dulo no est\u00e1 en un EAR: {0} -Module_file_does_not_exist_2=El archivo de m\u00f3dulo no existe para la referencia del m\u00f3dulo. M\u00f3dulo = {0} -FileImpl._Error_0=La contenci\u00f3n recurrente no est\u00e1 permitida para diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_fr.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_fr.properties deleted file mode 100644 index 751fe1b2f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_fr.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} doit \u00eatre impl\u00e9ment\u00e9 dans la sous-classe -key_class_reflection_ERROR_=IWAE0002E Impossible de refl\u00e9ter la classe "{0}" pour comparer la zone de cl\u00e9 primaire "{1}" du bean entity "{2}" -key_field_reflection_ERROR_=IWAE0003E Impossible de refl\u00e9ter le type de la zone de cl\u00e9 primaire "{0}" du bean entity "{1}" -removing_key_field_INFO_=IWAE0004I Suppression de la zone de cl\u00e9 primaire non valide "{0}" du bean entity "{1}" -repair_usage_ERROR_=IWAE0005E Syntaxe de RepairArchiveCommand : impossible d''\u00e9crire dans le chemin de destination : {0} -invalid_archive_EXC_=IWAE0006E L''archive n''est pas un {0} valide car le descripteur de d\u00e9ploiement est introuvable (respect maj/min) : {1} -load_resource_EXC_=IWAE0007E Impossible de charger la ressource "{0}" dans l''archive "{1}" -nested_jar_EXC_=IWAE0008E Une erreur s''est produite lors de la lecture de {0} \u00e0 partir de {1} -make_temp_dir_EXC_=IWAE0009E Impossible de cr\u00e9er le r\u00e9pertoire temporaire : {0} -invalid_classpath_WARN_=IWAE0010W L''\u00e9l\u00e9ment "{0}" du chemin d''acc\u00e8s n''est pas un r\u00e9pertoire ou un fichier zip -invalid_cp_file_WARN_=IWAE0011W L''\u00e9l\u00e9ment "{0}" du chemin d''acc\u00e8s ne d\u00e9signe pas un fichier local -io_ex_loading_EXC_=IWAE0012E Une exception E-S s''est produite lors du chargement de {0} -tx_bean_mgd_WARN_=IWAE0013W Importation d''EJB 1.0 : pas de mappage du descripteur de contr\u00f4le TX_BEAN_MANAGED pour {0} -error_saving_EXC_=IWAE0014E Erreur de sauvegarde de {0} -io_ex_manifest_EXC_=IWAE0015E Une exception d''E-S s''est produite lors de la lecture du manifeste dans l''archive {0} -io_ex_reopen_EXC_=IWAE0016E Une exception d''E-S s''est produite lors de la r\u00e9ouverture de {0} -unable_replace_EXC_=IWAE0017E Impossible de remplacer l''archive d''origine {0} -duplicate_file_EXC_=IWAE0018E L''archive nomm\u00e9e {0} contient d\u00e9j\u00e0 un fichier nomm\u00e9 {1} -duplicate_entry_EXC_=IWAE0019E Un fichier ou une ressource avec l''uri {0} existe d\u00e9j\u00e0 dans l''archive nomm\u00e9e {1} -file_exist_as_dir_EXC_=IWAE0020E Un fichier nomm\u00e9 {0} existe et est un r\u00e9pertoire -uncontained_module_EXC_=IWAE0021E Le module {0} ne se trouve pas dans un fichier EAR -dd_in_ear_load_EXC_=IWAE0022E Une exception s''est produite lors du chargement du descripteur de d\u00e9ploiement du module "{0}" dans le fichier EAR "{1}" -nested_open_fail_EXC_=IWAE0023E Impossible d''ouvrir le fichier de module "{0}" dans le fichier EAR "{1}" -duplicate_module_EXC_=IWAE0024E Le descripteur de d\u00e9ploiement du fichier EAR "{0}" contient d\u00e9j\u00e0 un module dont l''uri est "{1}" -no_sec_role_EXC_=IWAE0025E {0} : le descripteur de d\u00e9ploiement du fichier EAR ne contient pas de r\u00f4le de s\u00e9curit\u00e9 nomm\u00e9 {1} -dup_sec_role_EXC_=IWAE0026E {0} : le descripteur de d\u00e9ploiement du fichier EAR contient d\u00e9j\u00e0 un r\u00f4le de s\u00e9curit\u00e9 nomm\u00e9 {1} -dup_sec_role_module_EXC_=IWAE0027E Le descripteur de d\u00e9ploiement de {0} contient d\u00e9j\u00e0 un r\u00f4le de s\u00e9curit\u00e9 nomm\u00e9 {1} -dup_resource_EXC_=IWAE0028E La ressource nomm\u00e9e "{0}" existe d\u00e9j\u00e0 dans l''archive "{1}" -error_saving_EXC_=IWAE0030E Erreur de sauvegarde de {0} -add_copy_class_dir_EXC_=IWAE0031E La m\u00e9thode addCopyClass n''est pas prise en charge pour les r\u00e9pertoires. URI : {0} -add_copy_lib_dir_EXC_=IWAE0032E La m\u00e9thode addCopyLib n''est pas prise en charge pour les r\u00e9pertoires. URI : {0} -list_components_war_EXC_=IWAE0033E Une exception s''est produite lors du listage des composants dans le fichier WAR : {0} -open_nested_EXC_=IWAE0034E Impossible d''ouvrir l''archive imbriqu\u00e9e "{0}" dans "{1}" -make_temp_file_WARN_=IWAE0035W Avertissement : impossible de cr\u00e9er un fichier temporaire pour {0}. Cela aura un impact sur les performances. -file_not_found_EXC_=IWAE0036E Nom de l''URI : {0} ; nom du fichier : {1} -could_not_open_EXC_=IWAE0037E Impossible d''ouvrir {0} -could_not_find_dir_EXC_=IWAE0038E Impossible d''ouvrir le r\u00e9pertoire {0} -not_a_dir_EXC_=IWAE0039E Impossible d''ouvrir le r\u00e9pertoire car le fichier {0} n''est pas un r\u00e9pertoire -inferred_dds_EXC_=IWAE0040E Le fichier JAR d''EJB "{0}" est consid\u00e9r\u00e9 de version 1.0 car le manifeste ne d\u00e9clare pas les beans enterprise, mais il existe des descripteurs de d\u00e9ploiement dans ce fichier. -filename_exception_EXC_=IWAE0041E Nom du fichier : {0} ; exception : {1} -no_dds_10_EXC_=IWAE0042E Aucun descripteur de d\u00e9ploiement dans le fichier JAR d''EJB 1.0 : {0} -manifest_dd_load_EXC_=IWAE0043E Le manifeste JAR d\u00e9clare un bean enterprise pour lequel un fichier de descripteur de d\u00e9ploiement ne peut pas \u00eatre charg\u00e9 : {0} -manifest_dd_find_EXC_=IWAE0044E Le manifeste JAR d\u00e9clare un bean enterprise pour lequel le fichier de descripteur de d\u00e9ploiement est introuvable : {0} -io_ex_reading_dd_EXC_=IWAE0045E Une exception d''E-S s''est produite lors de la lecture de {0} -ser_not_dd_EXC_=IWAE0046E L''objet s\u00e9rialis\u00e9 dans le fichier "{0}" n''est pas une instance de javax.ejb.deployment.DeploymentDescriptor -reading_dd_EXC_=IWAE0047E Une exception s''est produite lors de la lecture de {0} -missing_class_EXC_=IWAE0048E Impossible de d\u00e9s\u00e9rialiser {0} car une classe requise est introuvable. Exception : {1} -Converted=Converti -Stack_trace_of_nested_exce_EXC_=IWAE0049E Trace de pile de l'exception imbriqu\u00e9e : -IOException_occurred_while_EXC_=IWAE0050E Une exception d'E-S s'est produite lors de la copie du manifeste -Extract_destination_is_the_EXC_=IWAE0051E La destination d'extraction est identique au fichier source -Parameter_should_not_be_nu_EXC_=IWAE0052E Le param\u00e8tre ne doit pas \u00eatre null -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E L'archive n'est pas un fichier JAR d'EJB (1.0) valide car aucun descripteur de d\u00e9ploiement ne peut \u00eatre trouv\u00e9 soit dans le manifeste, soit dans les entr\u00e9es poss\u00e9dant l'extension ".ser" -_The_following_files_could_EXC_=IWAE0056E les fichiers suivants ne peuvent pas \u00eatre charg\u00e9s : -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E Echec de FixPrimKeyCommand ; trace de pile de l'exception : -FixPrimKeyCommand_usage___=Syntaxe de FixPrimKeyCommand : <cheminFichierJarSource> [cheminDestination] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E Syntaxe de FixPrimKeyCommand : sourceJarFilePath doit d\u00e9signer un fichier JAR d'EJB valide ou un r\u00e9pertoire contenant un fichier JAR d'EJB d\u00e9compress\u00e9 -Repair_command_failed_-_ex_EXC_=IWAE0059E Echec de la commande de r\u00e9paration ; trace de pile de l'exception : -Repairs_all_entries_in_the=R\u00e9pare toutes les entr\u00e9es dans les r\u00e9pertoires META-INF et/ou WEB-INF afin de leur redonner la combinaison majuscules/minuscules correcte -RepairArchiveCommand_usage=Syntaxe de RepairArchiveCommand : <cheminFichierJarSource> <cheminDestination> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E Syntaxe de RepairArchiveCommand : sourceJarFilePath doit d\u00e9signer une archive valide ou un r\u00e9pertoire contenant une archive d\u00e9compress\u00e9e -Application_Client_Jar_Fil=Fichier JAR de client d'application -EAR_File=Fichier EAR -EJB_Jar_File=Fichier JAR d'EJB -RAR_File=Fichier RAR -WAR_File=Fichier WAR -Error_occurred_iterating_f_EXC_=IWAE0061E Une erreur est survenue lors de l'it\u00e9ration des fichiers -End_of_list_reached_EXC_=IWAE0062E Fin de liste atteinte -Internal_Error__Iterator_o_EXC_=IWAE0063E Erreur interne : it\u00e9rateur d\u00e9synchronis\u00e9 par rapport aux entr\u00e9es des fichiers zip -Error_iterating_the_archiv_EXC_=IWAE0064E Erreur lors de l'it\u00e9ration de l'archive -Absolute_path_unknown_EXC_=IWAE0065E Chemin absolu inconnu -Original_archive_is_not_a__EXC_=IWAE0066E L'archive d'origine n'est pas un r\u00e9pertoire -Null_uri_EXC_=IWAE0067E Uri ind\u00e9finie -Module_file=Fichier du module -A_WAR_file=Fichier WAR -An_EJB_JAR_file=Fichier JAR d'EJB -An_Application_Client_JAR_file=Fichier JAR de client d'application -A_RAR_file=Fichier RAR -A_Application_file=Fichier d'application -A_file_does_not_exist_for_module=Aucun fichier n''existe pour l''\u00e9l\u00e9ment de module dont l''URI est : {0} -File_not_correct_type=Le fichier {0} du fichier EAR {1} n''est pas de type correct par rapport au descripteur de d\u00e9ploiement de l''application. Type attendu : {2}" ; -Module_not_in_EAR=Le module ne se trouve pas dans un fichier EAR : {0} -Module_file_does_not_exist_2=Le fichier de module n''existe pas pour la r\u00e9f\u00e9rence de module. Module = {0} -FileImpl._Error_0=Confinement r\u00e9cursif non autoris\u00e9 pour diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_it.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_it.properties deleted file mode 100644 index 4d43efc6a..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_it.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} deve essere implementato nella sottoclasse -key_class_reflection_ERROR_=IWAE0002E Impossibile selezionare la classe "{0}" per confrontare il campo della chiave primaria "{1}" dell''entit\u00e0 "{2}" -key_field_reflection_ERROR_=IWAE0003E Impossibile selezionare il tipo di campo della chiave primaria "{0}" dall''entit\u00e0 "{1}" -removing_key_field_INFO_=IWAE0004I Rimozione del campo di chiave primaria "{0}" non valido dall''entit\u00e0 "{1}" -repair_usage_ERROR_=IWAE0005E Utilizzo di RepairArchiveCommand: impossibile scrivere in destinationPath: {0} -invalid_archive_EXC_=IWAE0006E L''archivio non \u00e8 un {0} valido. Impossibile trovare il descrittore di distribuzione (distinzione maiuscole/minuscole): {1} -load_resource_EXC_=IWAE0007E Impossibile caricare la risorsa "{0}" nell''archivio "{1}" -nested_jar_EXC_=IWAE0008E Errore durante la lettura di {0} da {1} -make_temp_dir_EXC_=IWAE0009E Impossibile creare la directory temporanea: {0} -invalid_classpath_WARN_=IWAE0010W L''elemento classpath "{0}" non \u00e8 una directory o un file Zip -invalid_cp_file_WARN_=IWAE0011W L''elemento classpath "{0}" non punta a un file locale -io_ex_loading_EXC_=IWAE0012E Si \u00e8 verificata un''eccezione IO durante il caricamento di {0} -tx_bean_mgd_WARN_=IWAE0013W Importazione EJB 1.0: l'associazione del descrittore di controllo TX_BEAN_MANAGED per {0} non verr\u00e0 eseguita -error_saving_EXC_=IWAE0014E Errore durante il salvataggio di {0} -io_ex_manifest_EXC_=IWAE0015E Si \u00e8 verificata un''eccezione IO nella lettura del manifest nell''archivio: {0} -io_ex_reopen_EXC_=IWAE0016E Si \u00e8 verificata un''eccezione IO durante la riapertura di {0} -unable_replace_EXC_=IWAE0017E Impossibile sostituire l''archivio originale: {0} -duplicate_file_EXC_=IWAE0018E L''archivio {0} contiene gi\u00e0 un file denominato {1} -duplicate_entry_EXC_=IWAE0019E Un file o una risorsa con l''uri {0} esiste gi\u00e0 nell''archivio {1} -file_exist_as_dir_EXC_=IWAE0020E Un file denominato {0} esiste gi\u00e0 ed \u00e8 una directory -uncontained_module_EXC_=IWAE0021E Il modulo {0} non \u00e8 incluso in un file EAR -dd_in_ear_load_EXC_=IWAE0022E Eccezione durante il caricamento del descrittore di distribuzione per il modulo "{0}" nel file EAR "{1}" -nested_open_fail_EXC_=IWAE0023E Impossibile aprire il file "{0}" del modulo nel file EAR "{1}" -duplicate_module_EXC_=IWAE0024E Il descrittore di distribuzione per il file EAR "{0}" contiene gi\u00e0 un modulo con l''uri "{1}" -no_sec_role_EXC_=IWAE0025E {0}: il descrittore di distribuzione del file EAR non contiene un ruolo di protezione denominato {1} -dup_sec_role_EXC_=IWAE0026E {0}: il descrittore di distribuzione del file EAR contiene gi\u00e0 un ruolo di protezione denominato {1} -dup_sec_role_module_EXC_=IWAE0027E Il descrittore di distribuzione per {0} contiene gi\u00e0 un ruolo di protezione {1} -dup_resource_EXC_=IWAE0028E La risorsa "{0}" esiste gi\u00e0 nell''archivio "{1}" -error_saving_EXC_=IWAE0030E Errore durante il salvataggio di {0} -add_copy_class_dir_EXC_=IWAE0031E Il metodo "addCopyClass" non \u00e8 supportato per le directory. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E Il metodo "addCopyLib" non \u00e8 supportato per le directory. URI: {0} -list_components_war_EXC_=IWAE0033E Eccezione durante l''elencazione dei componenti nel file WAR: {0} -open_nested_EXC_=IWAE0034E Impossibile aprire l''archivio nidificato "{0}" in "{1}" -make_temp_file_WARN_=IWAE0035W Avviso: impossibile creare il file temporaneo per {0}. Ci\u00f2 incider\u00e0 sulle prestazioni. -file_not_found_EXC_=IWAE0036E Nome URI: {0}; nome file: {1} -could_not_open_EXC_=IWAE0037E Impossibile aprire {0} -could_not_find_dir_EXC_=IWAE0038E Impossibile aprire la directory {0} -not_a_dir_EXC_=IWAE0039E Impossibile aprire la directory, il file non \u00e8 una directory: {0} -inferred_dds_EXC_=IWAE0040E Il file JAR EJB "{0}" sembra essere in versione 1.0 poich\u00e9 il manifest non dichiara bean enterprise, ma esistono descrittori di distribuzione serializzati nel file JAR. -filename_exception_EXC_=IWAJ0052E Nome file: {0}; eccezione: {1} -no_dds_10_EXC_=IWAE0042E Non esiste alcun descrittore di distribuzione nel file JAR EJB 1.0: {0} -manifest_dd_load_EXC_=IWAE0043E Il manifest JAR dichiara un bean enterprise per il quale non \u00e8 possibile caricare il file del descrittore di distribuzione: {0} -manifest_dd_find_EXC_=IWAE0044E Il manifest JAR dichiara un bean enterprise per il quale non \u00e8 possibile trovare il file del descrittore di distribuzione: {0} -io_ex_reading_dd_EXC_=IWAE0045E Eccezione IO durante la lettura di {0} -ser_not_dd_EXC_=IWAE0046E L''oggetto serializzato nel file "{0}" non \u00e8 un''istanza di javax.ejb.deployment.DeploymentDescriptor -reading_dd_EXC_=IWAE0047E Eccezione durante la lettura di {0} -missing_class_EXC_=IWAE0048E Impossibile deserializzare {0}. Non \u00e8 stato possibile trovare una classe richiesta. Eccezione: {1} -Converted=Convertito -Stack_trace_of_nested_exce_EXC_=IWAE0049E Traccia nello stack dell'eccezione nidificata: -IOException_occurred_while_EXC_=IWAE0050E Eccezione IO durante la copia del manifest -Extract_destination_is_the_EXC_=IWAE0051E La destinazione di estrazione coincide con il percorso del file di origine -Parameter_should_not_be_nu_EXC_=IWAE0052E Il parametro non deve essere Null -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E L'archivio non \u00e8 un file JAR EJB (1.0) valido. Non \u00e8 stato possibile trovare alcun descrittore di distribuzione nel manifest o nelle voci con estensione ".ser" -_The_following_files_could_EXC_=IWAE0056E Impossibile caricare i seguenti file: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand non riuscito. Traccia nello stack per l'eccezione: -FixPrimKeyCommand_usage___=Utilizzo di FixPrimKeyCommand: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E Utilizzo di FixPrimKeyCommand: sourceJarFilePath deve puntare a una directory o a un file JAR EJB valido di un file JAP EJB decompresso -Repair_command_failed_-_ex_EXC_=IWAE0059E Comando Repair non riuscito. Traccia nello stack per l'eccezione: -Repairs_all_entries_in_the=Corregge tutte le voci nelle directory META-INF e/o WEB-INF con le lettere maiuscole/minuscole appropriate -RepairArchiveCommand_usage=Utilizzo di RepairArchiveCommand: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E Utilizzo di RepairArchiveCommand: sourceJarFilePath deve puntare a un archivio o a una directory valida di un archivio decompresso -Application_Client_Jar_Fil=File JAR del client di applicazioni -EAR_File=File EAR -EJB_Jar_File=File JAR EJB -RAR_File=File RAR -WAR_File=File WAR -Error_occurred_iterating_f_EXC_=IWAE0061E Errore durante l'iterazione nei file -End_of_list_reached_EXC_=IWAE0062E Raggiunta la fine dell'elenco -Internal_Error__Iterator_o_EXC_=IWAE0063E Errore interno: iteratore non sincronizzato con le voci nel file zip -Error_iterating_the_archiv_EXC_=IWAE0064E Errore durante l'iterazione nell'archivio -Absolute_path_unknown_EXC_=IWAE0065E Percorso assoluto sconosciuto -Original_archive_is_not_a__EXC_=IWAE0066E L'archivio originale non \u00e8 una directory -Null_uri_EXC_=IWAE0067E URI null -Module_file=File di modulo -A_WAR_file=File WAR -An_EJB_JAR_file=File JAR EJB -An_Application_Client_JAR_file=File JAR del client di applicazioni -A_RAR_file=File RAR -A_Application_file=File di applicazioni -A_file_does_not_exist_for_module=Non esiste un file per l'elemento del modulo con l'uri: {0} -File_not_correct_type=Il file {0} nel file EAR {1} non \u00e8 di tipo corretto in base al descrittore di distribuzione dell''applicazione. Tipo previsto: {2}"; -Module_not_in_EAR=Il modulo non si trova in un EAR: {0} -Module_file_does_not_exist_2=Il file di modulo non esiste per il riferimento al modulo. Modulo = {0} -FileImpl._Error_0=Contenuto ricorsivo non consentito per diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ja.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ja.properties deleted file mode 100644 index 5f025a53a..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ja.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} \u306f\u30b5\u30d6\u30af\u30e9\u30b9\u3067\u30a4\u30f3\u30d7\u30ea\u30e1\u30f3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059 -key_class_reflection_ERROR_=IWAE0002E \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30fc "{2}" \u304b\u3089\u306e\u4e3b\u30ad\u30fc\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9 "{1}" \u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b\u30af\u30e9\u30b9 "{0}" \u3092\u53cd\u6620\u3067\u304d\u307e\u305b\u3093 -key_field_reflection_ERROR_=IWAE0003E \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30fc "{1}" \u304b\u3089\u306e\u4e3b\u30ad\u30fc\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9 "{0}" \u306e\u30bf\u30a4\u30d7\u3092\u53cd\u6620\u3067\u304d\u307e\u305b\u3093 -removing_key_field_INFO_=IWAE0004I \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30fc "{1}" \u304b\u3089\u7121\u52b9\u306a\u4e3b\u30ad\u30fc\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9 "{0}" \u3092\u9664\u53bb\u4e2d -repair_usage_ERROR_=IWAE0005E RepairArchiveCommand \u306e\u4f7f\u7528\u6cd5: destinationPath {0} \u306b\u66f8\u304d\u8fbc\u3081\u307e\u305b\u3093 -invalid_archive_EXC_=IWAE0006E \u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50 {1} \u304c\u898b\u3064\u304b\u3089\u306a\u3044\u305f\u3081 (\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225)\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u306f\u6709\u52b9\u306a {0} \u3067\u306f\u3042\u308a\u307e\u305b\u3093 -load_resource_EXC_=IWAE0007E \u30a2\u30fc\u30ab\u30a4\u30d6 "{1}" \u3067\u30ea\u30bd\u30fc\u30b9 "{0}" \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f -nested_jar_EXC_=IWAE0008E {1} \u304b\u3089 {0} \u3092\u8aad\u307f\u53d6\u308a\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -make_temp_dir_EXC_=IWAE0009E \u4e00\u6642\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc {0} \u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093 -invalid_classpath_WARN_=IWAE0010W \u30af\u30e9\u30b9\u30d1\u30b9\u30fb\u30a8\u30ec\u30e1\u30f3\u30c8 "{0}" \u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u307e\u305f\u306f Zip \u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3042\u308a\u307e\u305b\u3093 -invalid_cp_file_WARN_=IWAE0011W \u30af\u30e9\u30b9\u30d1\u30b9\u30fb\u30a8\u30ec\u30e1\u30f3\u30c8 "{0}" \u306f\u30ed\u30fc\u30ab\u30eb\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u3057\u3066\u3044\u307e\u305b\u3093 -io_ex_loading_EXC_=IWAE0012E {0} \u3092\u30ed\u30fc\u30c9\u4e2d\u306b I/O \u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -tx_bean_mgd_WARN_=IWAE0013W EJB 1.0 \u30a4\u30f3\u30dd\u30fc\u30c8: {0} \u7528\u306e TX_BEAN_MANAGED \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u8a18\u8ff0\u5b50\u3092\u30de\u30c3\u30d7\u3057\u3066\u3044\u307e\u305b\u3093 -error_saving_EXC_=IWAE0014E {0} \u3092\u4fdd\u7ba1\u4e2d\u306e\u30a8\u30e9\u30fc -io_ex_manifest_EXC_=IWAE0015E \u30a2\u30fc\u30ab\u30a4\u30d6\u5185\u306e\u30de\u30cb\u30d5\u30a7\u30b9\u30c8 {0} \u3092\u8aad\u307f\u53d6\u308a\u4e2d\u306b I/O \u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -io_ex_reopen_EXC_=IWAE0016E {0} \u3092\u518d\u30aa\u30fc\u30d7\u30f3\u4e2d\u306b I/O \u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -unable_replace_EXC_=IWAE0017E \u30aa\u30ea\u30b8\u30ca\u30eb\u30fb\u30a2\u30fc\u30ab\u30a4\u30d6 {0} \u3092\u7f6e\u63db\u3067\u304d\u307e\u305b\u3093 -duplicate_file_EXC_=IWAE0018E {0} \u3068\u3044\u3046\u540d\u524d\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u306b\u306f\u3059\u3067\u306b\u3001{1} \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059 -duplicate_entry_EXC_=IWAE0019E uri {0} \u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306f\u30ea\u30bd\u30fc\u30b9\u306f\u3059\u3067\u306b\u3001{1} \u3068\u3044\u3046\u540d\u524d\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059 -file_exist_as_dir_EXC_=IWAE0020E {0} \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u3066\u304a\u308a\u3001\u3053\u308c\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3067\u3059 -uncontained_module_EXC_=IWAE0021E \u30e2\u30b8\u30e5\u30fc\u30eb {0} \u306f EAR \u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093 -dd_in_ear_load_EXC_=IWAE0022E EAR \u30d5\u30a1\u30a4\u30eb "{1}" \u5185\u306e\u30e2\u30b8\u30e5\u30fc\u30eb "{0}" \u7528\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u3092\u30ed\u30fc\u30c9\u4e2d\u306b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -nested_open_fail_EXC_=IWAE0023E EAR \u30d5\u30a1\u30a4\u30eb "{1}" \u5185\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30fb\u30d5\u30a1\u30a4\u30eb "{0}" \u3092\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093 -duplicate_module_EXC_=IWAE0024E EAR \u30d5\u30a1\u30a4\u30eb "{0}" \u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u306b\u306f\u3059\u3067\u306b\u3001uri "{1}" \u3092\u6301\u3064\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059 -no_sec_role_EXC_=IWAE0025E {0}: EAR \u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u306b\u3001{1} \u3068\u3044\u3046\u540d\u524d\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fc\u5f79\u5272\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093 -dup_sec_role_EXC_=IWAE0026E {0}: EAR \u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u306b\u306f\u3059\u3067\u306b\u3001{1} \u3068\u3044\u3046\u540d\u524d\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fc\u5f79\u5272\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059 -dup_sec_role_module_EXC_=IWAE0027E {0} \u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u306b\u306f\u3059\u3067\u306b\u3001{1} \u3068\u3044\u3046\u540d\u524d\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fc\u5f79\u5272\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059 -dup_resource_EXC_=IWAE0028E "{0}" \u3068\u3044\u3046\u540d\u524d\u306e\u30ea\u30bd\u30fc\u30b9\u306f\u3059\u3067\u306b\u30a2\u30fc\u30ab\u30a4\u30d6 "{1}" \u5185\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059 -error_saving_EXC_=IWAE0030E {0} \u3092\u4fdd\u7ba1\u4e2d\u306e\u30a8\u30e9\u30fc -add_copy_class_dir_EXC_=IWAE0031E \u30e1\u30bd\u30c3\u30c9 "addCopyClass" \u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u5bfe\u3057\u3066\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E \u30e1\u30bd\u30c3\u30c9 "addCopyLib" \u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u5bfe\u3057\u3066\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 URI: {0} -list_components_war_EXC_=IWAE0033E WAR \u30d5\u30a1\u30a4\u30eb {0} \u5185\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u30ea\u30b9\u30c8\u4e2d\u306b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -open_nested_EXC_=IWAE0034E "{1}" \u5185\u306e\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30a2\u30fc\u30ab\u30a4\u30d6 "{0}" \u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f -make_temp_file_WARN_=IWAE0035W \u8b66\u544a: {0} \u306e\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002 \u3053\u308c\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3057\u307e\u3059\u3002 -file_not_found_EXC_=IWAE0036E URI \u540d: {0}\u3001\u30d5\u30a1\u30a4\u30eb\u540d: {1} -could_not_open_EXC_=IWAE0037E {0} \u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f -could_not_find_dir_EXC_=IWAE0038E \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc {0} \u3092\u958b\u3051\u307e\u305b\u3093 -not_a_dir_EXC_=IWAE0039E \u30d5\u30a1\u30a4\u30eb {0} \u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3092\u958b\u3051\u307e\u305b\u3093 -inferred_dds_EXC_=IWAE0040E \u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306f\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba Bean \u3092\u5ba3\u8a00\u3057\u3066\u3044\u306a\u3044\u304c\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u304c JAR \u5185\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001EJB JAR \u30d5\u30a1\u30a4\u30eb "{0}" \u306f\u30d0\u30fc\u30b8\u30e7\u30f3 1.0 \u3067\u3042\u308b\u3068\u63a8\u6e2c\u3055\u308c\u307e\u3057\u305f\u3002 -filename_exception_EXC_=IWAE0041E \u30d5\u30a1\u30a4\u30eb\u540d: {0}\u3001\u4f8b\u5916: {1} -no_dds_10_EXC_=IWAE0042E EJB 1.0 Jar \u30d5\u30a1\u30a4\u30eb {0} \u5185\u306b\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u304c\u3042\u308a\u307e\u305b\u3093 -manifest_dd_load_EXC_=IWAE0043E JAR \u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306f\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u3092\u30ed\u30fc\u30c9\u3067\u304d\u306a\u3044\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba Bean \u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059: {0} -manifest_dd_find_EXC_=IWAE0044E JAR \u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306f\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba Bean \u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059: {0} -io_ex_reading_dd_EXC_=IWAE0045E {0} \u3092\u8aad\u307f\u53d6\u308a\u4e2d\u306b I/O \u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -ser_not_dd_EXC_=IWAE0046E \u30d5\u30a1\u30a4\u30eb "{0}" \u5185\u306e\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u5316\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001javax.ejb.deployment.DeploymentDescriptor \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093 -reading_dd_EXC_=IWAE0047E {0} \u3092\u8aad\u307f\u53d6\u308a\u4e2d\u306b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -missing_class_EXC_=IWAE0048E \u5fc5\u8981\u306a\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u305f\u3081\u3001{0} \u3092\u30c7\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u4f8b\u5916: {1} -Converted=\u5909\u63db\u6e08\u307f -Stack_trace_of_nested_exce_EXC_=IWAE0049E \u30cd\u30b9\u30c8\u3055\u308c\u305f\u4f8b\u5916\u306e\u30b9\u30bf\u30c3\u30af\u30fb\u30c8\u30ec\u30fc\u30b9: -IOException_occurred_while_EXC_=IWAE0050E \u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092\u30b3\u30d4\u30fc\u4e2d\u306b I/O \u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f -Extract_destination_is_the_EXC_=IWAE0051E \u62bd\u51fa\u3055\u308c\u305f\u5b9b\u5148\u306f\u30bd\u30fc\u30b9\u30fb\u30d5\u30a1\u30a4\u30eb\u3068\u540c\u3058\u30d1\u30b9\u3067\u3059 -Parameter_should_not_be_nu_EXC_=IWAE0052E \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092 NULL \u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093 -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E \u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3067\u3082\u3001".ser" \u62e1\u5f35\u5b50\u3092\u6301\u3064\u9805\u76ee\u3067\u3082\u3001\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u5316\u3055\u308c\u305f\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u306f\u6709\u52b9\u306a EJB JAR \u30d5\u30a1\u30a4\u30eb (1.0) \u3067\u306f\u3042\u308a\u307e\u305b\u3093 -_The_following_files_could_EXC_=IWAE0056E \u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand \u304c\u5931\u6557\u3057\u307e\u3057\u305f - \u4f8b\u5916\u30b9\u30bf\u30c3\u30af\u30fb\u30c8\u30ec\u30fc\u30b9: -FixPrimKeyCommand_usage___=FixPrimKeyCommand \u306e\u4f7f\u7528\u6cd5: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E FixPrimKeyCommand \u306e\u4f7f\u7528\u6cd5: sourceJarFilePath \u306f\u3001\u6709\u52b9\u306a EJB JAR \u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306f\u5145\u6e80\u3057\u305f EJB JAR \u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3092\u6307\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -Repair_command_failed_-_ex_EXC_=IWAE0059E \u4fee\u5fa9\u30b3\u30de\u30f3\u30c9\u304c\u5931\u6557\u3057\u307e\u3057\u305f - \u4f8b\u5916\u30b9\u30bf\u30c3\u30af\u30fb\u30c8\u30ec\u30fc\u30b9: -Repairs_all_entries_in_the=META-INF \u307e\u305f\u306f WEB-INF \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc (\u3042\u308b\u3044\u306f\u305d\u306e\u4e21\u65b9) \u5185\u306e\u3059\u3079\u3066\u306e\u9805\u76ee\u306e\u5927/\u5c0f\u6587\u5b57\u304c\u6b63\u3057\u304f\u306a\u308b\u3088\u3046\u306b\u4fee\u5fa9\u3057\u307e\u3059 -RepairArchiveCommand_usage=RepairArchiveCommand \u306e\u4f7f\u7528\u6cd5: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E RepairArchiveCommand \u306e\u4f7f\u7528\u6cd5: sourceJarFilePath \u306f\u3001\u6709\u52b9\u306a\u30a2\u30fc\u30ab\u30a4\u30d6\u307e\u305f\u306f\u81a8\u5f35\u3057\u305f\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3092\u6307\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -Application_Client_Jar_Fil=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 Jar \u30d5\u30a1\u30a4\u30eb -EAR_File=EAR \u30d5\u30a1\u30a4\u30eb -EJB_Jar_File=EJB JAR \u30d5\u30a1\u30a4\u30eb -RAR_File=RAR \u30d5\u30a1\u30a4\u30eb -WAR_File=WAR \u30d5\u30a1\u30a4\u30eb -Error_occurred_iterating_f_EXC_=IWAE0061E \u30d5\u30a1\u30a4\u30eb\u3092\u53cd\u5fa9\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -End_of_list_reached_EXC_=IWAE0062E \u30ea\u30b9\u30c8\u306e\u7d42\u308f\u308a\u306b\u9054\u3057\u307e\u3057\u305f -Internal_Error__Iterator_o_EXC_=IWAE0063E \u5185\u90e8\u30a8\u30e9\u30fc: \u30a4\u30c6\u30ec\u30fc\u30bf\u30fc\u304c ZIP \u9805\u76ee\u3068\u975e\u540c\u671f\u3067\u3059 -Error_iterating_the_archiv_EXC_=IWAE0064E \u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u53cd\u5fa9\u4e2d\u306e\u30a8\u30e9\u30fc -Absolute_path_unknown_EXC_=IWAE0065E \u4e0d\u660e\u306a\u7d76\u5bfe\u30d1\u30b9 -Original_archive_is_not_a__EXC_=IWAE0066E \u30aa\u30ea\u30b8\u30ca\u30eb\u30fb\u30a2\u30fc\u30ab\u30a4\u30d6\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3067\u306f\u3042\u308a\u307e\u305b\u3093 -Null_uri_EXC_=IWAE0067E NULL \u306e uri -Module_file=\u30e2\u30b8\u30e5\u30fc\u30eb\u30fb\u30d5\u30a1\u30a4\u30eb -A_WAR_file=WAR \u30d5\u30a1\u30a4\u30eb -An_EJB_JAR_file=EJB JAR \u30d5\u30a1\u30a4\u30eb -An_Application_Client_JAR_file=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 JAR \u30d5\u30a1\u30a4\u30eb -A_RAR_file=RAR \u30d5\u30a1\u30a4\u30eb -A_Application_file=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb -A_file_does_not_exist_for_module=uri {0} \u3092\u6301\u3064\u30e2\u30b8\u30e5\u30fc\u30eb\u30fb\u30a8\u30ec\u30e1\u30f3\u30c8\u306b\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u307e\u305b\u3093 -File_not_correct_type=EAR \u30d5\u30a1\u30a4\u30eb {1} \u5185\u306e\u30d5\u30a1\u30a4\u30eb {0} \u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u8a18\u8ff0\u5b50\u306b\u57fa\u3065\u3044\u305f\u6b63\u3057\u3044\u578b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4e88\u671f\u3055\u308c\u308b\u578b: {2} -Module_not_in_EAR=\u30e2\u30b8\u30e5\u30fc\u30eb\u306f EAR {0} \u5185\u306b\u3042\u308a\u307e\u305b\u3093 -Module_file_does_not_exist_2=\u30e2\u30b8\u30e5\u30fc\u30eb\u53c2\u7167\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u30fb\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002 \u30e2\u30b8\u30e5\u30fc\u30eb = {0} -FileImpl._Error_0=\u518d\u5e30\u7684\u5305\u542b\u306f\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093 diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ko.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ko.properties deleted file mode 100644 index 724c248c2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_ko.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0}\uc744(\ub97c) \uc11c\ube0c\ud074\ub798\uc2a4\uc5d0 \uad6c\ud604\ud574\uc57c \ud569\ub2c8\ub2e4. -key_class_reflection_ERROR_=IWAE0002E "{2}" \uc5d4\ud2f0\ud2f0\uc5d0\uc11c "{1}" 1\ucc28 \ud0a4 \ud544\ub4dc\ub97c \ube44\uad50\ud558\uae30 \uc704\ud574 "{0}" \ud074\ub798\uc2a4\ub97c \ubc18\uc601\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -key_field_reflection_ERROR_=IWAE0003E "{1}" \uc5d4\ud2f0\ud2f0\uc5d0\uc11c "{0}" 1\ucc28 \ud0a4 \ud544\ub4dc\uc758 \uc720\ud615\uc744 \ubc18\uc601\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -removing_key_field_INFO_=IWAE0004I "{1}" \uc5d4\ud2f0\ud2f0\uc5d0\uc11c \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 "{0}" 1\ucc28 \ud0a4 \ud544\ub4dc \uc81c\uac70 \uc911 -repair_usage_ERROR_=IWAE0005E RepairArchiveCommand \uc0ac\uc6a9\ubc95: destinationPath\uc5d0 \uc4f8 \uc218 \uc5c6\uc74c: {0} -invalid_archive_EXC_=IWAE0006E {1} \uc804\uac1c \uc124\uba85\uc790\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc73c\ubbc0\ub85c \uc544\uce74\uc774\ube0c\uac00 \uc62c\ubc14\ub978 {0}\uc774(\uac00) \uc544\ub2d9\ub2c8\ub2e4(\ub300\uc18c\ubb38\uc790 \uad6c\ubd84). -load_resource_EXC_=IWAE0007E "{1}" \uc544\uce74\uc774\ube0c\uc5d0\uc11c "{0}" \uc790\uc6d0\uc744 \ub85c\ub4dc\ud560 \uc218 \uc5c6\uc5c8\uc74c -nested_jar_EXC_=IWAE0008E {1}\uc5d0\uc11c {0}\uc744(\ub97c) \uc77d\ub294 \uc911\uc5d0 \uc624\ub958 \ubc1c\uc0dd -make_temp_dir_EXC_=IWAE0009E \uc784\uc2dc \ub514\ub809\ud1a0\ub9ac\ub97c \ub9cc\ub4e4 \uc218 \uc5c6\uc74c: {0} -invalid_classpath_WARN_=IWAE0010W "{0}" \ud074\ub798\uc2a4 \uacbd\ub85c \uc694\uc18c\uac00 \ub514\ub809\ud1a0\ub9ac\ub098 Zip \ud30c\uc77c\uc774 \uc544\ub2d8 -invalid_cp_file_WARN_=IWAE0011W "{0}" \ud074\ub798\uc2a4 \uacbd\ub85c \uc694\uc18c\uac00 \ub85c\uceec \ud30c\uc77c\uc744 \uac00\ub9ac\ud0a4\uc9c0 \uc54a\uc74c -io_ex_loading_EXC_=IWAE0012E {0}\uc744(\ub97c) \ub85c\ub4dc\ud558\ub294 \uc911\uc5d0 IO \uc608\uc678 \ubc1c\uc0dd -tx_bean_mgd_WARN_=IWAE0013W EJB 1.0 \uac00\uc838\uc624\uae30: {0}\uc5d0 \ub300\ud574 TX_BEAN_MANAGED \uc81c\uc5b4 \uc124\uba85\uc790\ub97c \ub9f5\ud558\uc9c0 \uc54a\uc74c -error_saving_EXC_=IWAE0014E {0} \uc800\uc7a5 \uc911\uc5d0 \uc624\ub958 \ubc1c\uc0dd -io_ex_manifest_EXC_=IWAE0015E \uc544\uce74\uc774\ube0c\uc5d0\uc11c Manifest\ub97c \uc77d\ub294 \uc911\uc5d0 IOException \ubc1c\uc0dd: {0} -io_ex_reopen_EXC_=IWAE0016E {0}\uc744(\ub97c) \ub2e4\uc2dc \uc5ec\ub294 \ub3d9\uc548 IOException \ubc1c\uc0dd -unable_replace_EXC_=IWAE0017E \uc6d0\ub798\uc758 \uc544\uce74\uc774\ube0c\ub97c \ubc14\uafc0 \uc218 \uc5c6\uc74c: {0} -duplicate_file_EXC_=IWAE0018E {0}(\uc774)\ub77c\ub294 \uc774\ub984\uc758 \uc544\uce74\uc774\ube0c\uac00 \uc774\ubbf8 {1}(\uc774)\ub77c\ub294 \uc774\ub984\uc758 \ud30c\uc77c \ud3ec\ud568 -duplicate_entry_EXC_=IWAE0019E {0} uri\ub97c \uac00\uc9c0\ub294 \ud30c\uc77c\uc774\ub098 \uc790\uc6d0\uc774 \uc774\ubbf8 {1}(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \uc544\uce74\uc774\ube0c\uc5d0 \uc788\uc74c -file_exist_as_dir_EXC_=IWAE0020E {0}(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \ud30c\uc77c\uc774 \uc788\uace0 \ub514\ub809\ud1a0\ub9ac\uc784 -uncontained_module_EXC_=IWAE0021E {0} \ubaa8\ub4c8\uc774 EAR \ud30c\uc77c\uc5d0 \uc788\uc74c -dd_in_ear_load_EXC_=IWAE0022E "{1}" EAR \ud30c\uc77c\uc758 "{0}" \ubaa8\ub4c8\uc5d0 \ub300\ud55c \uc804\uac1c \uc124\uba85\uc790\ub97c \ub85c\ub4dc\ud558\ub294 \uc911\uc5d0 \uc608\uc678 \ubc1c\uc0dd -nested_open_fail_EXC_=IWAE0023E "{1}" EAR \ud30c\uc77c\uc758 "{0}" \ubaa8\ub4c8 \ud30c\uc77c\uc744 \uc5f4 \uc218 \uc5c6\uc74c -duplicate_module_EXC_=IWAE0024E "{0}" EAR \ud30c\uc77c\uc758 \uc804\uac1c \uc124\uba85\uc790\uac00 "{1}" uri\ub97c \uac00\uc9c0\ub294 \ubaa8\ub4c8\uc744 \uc774\ubbf8 \ud3ec\ud568 -no_sec_role_EXC_=IWAE0025E {0}: EAR \ud30c\uc77c \uc804\uac1c \uc124\uba85\uc790\uc5d0 {1}(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \ubcf4\uc548 \uc5ed\ud560\uc774 \uc5c6\uc74c -dup_sec_role_EXC_=IWAE0026E {0}: EAR \ud30c\uc77c \uc804\uac1c \uc124\uba85\uc790\uc5d0 {1}(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \ubcf4\uc548 \uc5ed\ud560\uc774 \uc774\ubbf8 \uc788\uc74c -dup_sec_role_module_EXC_=IWAE0027E {0}\uc758 \uc804\uac1c \uc124\uba85\uc790\uc5d0 {1}(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \ubcf4\uc548 \uc5ed\ud560\uc774 \uc774\ubbf8 \uc788\uc74c -dup_resource_EXC_=IWAE0028E "{1}" \uc544\uce74\uc774\ube0c\uc5d0 "{0}"(\uc774)\ub77c\ub294 \uc774\ub984\uc774 \uc9c0\uc815\ub41c \uc790\uc6d0\uc774 \uc774\ubbf8 \uc788\uc74c -error_saving_EXC_=IWAE0030E {0} \uc800\uc7a5 \uc911\uc5d0 \uc624\ub958 \ubc1c\uc0dd -add_copy_class_dir_EXC_=IWAE0031E "addCopyClass" \uba54\uc18c\ub4dc\ub294 \ub514\ub809\ud1a0\ub9ac\uc5d0\ub294 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E "addCopyLib" \uba54\uc18c\ub4dc\ub294 \ub514\ub809\ud1a0\ub9ac\uc5d0\ub294 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. URI: {0} -list_components_war_EXC_=IWAE0033E WAR \ud30c\uc77c\uc758 \uad6c\uc131\uc694\uc18c\ub97c \ub098\uc5f4\ud558\ub294 \uc911\uc5d0 \uc608\uc678 \ubc1c\uc0dd: {0} -open_nested_EXC_=IWAE0034E "{1}" \uc544\uce74\uc774\ube0c\uc5d0 \uc911\ucca9\ub418\uc5b4 \uc788\ub294 "{0}" \uc544\uce74\uc774\ube0c\ub97c \uc5f4 \uc218 \uc5c6\uc5c8\uc74c -make_temp_file_WARN_=IWAE0035W \uacbd\uace0: {0}\uc5d0 \ub300\ud55c \uc784\uc2dc \ud30c\uc77c\uc744 \uc791\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc131\ub2a5\uc5d0 \uc601\ud5a5\uc744 \uc904 \uac83\uc785\ub2c8\ub2e4. -file_not_found_EXC_=IWAE0036E URI \uc774\ub984: {0}, \ud30c\uc77c \uc774\ub984: {1} -could_not_open_EXC_=IWAE0037E {0}\uc744(\ub97c) \uc5f4 \uc218 \uc5c6\uc5c8\uc74c -could_not_find_dir_EXC_=IWAE0038E {0} \ub514\ub809\ud1a0\ub9ac\ub97c \uc5f4 \uc218 \uc5c6\uc74c -not_a_dir_EXC_=IWAE0039E \ud30c\uc77c\uc774 \ub514\ub809\ud1a0\ub9ac\uac00 \uc544\ub2c8\uae30 \ub54c\ubb38\uc5d0 \ub514\ub809\ud1a0\ub9ac\ub97c \uc5f4 \uc218 \uc5c6\uc74c: {0} -inferred_dds_EXC_=IWAE0040E Manifest\uac00 \uc5d4\ud130\ud504\ub77c\uc774\uc988 Bean\uc744 \uc120\uc5b8\ud558\uc9c0 \uc54a\uc73c\ub098 \uc77c\ub828\ud654\ub41c \uc804\uac1c \uc124\uba85\uc790\uac00 JAR\uc5d0 \uc788\uae30 \ub54c\ubb38\uc5d0 "{0}" EJB JAR \ud30c\uc77c\uc740 \ubc84\uc804 1.0\uc774\ub77c\uace0 \uc720\ucd94\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -filename_exception_EXC_=IWAE0041E \ud30c\uc77c \uc774\ub984: {0}, \uc608\uc678: {1} -no_dds_10_EXC_=IWAE0042E EJB 1.0 JAR \ud30c\uc77c\uc5d0 \uc804\uac1c \uc124\uba85\uc790 \uc5c6\uc74c: {0} -manifest_dd_load_EXC_=IWAE0043E JAR Manifest\uac00 \uc804\uac1c \uc124\uba85\uc790 \ud30c\uc77c\uc744 \ub85c\ub4dc\ud560 \uc218 \uc5c6\ub294 \uc5d4\ud130\ud504\ub77c\uc774\uc988 Bean\uc744 \uc120\uc5b8: {0} -manifest_dd_find_EXC_=IWAE0044E JAR Manifest\uac00 \uc804\uac1c \uc124\uba85\uc790 \ud30c\uc77c\uc744 \ucc3e\uc744 \uc218 \uc5c6\ub294 \uc5d4\ud130\ud504\ub77c\uc774\uc988 Bean\uc744 \uc120\uc5b8: {0} -io_ex_reading_dd_EXC_=IWAE0045E {0}\uc744(\ub97c) \uc77d\ub294 \uc911\uc5d0 IO \uc608\uc678 \ubc1c\uc0dd -ser_not_dd_EXC_=IWAE0046E "{0}" \ud30c\uc77c\uc5d0 \uc788\ub294 \uc77c\ub828\ud654\ub41c \uc624\ube0c\uc81d\ud2b8\uac00 javax.ejb.deployment.DeploymentDescriptor\uc758 \uc778\uc2a4\ud134\uc2a4\uac00 \uc544\ub2d8 -reading_dd_EXC_=IWAE0047E {0}\uc744(\ub97c) \uc77d\ub294 \uc911\uc5d0 \uc608\uc678 \ubc1c\uc0dd -missing_class_EXC_=IWAE0048E \ud544\uc694\ud55c \ud074\ub798\uc2a4\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc5c8\uae30 \ub54c\ubb38\uc5d0 {0}\uc758 \uc77c\ub828\ud654\ub97c \ucde8\uc18c\ud560 \uc218 \uc5c6\uc5c8\uc2b5\ub2c8\ub2e4. \uc608\uc678: {1} -Converted=\ubcc0\ud658\ub428 -Stack_trace_of_nested_exce_EXC_=IWAE0049E \uc911\ucca9\ub41c \uc608\uc678\uc758 \uc2a4\ud0dd \ucd94\uc801: -IOException_occurred_while_EXC_=IWAE0050E Manifest\ub97c \ubcf5\uc0ac\ud558\ub294 \ub3d9\uc548 IOException \ubc1c\uc0dd -Extract_destination_is_the_EXC_=IWAE0051E \ucd94\ucd9c \ub300\uc0c1\uc774 \uc18c\uc2a4 \ud30c\uc77c\uacfc \uac19\uc740 \uacbd\ub85c\uc784 -Parameter_should_not_be_nu_EXC_=IWAE0052E \ub9e4\uac1c\ubcc0\uc218\uac00 \ub110\uc774\uba74 \uc548 \ub428 -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E \uc77c\ub828\ud654\ub41c \uc804\uac1c \uc124\uba85\uc790\ub97c Manifest\ub098 ".ser" \ud655\uc7a5\uc790\ub97c \uac00\uc9c4 \uc5d4\ud2f0\ud2f0\uc5d0\uc11c \ucc3e\uc744 \uc218 \uc5c6\uae30 \ub54c\ubb38\uc5d0 \uc544\uce74\uc774\ube0c\uac00 \uc62c\ubc14\ub978 EJB JAR \ud30c\uc77c(1.0)\uc774 \uc544\ub2d8 -_The_following_files_could_EXC_=IWAE0056E \ub2e4\uc74c \ud30c\uc77c\uc744 \ub85c\ub4dc\ud560 \uc218 \uc5c6\uc5c8\uc74c: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand \uc2e4\ud328 - \uc608\uc678 \uc2a4\ud0dd \ucd94\uc801: -FixPrimKeyCommand_usage___=FixPrimKeyCommand \uc0ac\uc6a9\ubc95: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E FixPrimKeyCommand \uc0ac\uc6a9\ubc95: sourceJarFilePath\uac00 \uc62c\ubc14\ub978 EJB JAR \ud30c\uc77c\uc774\ub098 \ud3bc\uccd0\uc9c4 EJB JAR \ud30c\uc77c\uc758 \ub514\ub809\ud1a0\ub9ac\ub97c \uac00\ub9ac\ucf1c\uc57c \ud568 -Repair_command_failed_-_ex_EXC_=IWAE0059E \uc218\uc815 \uba85\ub839 \uc2e4\ud328 - \uc608\uc678 \uc2a4\ud0dd \ucd94\uc801: -Repairs_all_entries_in_the=META-INF \ubc0f/\ub610\ub294 WEB-INF \ub514\ub809\ud1a0\ub9ac\uc758 \ubaa8\ub4e0 \ud56d\ubaa9\uc774 \uc815\ud655\ud55c \ub300\uc18c\ubb38\uc790\uac00 \ub418\ub3c4\ub85d \uc218\uc815 -RepairArchiveCommand_usage=RepairArchiveCommand \uc0ac\uc6a9\ubc95: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E RepairArchiveCommand \uc0ac\uc6a9\ubc95: sourceJarFilePath\uac00 \uc62c\ubc14\ub978 \uc544\uce74\uc774\ube0c\ub098 \ud3bc\uccd0\uc9c4 \uc544\uce74\uc774\ube0c\uc758 \ub514\ub809\ud1a0\ub9ac\ub97c \uac00\ub9ac\ucf1c\uc57c \ud568 -Application_Client_Jar_Fil=\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \ud074\ub77c\uc774\uc5b8\ud2b8 JAR \ud30c\uc77c -EAR_File=EAR \ud30c\uc77c -EJB_Jar_File=EJB JAR \ud30c\uc77c -RAR_File=RAR \ud30c\uc77c -WAR_File=WAR \ud30c\uc77c -Error_occurred_iterating_f_EXC_=IWAE0061E \ud30c\uc77c\uc744 \ubc18\ubcf5\ud558\ub294 \uc911\uc5d0 \uc624\ub958 \ubc1c\uc0dd -End_of_list_reached_EXC_=IWAE0062E \ubaa9\ub85d\uc758 \ub05d\uc5d0 \ub3c4\ub2ec -Internal_Error__Iterator_o_EXC_=IWAE0063E \ub0b4\ubd80 \uc624\ub958: \ubc18\ubcf5\uae30\uac00 zip \ud56d\ubaa9\uacfc \ub3d9\uae30\ud654\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc74c -Error_iterating_the_archiv_EXC_=IWAE0064E \uc544\uce74\uc774\ube0c\ub97c \ubc18\ubcf5\ud558\ub294 \uc911\uc5d0 \uc624\ub958 \ubc1c\uc0dd -Absolute_path_unknown_EXC_=IWAE0065E \uc54c \uc218 \uc5c6\ub294 \uc808\ub300 \uacbd\ub85c -Original_archive_is_not_a__EXC_=IWAE0066E \uc6d0\ub798\uc758 \uc544\uce74\uc774\ube0c\uac00 \ub514\ub809\ud1a0\ub9ac\uac00 \uc544\ub2d8 -Null_uri_EXC_=IWAE0067E \ub110 uri -Module_file=\ubaa8\ub4c8 \ud30c\uc77c -A_WAR_file=WAR \ud30c\uc77c -An_EJB_JAR_file=EJB JAR \ud30c\uc77c -An_Application_Client_JAR_file=\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \ud074\ub77c\uc774\uc5b8\ud2b8 JAR \ud30c\uc77c -A_RAR_file=RAR \ud30c\uc77c -A_Application_file=\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \ud30c\uc77c -A_file_does_not_exist_for_module=uri\uac00 \uc788\ub294 \ubaa8\ub4c8 \uc694\uc18c\uc5d0 \ub300\ud55c \ud30c\uc77c\uc774 \uc5c6\uc74c: {0} -File_not_correct_type={1} EAR \ud30c\uc77c\uc758 {0} \ud30c\uc77c\uc774 \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc804\uac1c \uc124\uba85\uc790\ub97c \uae30\ubcf8\uc73c\ub85c \ud558\ub294 \uc815\ud655\ud55c \uc720\ud615\uc774 \uc544\ub2d9\ub2c8\ub2e4. \uc608\uc0c1\ud558\ub294 \uc720\ud615: {2}". -Module_not_in_EAR=EAR\uc5d0 \ubaa8\ub4c8\uc774 \uc5c6\uc74c: {0} -Module_file_does_not_exist_2=\ubaa8\ub4c8 \ucc38\uc870\uc5d0 \ub300\ud55c \ubaa8\ub4c8 \ud30c\uc77c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \ubaa8\ub4c8 = {0} -FileImpl._Error_0=\ubc18\ubcf5\uc801\uc778 \ud3ec\ud568\uc774 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_pt_BR.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_pt_BR.properties deleted file mode 100644 index 485cbef53..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_pt_BR.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} deve ser implementado na subclasse -key_class_reflection_ERROR_=IWAE0002E N\u00e3o \u00e9 poss\u00edvel refletir a classe "{0}" para comparar o campo de chave principal "{1}" a partir da entidade "{2}" -key_field_reflection_ERROR_=IWAE0003E N\u00e3o \u00e9 poss\u00edvel refletir o tipo de campo de chave principal "{0}" a partir da entidade "{1}" -removing_key_field_INFO_=IWAE0004I Removendo campo de chave principal inv\u00e1lida "{0}" da entidade "{1}" -repair_usage_ERROR_=IWAE0005E Uso de RepairArchiveCommand: n\u00e3o \u00e9 poss\u00edvel gravar em destinationPath: {0} -invalid_archive_EXC_=IWAE0006E O archive n\u00e3o \u00e9 um {0} v\u00e1lido porque o descritor de implementa\u00e7\u00e3o n\u00e3o foi encontrado (distin\u00e7\u00e3o entre mai\u00fasculas e min\u00fasculas): {1} -load_resource_EXC_=IWAE0007E N\u00e3o foi poss\u00edvel carregar o recurso "{0}" no archive "{1}" -nested_jar_EXC_=IWAE0008E Ocorreu um erro ao ler {0} a partir de {1} -make_temp_dir_EXC_=IWAE0009E N\u00e3o \u00e9 poss\u00edvel criar diret\u00f3rio temp: {0} -invalid_classpath_WARN_=IWAE0010W O elemento do classpath "{0}" n\u00e3o \u00e9 um diret\u00f3rio ou um arquivo Zip -invalid_cp_file_WARN_=IWAE0011W O elemento do classpath "{0}" n\u00e3o aponta para um arquivo local -io_ex_loading_EXC_=IWAE0012E Ocorreu uma exce\u00e7\u00e3o ES ao carregar {0} -tx_bean_mgd_WARN_=IWAE0013W Importa\u00e7\u00e3o de EJB 1.0: N\u00e3o mapear descritor de controle TX_BEAN_MANAGED para {0} -error_saving_EXC_=IWAE0014E Erro ao salvar {0} -io_ex_manifest_EXC_=IWAE0015E Ocorreu uma exce\u00e7\u00e3o ES ao ler o manifesto no archive: {0} -io_ex_reopen_EXC_=IWAE0016E Ocorreu uma exce\u00e7\u00e3o ES ao reabrir {0} -unable_replace_EXC_=IWAE0017E N\u00e3o \u00e9 poss\u00edvel substituir o archive original: {0} -duplicate_file_EXC_=IWAE0018E O archive {0} j\u00e1 cont\u00e9m um arquivo denominado {1} -duplicate_entry_EXC_=IWAE0019E O arquivo ou recurso com o uri {0} j\u00e1 existe no archive denominado {1} -file_exist_as_dir_EXC_=IWAE0020E O arquivo {0} existe e \u00e9 um diret\u00f3rio -uncontained_module_EXC_=IWAE0021E O m\u00f3dulo {0} n\u00e3o \u00e9 contido por um arquivo EAR -dd_in_ear_load_EXC_=IWAE0022E Ocorreu uma exce\u00e7\u00e3o ao carregar o descritor de implementa\u00e7\u00e3o para o m\u00f3dulo "{0}" no arquivo EAR "{1}" -nested_open_fail_EXC_=IWAE0023E N\u00e3o \u00e9 poss\u00edvel abrir o arquivo de m\u00f3dulo "{0}" no arquivo EAR "{1}" -duplicate_module_EXC_=IWAE0024E O descritor de implementa\u00e7\u00e3o para o arquivo EAR "{0}" j\u00e1 cont\u00e9m um m\u00f3dulo que possui uri "{1}" -no_sec_role_EXC_=IWAE0025E {0}: O descritor de implementa\u00e7\u00e3o do Arquivo EAR n\u00e3o cont\u00e9m uma fun\u00e7\u00e3o de seguran\u00e7a denominada {1} -dup_sec_role_EXC_=IWAE0026E {0}: O descritor de implementa\u00e7\u00e3o do Arquivo EAR j\u00e1 cont\u00e9m uma fun\u00e7\u00e3o de seguran\u00e7a denominada {1} -dup_sec_role_module_EXC_=IWAE0027E O descritor de implementa\u00e7\u00e3o para {0} j\u00e1 cont\u00e9m uma fun\u00e7\u00e3o de seguran\u00e7a denominada {1} -dup_resource_EXC_=IWAE0028E O recurso denominado "{0}" j\u00e1 existe no archive "{1}" -error_saving_EXC_=IWAE0030E Erro ao salvar {0} -add_copy_class_dir_EXC_=IWAE0031E O m\u00e9todo "addCopyClass" n\u00e3o \u00e9 suportado para diret\u00f3rios. URI: {0} -add_copy_lib_dir_EXC_=IWAE0032E O m\u00e9todo "addCopyLib" n\u00e3o \u00e9 suportado para diret\u00f3rios. URI: {0} -list_components_war_EXC_=IWAE0033E Ocorreu uma exce\u00e7\u00e3o ao listar componentes no arquivo WAR: {0} -open_nested_EXC_=IWAE0034E N\u00e3o foi poss\u00edvel abrir o archive aninhado "{0}" em "{1}" -make_temp_file_WARN_=IWAE0035W Aviso: N\u00e3o \u00e9 poss\u00edvel criar arquivo temp para {0}. Isto causar\u00e1 impacto no desempenho. -file_not_found_EXC_=IWAE0036E Nome do URI: {0}; Nome do arquivo: {1} -could_not_open_EXC_=IWAE0037E N\u00e3o foi poss\u00edvel abrir {0} -could_not_find_dir_EXC_=IWAE0038E N\u00e3o \u00e9 poss\u00edvel abrir o diret\u00f3rio {0} -not_a_dir_EXC_=IWAE0039E N\u00e3o \u00e9 poss\u00edvel abrir o diret\u00f3rio porque o arquivo n\u00e3o \u00e9 um diret\u00f3rio: {0} -inferred_dds_EXC_=IWAE0040E Sup\u00f4s-se que o arquivo JAR EJB "{0}" tinha a vers\u00e3o 1.0, porque o manifesto n\u00e3o declara os beans corporativos, mas descritores de implementa\u00e7\u00e3o serializados existem no JAR. -filename_exception_EXC_=IWAE0041E Nome do arquivo: {0}; Exce\u00e7\u00e3o: {1} -no_dds_10_EXC_=IWAE0042E N\u00e3o h\u00e1 descritores de implementa\u00e7\u00e3o no arquivo JAR EJB 1.0: {0} -manifest_dd_load_EXC_=IWAE0043E O manifesto JAR declara um bean corporativo para o qual o descritor de implementa\u00e7\u00e3o n\u00e3o pode ser carregado: {0} -manifest_dd_find_EXC_=IWAE0044E O manifesto JAR declara um bean corporativo para o qual o descritor de implementa\u00e7\u00e3o n\u00e3o pode ser encontrado: {0} -io_ex_reading_dd_EXC_=IWAE0045E Ocorreu uma Exce\u00e7\u00e3o ES ao ler {0} -ser_not_dd_EXC_=IWAE0046E O objeto serializado no arquivo "{0}" n\u00e3o \u00e9 uma inst\u00e2ncia de javax.ejb.deployment.DeploymentDescriptor -reading_dd_EXC_=IWAE0047E Ocorreu uma Exce\u00e7\u00e3o ao ler {0} -missing_class_EXC_=IWAE0048E N\u00e3o foi poss\u00edvel desserializar {0} porque uma classe requerida n\u00e3o p\u00f4de ser encontrada. Exce\u00e7\u00e3o: {1} -Converted=Convertido -Stack_trace_of_nested_exce_EXC_=IWAE0049E Rastreio de exce\u00e7\u00e3o aninhada: -IOException_occurred_while_EXC_=IWAE0050E Ocorreu uma Exce\u00e7\u00e3o ES ao copiar o manifesto -Extract_destination_is_the_EXC_=IWAE0051E O destino da extra\u00e7\u00e3o \u00e9 o mesmo caminho que o arquivo de origem -Parameter_should_not_be_nu_EXC_=IWAE0052E O par\u00e2metro n\u00e3o deve ser nulo -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E O archive n\u00e3o \u00e9 um arquivo JAR EJB v\u00e1lido (1.0) porque nenhum descritor de implementa\u00e7\u00e3o serializado pode ser encontrado no manifesto ou nas entradas com uma extens\u00e3o ".ser" -_The_following_files_could_EXC_=IWAE0056E Os arquivos a seguir n\u00e3o puderam ser carregados: -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand falhou - rastreio da pilha de exce\u00e7\u00e3o: -FixPrimKeyCommand_usage___=Utiliza\u00e7\u00e3o de FixPrimKeyCommand: <sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E Uso de FixPrimKeyCommand: sourceJarFilePath deve apontar para um arquivo JAR EJB v\u00e1lido ou diret\u00f3rio de um arquivo JAR EJB expandido -Repair_command_failed_-_ex_EXC_=IWAE0059E Falha no comando Reparar - rastreio da pilha de exce\u00e7\u00e3o: -Repairs_all_entries_in_the=Repara todas as entradas nos diret\u00f3rios META-INF e/ou WEB-INF para que elas estejam com a caixa correta -RepairArchiveCommand_usage=Utiliza\u00e7\u00e3o de RepairArchiveCommand: <sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E Uso de RepairArchiveCommand: sourceJarFilePath deve apontar para um archive v\u00e1lido ou diret\u00f3rio de um archive expandido -Application_Client_Jar_Fil=Arquivo JAR do Cliente do Aplicativo -EAR_File=Arquivo EAR -EJB_Jar_File=Arquivo JAR EJB -RAR_File=Arquivo RAR -WAR_File=Arquivo WAR -Error_occurred_iterating_f_EXC_=IWAE0061E Ocorreu um erro ao iterar arquivos -End_of_list_reached_EXC_=IWAE0062E Alcan\u00e7ado o fim da lista -Internal_Error__Iterator_o_EXC_=IWAE0063E Erro Interno: Iterador n\u00e3o sincronizado com entradas zip -Error_iterating_the_archiv_EXC_=IWAE0064E Erro ao iterar o archive -Absolute_path_unknown_EXC_=IWAE0065E Caminho absoluto desconhecido -Original_archive_is_not_a__EXC_=IWAE0066E O archive original n\u00e3o \u00e9 um diret\u00f3rio -Null_uri_EXC_=IWAE0067E Uri nulo -Module_file=Arquivo de m\u00f3dulo -A_WAR_file=Arquivo WAR -An_EJB_JAR_file=Arquivo JAR EJB -An_Application_Client_JAR_file=Arquivo JAR do Cliente do Aplicativo -A_RAR_file=Arquivo RAR -A_Application_file=Arquivo do Aplicativo -A_file_does_not_exist_for_module=Um arquivo n\u00e3o existe para o elemento de m\u00f3dulo que possui a uri: {0} -File_not_correct_type=O arquivo {0} no arquivo EAR {1} n\u00e3o \u00e9 o tipo correto, baseado no descritor de implementa\u00e7\u00e3o de aplicativo. Tipo estendido: {2}"; -Module_not_in_EAR=O m\u00f3dulo n\u00e3o est\u00e1 em uma EAR: {0} -Module_file_does_not_exist_2=O arquivo de m\u00f3dulo n\u00e3o existe para a refer\u00eancia de M\u00f3dulo. M\u00f3dulo = {0} -FileImpl._Error_0=Conten\u00e7\u00e3o recursiva n\u00e3o permitida para diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh.properties deleted file mode 100644 index 05b516995..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E {0} \u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0 -key_class_reflection_ERROR_=IWAE0002E \u672a\u80fd\u53cd\u6620\u7c7b\u201c{0}\u201d\u4ee5\u4fbf\u5bf9\u5b9e\u4f53\u201c{2}\u201d\u7684\u4e3b\u952e\u5b57\u6bb5\u201c{1}\u201d\u8fdb\u884c\u6bd4\u8f83 -key_field_reflection_ERROR_=IWAE0003E \u672a\u80fd\u53cd\u6620\u5b9e\u4f53\u201c{1}\u201d\u7684\u4e3b\u952e\u5b57\u6bb5\u201c{0}\u201d\u7684\u7c7b\u578b -removing_key_field_INFO_=IWAE0004I \u4ece\u5b9e\u4f53\u201c{1}\u201d\u4e2d\u9664\u53bb\u65e0\u6548\u7684\u4e3b\u952e\u5b57\u6bb5\u201c{0}\u201d -repair_usage_ERROR_=IWAE0005E RepairArchiveCommand \u7528\u6cd5\uff1a\u4e0d\u80fd\u5199\u5165 destinationPath\uff1a{0} -invalid_archive_EXC_=IWAE0006E \u5f52\u6863\u4e0d\u662f\u6709\u6548\u7684 {0}\uff0c\u539f\u56e0\u662f\u627e\u4e0d\u5230\u90e8\u7f72\u63cf\u8ff0\u7b26\uff08\u533a\u5206\u5927\u5c0f\u5199\uff09\uff1a{1} -load_resource_EXC_=IWAE0007E \u672a\u80fd\u88c5\u5165\u5f52\u6863\u201c{1}\u201d\u4e2d\u7684\u8d44\u6e90\u201c{0}\u201d -nested_jar_EXC_=IWAE0008E \u4ece {1} \u4e2d\u8bfb\u53d6 {0} \u65f6\u53d1\u751f\u4e86\u9519\u8bef -make_temp_dir_EXC_=IWAE0009E \u65e0\u6cd5\u5efa\u7acb\u4e34\u65f6\u76ee\u5f55\uff1a{0} -invalid_classpath_WARN_=IWAE0010W \u7c7b\u8def\u5f84\u5143\u7d20\u201c{0}\u201d\u4e0d\u662f\u76ee\u5f55\u6216\u538b\u7f29\u6587\u4ef6 -invalid_cp_file_WARN_=IWAE0011W \u7c7b\u8def\u5f84\u5143\u7d20\u201c{0}\u201d\u4e0d\u6307\u5411\u672c\u5730\u6587\u4ef6 -io_ex_loading_EXC_=IWAE0012E \u88c5\u5165 {0} \u65f6\u53d1\u751f\u4e86 IO \u5f02\u5e38 -tx_bean_mgd_WARN_=IWAE0013W EJB 1.0 \u5bfc\u5165\uff1a\u6ca1\u6709\u5bf9 {0} \u6620\u5c04 TX_BEAN_MANAGED \u63a7\u5236\u63cf\u8ff0\u7b26 -error_saving_EXC_=IWAE0014E \u4fdd\u5b58 {0} \u65f6\u51fa\u9519 -io_ex_manifest_EXC_=IWAE0015E \u8bfb\u53d6\u5f52\u6863 {0} \u4e2d\u7684\u6e05\u5355\u65f6\u53d1\u751f IO \u5f02\u5e38 -io_ex_reopen_EXC_=IWAE0016E \u91cd\u65b0\u6253\u5f00 {0} \u65f6\u53d1\u751f IO \u5f02\u5e38 -unable_replace_EXC_=IWAE0017E \u65e0\u6cd5\u66ff\u6362\u539f\u59cb\u5f52\u6863\uff1a{0} -duplicate_file_EXC_=IWAE0018E \u540d\u4e3a {0} \u7684\u5f52\u6863\u5df2\u7ecf\u5305\u542b\u540d\u4e3a {1} \u7684\u6587\u4ef6 -duplicate_entry_EXC_=IWAE0019E \u5177\u6709 uri {0} \u7684\u6587\u4ef6\u6216\u8d44\u6e90\u5df2\u5b58\u5728\u4e8e\u540d\u4e3a {1} \u7684\u5f52\u6863\u4e2d -file_exist_as_dir_EXC_=IWAE0020E \u540d\u4e3a {0} \u7684\u6587\u4ef6\u5df2\u5b58\u5728\u5e76\u4e14\u8be5\u540d\u79f0\u662f\u4e00\u4e2a\u76ee\u5f55 -uncontained_module_EXC_=IWAE0021E \u6a21\u5757 {0} \u4e0d\u5305\u542b\u5728 EAR \u6587\u4ef6\u4e2d -dd_in_ear_load_EXC_=IWAE0022E \u4e3a EAR \u6587\u4ef6\u201c{1}\u201d\u4e2d\u7684\u6a21\u5757\u201c{0}\u201d\u88c5\u5165\u90e8\u7f72\u63cf\u8ff0\u7b26\u65f6\u53d1\u751f\u4e86\u5f02\u5e38 -nested_open_fail_EXC_=IWAE0023E \u65e0\u6cd5\u6253\u5f00 EAR \u6587\u4ef6\u201c{1}\u201d\u4e2d\u7684\u6a21\u5757\u6587\u4ef6\u201c{0}\u201d -duplicate_module_EXC_=IWAE0024E EAR \u6587\u4ef6\u201c{0}\u201d\u7684\u90e8\u7f72\u63cf\u8ff0\u7b26\u5df2\u7ecf\u5305\u542b\u5177\u6709 uri\u201c{1}\u201d\u7684\u6a21\u5757 -no_sec_role_EXC_=IWAE0025E {0}\uff1aEAR \u6587\u4ef6\u90e8\u7f72\u63cf\u8ff0\u7b26\u4e0d\u5305\u542b\u540d\u4e3a {1} \u7684\u5b89\u5168\u89d2\u8272 -dup_sec_role_EXC_=IWAE0026E {0}\uff1aEAR \u6587\u4ef6\u90e8\u7f72\u63cf\u8ff0\u7b26\u5df2\u7ecf\u5305\u542b\u540d\u4e3a {1} \u7684\u5b89\u5168\u89d2\u8272 -dup_sec_role_module_EXC_=IWAE0027E {0} \u7684\u90e8\u7f72\u63cf\u8ff0\u7b26\u5df2\u7ecf\u5305\u542b\u540d\u4e3a {1} \u7684\u5b89\u5168\u89d2\u8272 -dup_resource_EXC_=IWAE0028E \u540d\u4e3a\u201c{0}\u201d\u7684\u8d44\u6e90\u5728\u5f52\u6863\u201c{1}\u201d\u4e2d\u5df2\u7ecf\u5b58\u5728 -error_saving_EXC_=IWAE0030E \u4fdd\u5b58 {0} \u65f6\u51fa\u9519 -add_copy_class_dir_EXC_=IWAE0031E \u65b9\u6cd5\u201caddCopyClass\u201d\u5bf9\u4e8e\u76ee\u5f55\u4e0d\u53d7\u652f\u6301\u3002URI\uff1a{0} -add_copy_lib_dir_EXC_=IWAE0032E \u65b9\u6cd5\u201caddCopyLib\u201d\u5bf9\u4e8e\u76ee\u5f55\u4e0d\u53d7\u652f\u6301\u3002URI\uff1a{0} -list_components_war_EXC_=IWAE0033E \u5217\u793a WAR \u6587\u4ef6 {0} \u4e2d\u7684\u7ec4\u4ef6\u65f6\u53d1\u751f\u4e86\u5f02\u5e38 -open_nested_EXC_=IWAE0034E \u65e0\u6cd5\u6253\u5f00\u201c{1}\u201d\u4e2d\u7684\u5d4c\u5957\u5f52\u6863\u201c{0}\u201d -make_temp_file_WARN_=IWAE0035W \u8b66\u544a\uff1a\u65e0\u6cd5\u4e3a {0} \u521b\u5efa\u4e34\u65f6\u6587\u4ef6\u3002\u8fd9\u5c06\u5f71\u54cd\u6027\u80fd\u3002 -file_not_found_EXC_=IWAE0036E URI \u540d\uff1a{0}\uff1b\u6587\u4ef6\u540d\uff1a{1} -could_not_open_EXC_=IWAE0037E \u65e0\u6cd5\u6253\u5f00 {0} -could_not_find_dir_EXC_=IWAE0038E \u65e0\u6cd5\u6253\u5f00\u76ee\u5f55 {0} -not_a_dir_EXC_=IWAE0039E \u65e0\u6cd5\u6253\u5f00\u76ee\u5f55\uff0c\u539f\u56e0\u662f\u6587\u4ef6\u4e0d\u662f\u76ee\u5f55\uff1a{0} -inferred_dds_EXC_=IWAE0040E \u63a8\u65ad EJB JAR \u6587\u4ef6\u201c{0}\u201d\u4e3a\u7248\u672c 1.0\uff0c\u539f\u56e0\u662f\u6e05\u5355\u6ca1\u6709\u58f0\u660e\u4f01\u4e1a bean\uff0c\u4f46 JAR \u4e2d\u6709\u5e8f\u5217\u5316\u7684\u90e8\u7f72\u63cf\u8ff0\u7b26\u3002 -filename_exception_EXC_=IWAE0041E \u6587\u4ef6\u540d\uff1a{0}\uff1b\u5f02\u5e38\uff1a{1} -no_dds_10_EXC_=IWAE0042E EJB 1.0 JAR \u6587\u4ef6 {0} \u4e2d\u6ca1\u6709\u90e8\u7f72\u63cf\u8ff0\u7b26 -manifest_dd_load_EXC_=IWAE0043E JAR \u6e05\u5355\u58f0\u660e\u4e86\u4e00\u4e2a\u4e0d\u80fd\u4e3a\u5176\u88c5\u5165\u90e8\u7f72\u63cf\u8ff0\u7b26\u6587\u4ef6\u7684\u4f01\u4e1a bean\uff1a{0} -manifest_dd_find_EXC_=IWAE0044E JAR \u6e05\u5355\u58f0\u660e\u4e86\u4e00\u4e2a\u4e0d\u80fd\u4e3a\u5176\u627e\u5230\u90e8\u7f72\u63cf\u8ff0\u7b26\u6587\u4ef6\u7684\u4f01\u4e1a bean\uff1a{0} -io_ex_reading_dd_EXC_=IWAE0045E \u8bfb\u53d6 {0} \u65f6\u53d1\u751f\u4e86 IO \u5f02\u5e38 -ser_not_dd_EXC_=IWAE0046E \u6587\u4ef6\u201c{0}\u201d\u4e2d\u7684\u5e8f\u5217\u5316\u5bf9\u8c61\u4e0d\u662f javax.ejb.deployment.DeploymentDescriptor \u7684\u5b9e\u4f8b -reading_dd_EXC_=IWAE0047E \u8bfb\u53d6 {0} \u65f6\u53d1\u751f\u4e86\u5f02\u5e38 -missing_class_EXC_=IWAE0048E \u672a\u80fd\u53cd\u5e8f\u5217\u5316 {0}\uff0c\u539f\u56e0\u662f\u627e\u4e0d\u5230\u6240\u9700\u7684\u7c7b\u3002\u5f02\u5e38\uff1a{1} -Converted=\u5df2\u8f6c\u6362 -Stack_trace_of_nested_exce_EXC_=IWAE0049E \u5d4c\u5957\u5f02\u5e38\u7684\u5806\u6808\u8ddf\u8e2a\uff1a -IOException_occurred_while_EXC_=IWAE0050E \u590d\u5236\u6e05\u5355\u65f6\u53d1\u751f IO \u5f02\u5e38 -Extract_destination_is_the_EXC_=IWAE0051E \u62bd\u53d6\u76ee\u6807\u8def\u5f84\u4e0e\u6e90\u6587\u4ef6\u8def\u5f84\u76f8\u540c -Parameter_should_not_be_nu_EXC_=IWAE0052E \u53c2\u6570\u4e0d\u5e94\u4e3a\u7a7a -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E \u5f52\u6863\u4e0d\u662f\u6709\u6548\u7684 EJB JAR \u6587\u4ef6\uff081.0\uff09\uff0c\u539f\u56e0\u662f\u4e0d\u7ba1\u5728\u6e05\u5355\u4e2d\u8fd8\u662f\u5728\u6269\u5c55\u540d\u4e3a\u201c.ser\u201d\u7684\u6761\u76ee\u4e2d\u90fd\u627e\u4e0d\u5230\u5e8f\u5217\u5316\u90e8\u7f72\u63cf\u8ff0\u7b26 -_The_following_files_could_EXC_=IWAE0056E \u672a\u80fd\u88c5\u5165\u4e0b\u5217\u6587\u4ef6\uff1a -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand \u5931\u8d25 \uff0d \u5f02\u5e38\u5806\u6808\u8ddf\u8e2a\uff1a -FixPrimKeyCommand_usage___=FixPrimKeyCommand \u7528\u6cd5\uff1a<sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E FixPrimKeyCommand \u7528\u6cd5\uff1asourceJarFilePath \u5fc5\u987b\u6307\u5411\u6709\u6548\u7684 EJB JAR \u6587\u4ef6\u6216\u5df2\u89e3\u538b\u7f29\u7684 EJB JAR \u6587\u4ef6\u7684\u76ee\u5f55 -Repair_command_failed_-_ex_EXC_=IWAE0059E \u4fee\u590d\u547d\u4ee4\u5931\u8d25 \uff0d \u5f02\u5e38\u5806\u6808\u8ddf\u8e2a\uff1a -Repairs_all_entries_in_the=\u4fee\u590d META-INF \u548c\uff0f\u6216 WEB-INF \u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6761\u76ee\u4ee5\u4f7f\u5b83\u4eec\u90fd\u662f\u6b63\u786e\u7684 -RepairArchiveCommand_usage=RepairArchiveCommand \u7528\u6cd5\uff1a<sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E RepairArchiveCommand \u7528\u6cd5\uff1asourceJarFilePath \u5fc5\u987b\u6307\u5411\u6709\u6548\u7684\u5f52\u6863\u6216\u5df2\u89e3\u538b\u7f29\u5f52\u6863\u7684\u76ee\u5f55 -Application_Client_Jar_Fil=\u5e94\u7528\u7a0b\u5e8f\u5ba2\u6237\u673a JAR \u6587\u4ef6 -EAR_File=EAR \u6587\u4ef6 -EJB_Jar_File=EJB JAR \u6587\u4ef6 -RAR_File=RAR \u6587\u4ef6 -WAR_File=WAR \u6587\u4ef6 -Error_occurred_iterating_f_EXC_=IWAE0061E \u8fed\u4ee3\u6587\u4ef6\u65f6\u53d1\u751f\u4e86\u9519\u8bef -End_of_list_reached_EXC_=IWAE0062E \u5230\u8fbe\u4e86\u5217\u8868\u7684\u672b\u5c3e -Internal_Error__Iterator_o_EXC_=IWAE0063E \u5185\u90e8\u9519\u8bef\uff1a\u8fed\u4ee3\u5668\u4e0e\u538b\u7f29\u6761\u76ee\u4e0d\u540c\u6b65 -Error_iterating_the_archiv_EXC_=IWAE0064E \u8fed\u4ee3\u5f52\u6863\u65f6\u51fa\u9519 -Absolute_path_unknown_EXC_=IWAE0065E \u7edd\u5bf9\u8def\u5f84\u672a\u77e5 -Original_archive_is_not_a__EXC_=IWAE0066E \u539f\u59cb\u5f52\u6863\u4e0d\u662f\u76ee\u5f55 -Null_uri_EXC_=IWAE0067E \u7a7a\u7684 uri -Module_file=\u6a21\u5757\u6587\u4ef6 -A_WAR_file=WAR \u6587\u4ef6 -An_EJB_JAR_file=EJB JAR \u6587\u4ef6 -An_Application_Client_JAR_file=\u5e94\u7528\u7a0b\u5e8f\u5ba2\u6237\u673a JAR \u6587\u4ef6 -A_RAR_file=RAR \u6587\u4ef6 -A_Application_file=\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6 -A_file_does_not_exist_for_module=\u5bf9\u4e8e\u5177\u6709 uri {0} \u7684\u6a21\u5757\u5143\u7d20\uff0c\u6587\u4ef6\u4e0d\u5b58\u5728 -File_not_correct_type=\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u90e8\u7f72\u63cf\u8ff0\u7b26\uff0cEAR \u6587\u4ef6 {1} \u4e2d\u7684\u6587\u4ef6 {0} \u7c7b\u578b\u4e0d\u6b63\u786e\u3002\u671f\u671b\u7684\u7c7b\u578b\uff1a{2}\uff1b -Module_not_in_EAR=\u6a21\u5757\u4e0d\u5728 EAR {0} \u4e2d -Module_file_does_not_exist_2=\u6a21\u5757\u5f15\u7528\u7684\u6a21\u5757\u6587\u4ef6\u4e0d\u5b58\u5728\u3002\u6a21\u5757 = {0} -FileImpl._Error_0=\u4e0d\u5141\u8bb8\u9012\u5f52\u5305\u542b diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh_TW.properties b/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh_TW.properties deleted file mode 100644 index 25dc5a517..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/commonarchive_zh_TW.properties +++ /dev/null @@ -1,94 +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 -############################################################################### -subclass_responsibilty_EXC_=IWAE0001E \u5fc5\u9808\u5728\u5b50\u985e\u5225\u4e2d\u5be6\u4f5c {0} -key_class_reflection_ERROR_=IWAE0002E \u7121\u6cd5\u53cd\u6620\u985e\u5225 "{0}" \u4ee5\u4fbf\u5f9e\u5be6\u9ad4 "{2}" \u6bd4\u8f03\u4e3b\u9375\u6b04\u4f4d "{1}" -key_field_reflection_ERROR_=IWAE0003E \u7121\u6cd5\u5f9e\u5be6\u9ad4 "{1}" \u53cd\u6620\u4e3b\u9375\u6b04\u4f4d "{0}" \u985e\u578b -removing_key_field_INFO_=IWAE0004I \u5f9e\u5be6\u9ad4 "{1}" \u79fb\u9664\u7121\u6548\u7684\u4e3b\u9375\u6b04\u4f4d "{0}" -repair_usage_ERROR_=IWAE0005E RepairArchiveCommand \u7528\u6cd5\uff1a\u7121\u6cd5\u5beb\u5165 destinationPath\uff1a{0} -invalid_archive_EXC_=IWAE0006E \u4fdd\u5b58\u6a94\u662f\u7121\u6548\u7684 {0}\uff0c\u56e0\u70ba\u627e\u4e0d\u5230\u90e8\u7f72\u63cf\u8ff0\u5b50\uff08\u5340\u5206\u5927\u5c0f\u5beb\uff09\uff1a{1} -load_resource_EXC_=IWAE0007E \u7121\u6cd5\u5c07\u8cc7\u6e90 "{0}" \u8f09\u5165\u4fdd\u5b58\u6a94 "{1}" -nested_jar_EXC_=IWAE0008E \u5f9e {1} \u8b80\u53d6 {0} \u6642\u767c\u751f\u932f\u8aa4 -make_temp_dir_EXC_=IWAE0009E \u7121\u6cd5\u88fd\u4f5c\u66ab\u6642\u76ee\u9304\uff1a{0} -invalid_classpath_WARN_=IWAE0010W \u985e\u5225\u8def\u5f91\u5143\u7d20 "{0}" \u4e0d\u662f\u76ee\u9304\u6216 Zip \u6a94 -invalid_cp_file_WARN_=IWAE0011W \u985e\u5225\u8def\u5f91\u5143\u7d20 "{0}" \u4e0d\u662f\u6307\u5411\u672c\u7aef\u6a94\u6848 -io_ex_loading_EXC_=IWAE0012E \u8f09\u5165 {0} \u6642\u767c\u751f IO \u7570\u5e38\u72c0\u6cc1 -tx_bean_mgd_WARN_=IWAE0013W EJB 1.0 \u532f\u5165\uff1a\u4e0d\u5c0d\u6620 {0} \u7684 TX_BEAN_MANAGED \u63a7\u5236\u63cf\u8ff0\u5b50 -error_saving_EXC_=IWAE0014E \u5132\u5b58 {0} \u6642\u767c\u751f\u932f\u8aa4 -io_ex_manifest_EXC_=IWAE0015E \u8b80\u53d6\u4fdd\u5b58\u6a94\u4e2d\u7684\u8655\u7406\u6642\u767c\u751f IOException\uff1a{0} -io_ex_reopen_EXC_=IWAE0016E \u91cd\u65b0\u958b\u555f {0} \u6642\u767c\u751f IOException -unable_replace_EXC_=IWAE0017E \u7121\u6cd5\u7f6e\u63db\u539f\u59cb\u4fdd\u5b58\u6a94\uff1a{0} -duplicate_file_EXC_=IWAE0018E \u4fdd\u5b58\u6a94 {0} \u5df2\u5305\u542b\u540d\u7a31\u662f {1} \u7684\u6a94\u6848 -duplicate_entry_EXC_=IWAE0019E \u4fdd\u5b58\u6a94 {1} \u5df2\u5b58\u5728\u542b\u6709 uri {0} \u7684\u6a94\u6848\u6216\u8cc7\u6e90 -file_exist_as_dir_EXC_=IWAE0020E {0} \u6a94\u5b58\u5728\u800c\u4e14\u662f\u76ee\u9304 -uncontained_module_EXC_=IWAE0021E EAR \u6a94\u6c92\u6709\u5305\u542b\u6a21\u7d44 {0} -dd_in_ear_load_EXC_=IWAE0022E \u5c07\u6a21\u7d44 "{0}" \u7684\u90e8\u7f72\u63cf\u8ff0\u5b50\u8f09\u5165 EAR \u6a94 "{1}" \u6642\u767c\u751f\u7570\u5e38\u72c0\u6cc1 -nested_open_fail_EXC_=IWAE0023E \u5728 EAR \u6a94 "{1}" \u4e2d\u7121\u6cd5\u958b\u555f\u6a21\u7d44\u6a94\u6848 "{0}" -duplicate_module_EXC_=IWAE0024E EAR \u6a94 "{0}" \u7684\u90e8\u7f72\u63cf\u8ff0\u5b50\u5df2\u5305\u542b\u5177\u6709 uri "{1}" \u7684\u6a21\u7d44 -no_sec_role_EXC_=IWAE0025E {0}: EAR \u6a94\u90e8\u7f72\u63cf\u8ff0\u5b50\u4e0d\u542b\u5b89\u5168\u89d2\u8272 {1} -dup_sec_role_EXC_=IWAE0026E {0}: EAR \u6a94\u90e8\u7f72\u63cf\u8ff0\u5b50\u5df2\u5305\u542b\u5b89\u5168\u89d2\u8272 {1} -dup_sec_role_module_EXC_=IWAE0027E {0} \u7684\u90e8\u7f72\u63cf\u8ff0\u5b50\u5df2\u5305\u542b\u5b89\u5168\u89d2\u8272 {1} -dup_resource_EXC_=IWAE0028E \u8cc7\u6e90 "{0}" \u5df2\u5b58\u5728\u65bc\u4fdd\u5b58\u6a94 "{1}" \u4e2d -error_saving_EXC_=IWAE0030E \u5132\u5b58 {0} \u6642\u767c\u751f\u932f\u8aa4 -add_copy_class_dir_EXC_=IWAE0031E \u65b9\u6cd5 "addCopyClass" \u4e0d\u652f\u63f4\u76ee\u9304\u3002URI\uff1a{0} -add_copy_lib_dir_EXC_=IWAE0032E \u65b9\u6cd5 "addCopyLib" \u4e0d\u652f\u63f4\u76ee\u9304\u3002URI\uff1a{0} -list_components_war_EXC_=IWAE0033E \u5217\u51fa WAR \u6a94\u4e2d\u7684\u5143\u4ef6\u6642\u767c\u751f\u7570\u5e38\u72c0\u6cc1\uff1a{0} -open_nested_EXC_=IWAE0034E \u7121\u6cd5\u958b\u555f "{1}" \u4e2d\u653e\u7f6e\u7684\u4fdd\u5b58\u6a94 "{0}" -make_temp_file_WARN_=IWAE0035W \u8b66\u544a\uff1a\u7121\u6cd5\u5efa\u7acb {0} \u7684\u66ab\u5b58\u6a94\u3002\u9019\u6a23\u6703\u5f71\u97ff\u6548\u80fd\u3002 -file_not_found_EXC_=IWAE0036E URI \u540d\u7a31\uff1a{0}\uff1b\u6a94\u540d\uff1a{1} -could_not_open_EXC_=IWAE0037E \u7121\u6cd5\u958b\u555f {0} -could_not_find_dir_EXC_=IWAE0038E \u7121\u6cd5\u958b\u555f\u76ee\u9304 {0} -not_a_dir_EXC_=IWAE0039E \u7121\u6cd5\u958b\u555f\u76ee\u9304\uff0c\u56e0\u70ba\u6a94\u6848\u4e0d\u662f\u76ee\u9304\uff1a{0} -inferred_dds_EXC_=IWAE0040E \u63a8\u65b7 EJB JAR \u6a94 "{0}" \u662f\u7248\u672c 1.0\uff0c\u56e0\u70ba Manifest \u6c92\u6709\u5ba3\u544a Enterprise Bean\uff0c\u4f46\u662f\u5e8f\u5217\u5316\u7684\u90e8\u7f72\u63cf\u8ff0\u5b50\u5b58\u5728\u65bc JAR\u3002 -filename_exception_EXC_=IWAE0041E \u6a94\u540d\u7a31\uff1a{0}\uff1b\u7570\u5e38\u72c0\u6cc1\uff1a{1} -no_dds_10_EXC_=IWAE0042E EJB 1.0 JAR \u6a94\u6c92\u6709\u90e8\u7f72\u63cf\u8ff0\u5b50\uff1a{0} -manifest_dd_load_EXC_=IWAE0043E JAR \u8655\u7406\u5ba3\u544a\u7121\u6cd5\u8f09\u5165\u90e8\u7f72\u63cf\u8ff0\u5b50\u6a94\u7684 Enterprise Bean\uff1a{0} -manifest_dd_find_EXC_=IWAE0044E JAR \u8655\u7406\u5ba3\u544a\u627e\u4e0d\u5230\u90e8\u7f72\u63cf\u8ff0\u5b50\u6a94\u7684 Enterprise Bean\uff1a{0} -io_ex_reading_dd_EXC_=IWAE0045E \u8b80\u53d6 {0} \u6642\u767c\u751f IO \u7570\u5e38\u72c0\u6cc1 -ser_not_dd_EXC_=IWAE0046E \u6a94 "{0}" \u4e2d\u7684\u5e8f\u5217\u5316\u7269\u4ef6\u4e0d\u662f javax.ejb.deployment.DeploymentDescriptor \u5be6\u4f8b -reading_dd_EXC_=IWAE0047E \u8b80\u53d6 {0} \u6642\u767c\u751f\u7570\u5e38\u72c0\u6cc1 -missing_class_EXC_=IWAE0048E \u7121\u6cd5\u53d6\u6d88\u5e8f\u5217\u5316 {0}\uff0c\u56e0\u70ba\u627e\u4e0d\u5230\u5fc5\u8981\u7684\u985e\u5225\u3002\u7570\u5e38\u72c0\u6cc1\uff1a{1} -Converted=\u8f49\u63db -Stack_trace_of_nested_exce_EXC_=IWAE0049E \u5de2\u72c0\u7570\u5e38\u72c0\u6cc1\u7684\u5806\u758a\u8ffd\u8e64\uff1a -IOException_occurred_while_EXC_=IWAE0050E \u8907\u88fd\u8655\u7406\u6642\u767c\u751f IOException -Extract_destination_is_the_EXC_=IWAE0051E \u53d6\u51fa\u76ee\u7684\u5730\u662f\u8207\u7a0b\u5f0f\u6a94\u76f8\u540c\u7684\u8def\u5f91 -Parameter_should_not_be_nu_EXC_=IWAE0052E \u53c3\u6578\u4e0d\u53ef\u4ee5\u662f\u7a7a\u503c -Archive_is_not_a_valid_EJB_EXC_=IWAE0055E \u4fdd\u5b58\u6a94\u4e0d\u662f\u6709\u6548\u7684 EJB JAR \u6a94 (1.0)\uff0c\u56e0\u70ba\u5728 manifest \u6216\u542b\u6709 ".ser" \u526f\u6a94\u540d\u7684\u9805\u76ee\u4e2d\u627e\u4e0d\u5230\u5e8f\u5217\u5316\u7684\u90e8\u7f72\u63cf\u8ff0\u5b50 -_The_following_files_could_EXC_=IWAE0056E \u7121\u6cd5\u8f09\u5165\u4e0b\u5217\u6a94\u6848\uff1a -FixPrimKeyCommand_failed_-_EXC_=IWAE0057E FixPrimKeyCommand \u5931\u6557 - \u7570\u5e38\u72c0\u6cc1\u5806\u758a\u8ffd\u8e64\uff1a -FixPrimKeyCommand_usage___=FixPrimKeyCommand \u7528\u6cd5\uff1a<sourceJarFilePath> [destinationPath] -FixPrimKeyCommand_usage__s_EXC_=IWAE0058E FixPrimKeyCommand \u7528\u6cd5\uff1asourceJarFilePath \u5fc5\u9808\u6307\u5411\u6709\u6548\u7684 EJB JAR \u6a94\u6216 inflated EJB JAR \u6a94\u7684\u76ee\u9304 -Repair_command_failed_-_ex_EXC_=IWAE0059E Repair \u6307\u4ee4\u5931\u6557 - \u7570\u5e38\u72c0\u6cc1\u5806\u758a\u8ffd\u8e64\uff1a -Repairs_all_entries_in_the=\u4fee\u6b63 META-INF \u53ca/\u6216 WEB-INF \u76ee\u9304\u4e2d\u7684\u5168\u90e8\u9805\u76ee\u6210\u70ba\u6b63\u78ba\u5927\u5c0f\u5beb -RepairArchiveCommand_usage=RepairArchiveCommand \u7528\u6cd5\uff1a<sourceJarFilePath> <destinationPath> -RepairArchiveCommand_usage1_ERROR_=IWAE0060E RepairArchiveCommand \u7528\u6cd5\uff1asourceJarFilePath \u5fc5\u9808\u6307\u5411\u6709\u6548\u7684\u4fdd\u5b58\u6a94\u6216 inflated \u4fdd\u5b58\u6a94\u7684\u76ee\u9304 -Application_Client_Jar_Fil=\u61c9\u7528\u7a0b\u5f0f\u7528\u6236\u7aef JAR \u6a94 -EAR_File=EAR \u6a94 -EJB_Jar_File=EJB JAR \u6a94 -RAR_File=RAR \u6a94 -WAR_File=WAR \u6a94 -Error_occurred_iterating_f_EXC_=IWAE0061E \u758a\u4ee3\u6a94\u6848\u6642\u767c\u751f\u932f\u8aa4 -End_of_list_reached_EXC_=IWAE0062E \u5230\u9054\u6e05\u55ae\u7d50\u5c3e -Internal_Error__Iterator_o_EXC_=IWAE0063E \u5167\u90e8\u932f\u8aa4\uff1a\u758a\u4ee3\u8207 zip \u9805\u76ee\u4e0d\u540c\u6b65 -Error_iterating_the_archiv_EXC_=IWAE0064E \u758a\u4ee3\u4fdd\u5b58\u6a94\u6642\u767c\u751f\u932f\u8aa4 -Absolute_path_unknown_EXC_=IWAE0065E \u7d55\u5c0d\u8def\u5f91\u4e0d\u660e -Original_archive_is_not_a__EXC_=IWAE0066E \u539f\u59cb\u4fdd\u5b58\u6a94\u4e0d\u662f\u76ee\u9304 -Null_uri_EXC_=IWAE0067E \u7a7a\u503c uri -Module_file=\u6a21\u7d44\u6a94 -A_WAR_file=WAR \u6a94 -An_EJB_JAR_file=EJB JAR \u6a94 -An_Application_Client_JAR_file=\u61c9\u7528\u7a0b\u5f0f\u7528\u6236\u7aef JAR \u6a94 -A_RAR_file=RAR \u6a94 -A_Application_file=\u61c9\u7528\u7a0b\u5f0f\u6a94\u6848 -A_file_does_not_exist_for_module=\u5177\u6709\u4e0b\u5217 URI \u4e4b\u6a21\u7d44\u5143\u7d20\u7684\u6a94\u6848\u4e0d\u5b58\u5728\uff1a{0} -File_not_correct_type=EAR \u6a94 {1} \u4e2d\u7684 {0} \u6a94\u4e0d\u662f\u4ee5\u61c9\u7528\u7a0b\u5f0f\u90e8\u7f72\u63cf\u8ff0\u5b50\u70ba\u57fa\u790e\u7684\u6b63\u78ba\u985e\u578b\u3002\u9810\u671f\u7684\u985e\u578b\uff1a{2}"; -Module_not_in_EAR=\u6a21\u7d44\u4e0d\u5728 EAR \u4e2d\uff1a{0} -Module_file_does_not_exist_2=\u6c92\u6709\u6a21\u7d44\u53c3\u7167\u7684\u6a21\u7d44\u6a94\u3002\u6a21\u7d44 = {0} -FileImpl._Error_0=\u4e0d\u5141\u8a31\u4e0b\u5217\u7684\u905e\u8ff4\u5305\u542b 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 46694dd67..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/Archive.java +++ /dev/null @@ -1,468 +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 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.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; - - -/** - * @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.internal.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 9e48b06ec..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, 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.ArchiveWrappedException; - - - - -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 06357a86d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonArchiveResourceHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.jst.j2ee.commonarchivecore.internal; - -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2001, 2002 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ - -/* - * Licensed Materials - Property of IBM, - * WebSphere Studio Workbench - * (c) Copyright IBM Corp 2001 - */ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class CommonArchiveResourceHandler { - - private static ResourceBundle fgResourceBundle; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("commonarchive");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String, String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } -} 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 3b80abbd3..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, 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.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.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; - - -/** - * @generated - */ -public interface CommonarchiveFactory extends EFactory { - - /** - * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - CommonarchiveFactory eINSTANCE = new org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl(); - - /** - * 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 83111e661..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/CommonarchivePackage.java +++ /dev/null @@ -1,1024 +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.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - - -/** - * @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 = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int FILE__LAST_MODIFIED = 1; - /** - * @generated This field/method will be replaced during code generation. - */ - int FILE__SIZE = 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 = 3; - - /** - * @generated This field/method will be replaced during code generation. - */ - int FILE__ORIGINAL_URI = 4; - /** - * @generated This field/method will be replaced during code generation. - */ - int FILE__LOADING_CONTAINER = 5; - /** - * @generated This field/method will be replaced during code generation. - */ - int FILE__CONTAINER = 6; - - /** - * The number of structural features of the the '<em>File</em>' class. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int FILE_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 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 = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int MODULE_REF__EAR_FILE = 1; - - /** - * The feature id for the '<em><b>Module</b></em>' reference. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - * @ordered - */ - int MODULE_REF__MODULE = 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 = 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.internal.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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(); - -} //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 b42d0610f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ConnectorModuleRef.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; - - -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException; -import org.eclipse.jst.j2ee.jca.Connector; - - -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 cec50714c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/EJBModuleRef.java +++ /dev/null @@ -1,25 +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.commonarchivecore.internal.exception.ArchiveWrappedException; -import org.eclipse.jst.j2ee.ejb.EJBJar; - - -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 650d9f140..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/File.java +++ /dev/null @@ -1,256 +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.InputStream; - -import org.eclipse.emf.ecore.EObject; - -/** - * @generated - */ -public interface File extends EObject { - - /** - * 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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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.internal.commonarchivecore.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 65678da1f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ModuleRef.java +++ /dev/null @@ -1,178 +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.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.application.Module; -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; - - -public interface ModuleRef extends EObject { - - /** - * 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.internal.commonarchivecore.CommonarchivePackage#getModuleRef_Module() - * @model required="true" - * @generated - */ - Module getModule(); - - /** - * Sets the value of the ' - * {@link org.eclipse.jst.j2ee.internal.commonarchivecore.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 22a3e5f9d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RARFile.java +++ /dev/null @@ -1,66 +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.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.internal.commonarchivecore.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 d7cfe2d19..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/RepairArchiveCommand.java +++ /dev/null @@ -1,159 +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.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.internal.J2EEConstants; - - -/** - * 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.getString("Repairs_all_entries_in_the")); //$NON-NLS-2$ = "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; - } - - 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.getString("Repair_command_failed_-_ex_EXC_")); //$NON-NLS-1$ = "Repair command failed - exception stack trace:" - ex.printStackTrace(); - } - } - - 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.getString("RepairArchiveCommand_usage")); //$NON-NLS-1$ = "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 = new java.util.zip.ZipFile(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.getString("RepairArchiveCommand_usage1_ERROR_")); //$NON-NLS-1$ = "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("repair_usage_ERROR_", (new Object[]{args[1]}))); //$NON-NLS-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 cb6bfb2b8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/ValidateXmlCommand.java +++ /dev/null @@ -1,173 +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.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.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 - */ - 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; - } - - 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 cd3df3232..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WARFile.java +++ /dev/null @@ -1,99 +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.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 bd4a3d2ca..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/WebModuleRef.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; - - -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException; -import org.eclipse.jst.j2ee.webapplication.WebApp; - - -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 fc458b1dd..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveException.java +++ /dev/null @@ -1,32 +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.exception; - - - -/** - * Base exception class for non-runtime exceptions occurring with manipulation of archives - */ -public class ArchiveException extends Exception { - /** - * - */ - 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 8b8ae7827..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveRuntimeException.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.exception; - -import org.eclipse.jst.j2ee.internal.IWrappedException; -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 implements IWrappedException { - /** - * 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 dc7fbe29d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ArchiveWrappedException.java +++ /dev/null @@ -1,58 +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.exception; - -import org.eclipse.jst.j2ee.internal.IWrappedException; -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 implements IWrappedException { - /** - * 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 19025f8b9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DeploymentDescriptorLoadException.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.exception; - - - -/** - * Exception which can occur if an error/exception occurs while loading a deployment descriptor - */ -public class DeploymentDescriptorLoadException extends ArchiveRuntimeException { - /** - * 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 5d0ea62bd..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/DuplicateObjectException.java +++ /dev/null @@ -1,68 +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.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 { - 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 a3c223ad7..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/EmptyResourceException.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.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 { - /** - * 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 a89b2082e..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, 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.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 3eaad7323..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ManifestException.java +++ /dev/null @@ -1,51 +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.exception; - - -public class ManifestException extends ArchiveRuntimeException { - - /** - * 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 a2a7e3e05..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NestedJarException.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.exception; - - - -/** - * Runtime exception thrown when an error occurs reading a jar within a jar - */ -public class NestedJarException extends ArchiveRuntimeException { - - 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 3b062c942..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoEJB10DescriptorsException.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.exception; - - - -/** - * Insert the type's description here. Creation date: (06/05/01 7:31:27 PM) - * - * @author: Administrator - */ -public class NoEJB10DescriptorsException extends RuntimeException { - /** - * 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 3351aa655..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleElementException.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.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 { - /** - * 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 76586b46d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NoModuleFileException.java +++ /dev/null @@ -1,51 +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.exception; - - -public class NoModuleFileException extends ArchiveRuntimeException { - - /** - * 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 5f9d32a2c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotADeploymentDescriptorException.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.exception; - - - -/** - * Insert the type's description here. Creation date: (06/06/01 9:26:43 AM) - * - * @author: Administrator - */ -public class NotADeploymentDescriptorException extends Exception { - /** - * 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 74334854f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/NotSupportedException.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.exception; - - - -public class NotSupportedException extends ArchiveWrappedException { - /** - * 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 52a8170a4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ObjectNotFoundException.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.exception; - - - -/** - * Insert the type's description here. Creation date: (02/08/01 8:33:51 PM) - * - * @author: Administrator - */ -public class ObjectNotFoundException extends ArchiveException { - /** - * 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 90b29d8ef..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/OpenFailureException.java +++ /dev/null @@ -1,58 +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.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 { - /** - * 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 566c7889e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ReopenException.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.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 { - /** - * 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 8e58df5b4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/ResourceLoadException.java +++ /dev/null @@ -1,58 +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.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 { - /** - * 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 860565eb9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SaveFailureException.java +++ /dev/null @@ -1,56 +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.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 { - /** - * 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 a9e9e5c6e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/SubclassResponsibilityException.java +++ /dev/null @@ -1,39 +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.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 { - /** - * SubclassResponsibilityException constructor comment. - */ - public SubclassResponsibilityException() { - super(); - } - - /** - * SubclassResponsibilityException constructor comment. - * - * @param s - * java.lang.String - */ - public SubclassResponsibilityException(String methodName) { - super(CommonArchiveResourceHandler.getString("subclass_responsibilty_EXC_", (new Object[]{methodName}))); //$NON-NLS-1$ = " 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 5f69ebeb5..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/exception/UncontainedModuleFileException.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.exception; - - -/** - * @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 { - /** - * 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 17992efc0..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveInit.java +++ /dev/null @@ -1,58 +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.emf.ecore.EPackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.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; - } - }); - ExtendedEcoreUtil.preRegisterPackage("commonarchive.looseconfig.xmi", new EPackage.Descriptor() { //$NON-NLS-1$ - public EPackage getEPackage() { - return LooseconfigPackage.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 207ebe5f6..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifest.java +++ /dev/null @@ -1,116 +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.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Map; -import java.util.jar.Attributes; - -/** - * Contains the API of - * - * @link java.util.jar.Manifest, along with added helpers - */ -public interface ArchiveManifest { - /** - * Creates a new manifest entry (attributes) for the given name - */ - public void addEntry(String entryName); - - public void addEntry(String entryName, Attributes attr); - - /** - * Adds the key/value pair to the attributes for the given entry name; if the entry does not - * exist, creates a new attributes - */ - public void addEntryAttribute(String entryName, String key, String value); - - /** - * Defaults the version to "1.0" if not already set - */ - public void addVersionIfNecessary(); - - public void appendClassPath(String extension); - - /** - * @see java.util.jar.Manifest#clear - */ - public void clear(); - - /** - * @see java.util.jar.Manifest#getAttributes - */ - public Attributes getAttributes(String name); - - public String getClassPath(); - - public String[] getClassPathTokenized(); - - /** - * @see java.util.jar.Manifest#getEntries - */ - public Map getEntries(); - - public String getEntryAttribute(String entryName, String key); - - /** - * @see java.util.jar.Manifest#getAttributes - */ - public Attributes getMainAttributes(); - - public String getMainClass(); - - /** - * Return the value iff the entry exists in a case-sensitive manner; manifest version is - * required for the manifest to save correctly - */ - public String getManifestVersion(); - - /** - * Add all the entries not already contained in the class path of this manifest - */ - public void mergeClassPath(String[] classPathEntries); - - /** - * @see java.util.jar.Manifest#read - */ - public void read(InputStream is) throws IOException; - - public void removeEntry(String entryName); - - public void removeEntryAttribute(String entryName, Object key); - - public void setClassPath(String aSpaceDelimitedPath); - - public void setMainClass(String className); - - public void setManifestVersion(java.lang.String version); - - /** - * @see java.util.jar.Manifest#write - */ - public void write(OutputStream out) throws IOException; - - /** - * Writes the Manifest to the specified OutputStream, splitting each classpath entry on a line - * by itself. - * - * @param out - * the output stream - * @exception IOException - * if an I/O error has occurred - */ - public void writeSplittingClasspath(OutputStream out) throws IOException; -} 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 75f2cdacb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveManifestImpl.java +++ /dev/null @@ -1,323 +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.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Iterator; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.jar.Attributes; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; - - -/** - * Helper class for manifest files - */ -public class ArchiveManifestImpl extends java.util.jar.Manifest implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest { - /** - * ArchiveManifest constructor comment. - */ - public ArchiveManifestImpl() { - super(); - } - - /** - * ArchiveManifest constructor comment. - * - * @param is - * java.io.InputStream - * @throws java.io.IOException - * The exception description. - */ - public ArchiveManifestImpl(java.io.InputStream is) throws java.io.IOException { - super(is); - } - - /** - * ArchiveManifest constructor comment. - * - * @param man - * java.util.jar.Manifest - */ - public ArchiveManifestImpl(java.util.jar.Manifest man) { - super(man); - } - - /** - * Creates a new manifest entry (attributes) for the given name - */ - public void addEntry(String entryName) { - Attributes attr = new Attributes(); - addEntry(entryName, attr); - } - - public void addEntry(String entryName, Attributes attr) { - getEntries().put(entryName, attr); - } - - /** - * Adds the key/value pair to the attributes for the given entry name; if the entry does not - * exist, creates a new attributes - */ - public void addEntryAttribute(String entryName, String key, String value) { - Attributes attr = getAttributes(entryName); - if (attr == null) - addEntry(entryName); - attr = getAttributes(entryName); - attr.putValue(key, value); - } - - public void addVersionIfNecessary() { - //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 (getManifestVersion() == null || getManifestVersion().equals(""))//$NON-NLS-1$ - setManifestVersion("1.0");//$NON-NLS-1$ - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public void appendClassPath(java.lang.String extension) { - String classPath = getClassPath(); - if (classPath != null) - setClassPath(classPath + " " + extension);//$NON-NLS-1$ - else - setClassPath(extension); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public java.lang.String getClassPath() { - return ArchiveUtil.getValueIgnoreKeyCase(Attributes.Name.CLASS_PATH.toString(), getMainAttributes()); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public java.lang.String[] getClassPathTokenized() { - String classPath = getClassPath(); - if (classPath == null) - return new String[0]; - return org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil.getTokens(classPath); - } - - public String getEntryAttribute(String entryName, String key) { - Attributes attr = getAttributes(entryName); - if (attr == null) - return null; - return attr.getValue(key); - } - - public String getMainClass() { - return ArchiveUtil.getValueIgnoreKeyCase(Attributes.Name.MAIN_CLASS.toString(), getMainAttributes()); - } - - public String getManifestVersion() { - return getMainAttributes().getValue(Attributes.Name.MANIFEST_VERSION); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public void mergeClassPath(java.lang.String[] classPathEntries) { - StringBuffer sb = new StringBuffer(); - java.util.List existing = java.util.Arrays.asList(getClassPathTokenized()); - String cp = getClassPath(); - if (cp != null) - sb.append(cp); - boolean empty = cp == null || "".equals(cp); //$NON-NLS-1$ - for (int i = 0; i < classPathEntries.length; i++) { - if (!existing.contains(classPathEntries[i])) { - if (!empty) - sb.append(" "); //$NON-NLS-1$ - else - empty = false; - sb.append(classPathEntries[i]); - } - } - setClassPath(sb.toString()); - } - - public void removeEntry(String entryName) { - getEntries().remove(entryName); - } - - public void removeEntryAttribute(String entryName, Object key) { - Attributes attr = getAttributes(entryName); - if (attr != null) - attr.remove(key); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public void setClassPath(java.lang.String aSpaceDelimitedPath) { - Attributes attributes = getMainAttributes(); - if (aSpaceDelimitedPath == null) - attributes.remove(Attributes.Name.CLASS_PATH); - else - attributes.putValue(Attributes.Name.CLASS_PATH.toString(), aSpaceDelimitedPath); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public void setMainClass(java.lang.String className) { - Attributes attributes = getMainAttributes(); - if (className == null) - attributes.remove(Attributes.Name.MAIN_CLASS); - else - attributes.putValue(Attributes.Name.MAIN_CLASS.toString(), className); - } - - /** - * @see com.ibm.etools.archive.ArchiveManifest - */ - public void setManifestVersion(java.lang.String version) { - Attributes attributes = getMainAttributes(); - attributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), version); - } - - /** - * Writes the Manifest to the specified OutputStream, splitting each classpath entry on a line - * by itself. - * - * @param out - * the output stream - * @exception IOException - * if an I/O error has occurred - */ - public void writeSplittingClasspath(OutputStream out) throws IOException { - DataOutputStream dos = new DataOutputStream(out); - // Write out the main attributes for the manifest - writeMainSplittingClasspath(getMainAttributes(), dos); - // Now write out the pre-entry attributes - Iterator it = getEntries().entrySet().iterator(); - while (it.hasNext()) { - Map.Entry e = (Map.Entry) it.next(); - StringBuffer buffer = new StringBuffer("Name: "); //$NON-NLS-1$ - buffer.append((String) e.getKey()); - buffer.append("\r\n"); //$NON-NLS-1$ - localMake72Safe(buffer); - dos.writeBytes(buffer.toString()); - write((Attributes) e.getValue(), dos); - } - dos.flush(); - } - - /* - * Writes the current attributes to the specified data output stream. XXX Need to handle UTF8 - * values and break up lines longer than 72 bytes - * - * @see Attributes#write - */ - protected void write(Attributes attributes, DataOutputStream os) throws IOException { - Iterator it = attributes.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry e = (Map.Entry) it.next(); - StringBuffer buffer = new StringBuffer(((Attributes.Name) e.getKey()).toString()); - buffer.append(": "); //$NON-NLS-1$ - buffer.append((String) e.getValue()); - buffer.append("\r\n"); //$NON-NLS-1$ - localMake72Safe(buffer); - os.writeBytes(buffer.toString()); - } - os.writeBytes("\r\n"); //$NON-NLS-1$ - } - - /* - * Writes the current attributes to the specified data output stream, make sure to write out the - * MANIFEST_VERSION or SIGNATURE_VERSION attributes first. - * - * @see Attributes#writeMain - */ - protected void writeMainSplittingClasspath(Attributes attributes, DataOutputStream out) throws IOException { - // write out the *-Version header first, if it exists - String vername = Attributes.Name.MANIFEST_VERSION.toString(); - String version = attributes.getValue(vername); - if (version == null) { - vername = Attributes.Name.SIGNATURE_VERSION.toString(); - version = attributes.getValue(vername); - } - - if (version != null) { - out.writeBytes(vername + ": " + version + "\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // write out all attributes except for the version - // we wrote out earlier - Iterator it = attributes.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry e = (Map.Entry) it.next(); - String name = ((Attributes.Name) e.getKey()).toString(); - if ((version != null) && !(name.equalsIgnoreCase(vername))) { - if (name.equalsIgnoreCase(Attributes.Name.CLASS_PATH.toString())) { - writeSplit(out, name, (String) e.getValue()); - continue; - } - StringBuffer buffer = new StringBuffer(name); - buffer.append(": "); //$NON-NLS-1$ - buffer.append((String) e.getValue()); - buffer.append("\r\n"); //$NON-NLS-1$ - localMake72Safe(buffer); - out.writeBytes(buffer.toString()); - } - } - out.writeBytes("\r\n"); //$NON-NLS-1$ - } - - protected void writeSplit(DataOutputStream out, String name, String value) throws IOException { - StringTokenizer tok = new StringTokenizer(value); - int inc = 0; - while (tok.hasMoreTokens()) { - StringBuffer buffer = null; - if (inc == 0) { - buffer = new StringBuffer(name); - buffer.append(": "); //$NON-NLS-1$ - } else { - buffer = new StringBuffer(); - buffer.append(' '); - } - buffer.append(tok.nextToken()); - if (tok.countTokens() > 0) - buffer.append(" \r\n"); //$NON-NLS-1$ - else - buffer.append("\r\n"); //$NON-NLS-1$ - localMake72Safe(buffer); - out.writeBytes(buffer.toString()); - inc++; - } - } - - /** - * Adds line breaks to enforce a maximum 72 bytes per line. - */ - protected static void localMake72Safe(StringBuffer line) { - int length = line.length(); - if (length > 72) { - int index = 70; - while (index - 1 < length) { - line.insert(index, "\r\n "); //$NON-NLS-1$ - index += 72; - length += 3; - } - } - return; - } - - -} 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 92cdbcf36..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveOptions.java +++ /dev/null @@ -1,226 +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.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; - - /** - * 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 - */ - 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; - } -} 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 7d7b26818..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, 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.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("invalid_archive_EXC_", (new Object[]{archiveType, ddUri})); //$NON-NLS-1$ = "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 c8c032981..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/ArchiveURIConverterImpl.java +++ /dev/null @@ -1,309 +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.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 java.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; - - -/** - * 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; - } - - 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); - } - - public URI normalize(URI uri) { - return getInternalURIMap().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 = new ZipFile(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; - throw m; - } - - /** - * Convert the URI to an output stream. - * - * @param uri - * The uri - */ - 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 7fb9b7c73..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/FileExtensionsFilterImpl.java +++ /dev/null @@ -1,143 +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 implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.SaveFilter { - 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 - */ - 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 7433f940e..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, 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 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.getString("End_of_list_reached_EXC_")); //$NON-NLS-1$ = "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 7de9773bf..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/NestedArchiveIterator.java +++ /dev/null @@ -1,77 +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.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); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see java.io.FilterInputStream#close() - */ - 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; - } - - public InputStream getInputStream(File aFile) throws java.io.IOException, java.io.FileNotFoundException { - if (!aFile.getURI().equals(currentEntry.getName())) - throw new java.io.IOException(CommonArchiveResourceHandler.getString("Internal_Error__Iterator_o_EXC_")); //$NON-NLS-1$ = "Internal Error: Iterator out of sync with zip entries" - return new WrapperInputStream(zipInputStream); - } - - public File next() { - File next = super.next(); - try { - do { - currentEntry = zipInputStream.getNextEntry(); - } while (currentEntry.isDirectory()); - } catch (java.io.IOException ex) { - throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString("Error_iterating_the_archiv_EXC_"), ex); //$NON-NLS-1$ = "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 a28a3b9c4..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 = (EObject) ((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 caf60cb51..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/RuntimeClasspathEntryImpl.java +++ /dev/null @@ -1,135 +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; - } - - public String toString() { - return getAbsolutePath(); - } - - public boolean equals(Object o) { - if (o instanceof RuntimeClasspathEntry) - return getAbsolutePath().equals(((RuntimeClasspathEntry) o).getAbsolutePath()); - return false; - } - - 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 a05828fae..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SaveFilter.java +++ /dev/null @@ -1,28 +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; - -/** - * 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 4b81f724d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/helpers/SelectedFilesFilterImpl.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.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; - } - - 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 3eef77b31..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, 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 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 d7ada6b70..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ApplicationClientFileImpl.java +++ /dev/null @@ -1,359 +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 java.util.Collection; - -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.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ApplicationClientFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Container; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.client.ClientPackage; -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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getApplicationClientFile(); - } - - /** - * @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 - */ - 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 - */ - public boolean isApplicationClientFile() { - return true; - } - - public boolean isDeploymentDescriptorSet() { - return deploymentDescriptor != null; - } - - /** - * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl - */ - 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); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER, msgs); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER, msgs); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__URI : - return getURI(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - return getFiles(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__TYPES : - return getTypes(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR : - if (resolve) - return getDeploymentDescriptor(); - return basicGetDeploymentDescriptor(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__TYPES : - return types != null && !types.isEmpty(); - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR : - return deploymentDescriptor != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((ApplicationClient) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.APPLICATION_CLIENT_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__TYPES : - getTypes().clear(); - return; - case CommonarchivePackage.APPLICATION_CLIENT_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((ApplicationClient) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public ApplicationClient getDeploymentDescriptorGen() { - if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) { - ApplicationClient oldDeploymentDescriptor = deploymentDescriptor; - deploymentDescriptor = (ApplicationClient) EcoreUtil.resolve(deploymentDescriptor, this); - 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)); - } - -} 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 cf4868ec2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopySessionUtility.java +++ /dev/null @@ -1,108 +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 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.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 { - public EObject copy(EObject aRefObject, String idSuffix) { - EObject copied = super.copy(aRefObject, idSuffix); - if (copied instanceof ContainerManagedEntity) - copyPrimKeyInfo((ContainerManagedEntity) aRefObject, (ContainerManagedEntity) copied); - return copied; - } - - 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) - */ - 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; - } - - 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; - } - - 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) - */ - - protected void copyReference(EReference aReference, EObject aRefObject, String idSuffix, EObject copyRef) { - if (aReference.isMany()) { - 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); - } - } - -} 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 95f69034b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveCopyUtility.java +++ /dev/null @@ -1,239 +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 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.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.internal.common.util.Defaultable; -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. - */ - - 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.getString("IOException_occurred_while_EXC_"), iox); //$NON-NLS-1$ = "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. - */ - public void copy(CopyGroup aGroup) { - if (aGroup != null) { - EtoolsCopySession session = new ArchiveCopySessionUtility(this); - session.setPreserveIds(aGroup.getPreserveIds()); - session.copy(aGroup); - session.flush(); - } - } - - public EObject copy(EObject aRefObject, String idSuffix) { - EtoolsCopySession session = new ArchiveCopySessionUtility(this); - EObject copied = session.copy(aRefObject, idSuffix); - session.flush(); - return copied; - } - - 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)); - } - - 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 8d53a8031..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ArchiveImpl.java +++ /dev/null @@ -1,1602 +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 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.notify.NotificationChain; -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.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -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.emf.ecore.util.InternalEList; -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.looseconfig.LooseArchive; -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.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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getArchive(); - } - - /** - * <!-- 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.ARCHIVE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.ARCHIVE__CONTAINER, msgs); - case CommonarchivePackage.ARCHIVE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.ARCHIVE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.ARCHIVE__CONTAINER, msgs); - case CommonarchivePackage.ARCHIVE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.ARCHIVE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.ARCHIVE__URI : - return getURI(); - case CommonarchivePackage.ARCHIVE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.ARCHIVE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.ARCHIVE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.ARCHIVE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.ARCHIVE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.ARCHIVE__CONTAINER : - return getContainer(); - case CommonarchivePackage.ARCHIVE__FILES : - return getFiles(); - case CommonarchivePackage.ARCHIVE__TYPES : - return getTypes(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.ARCHIVE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.ARCHIVE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.ARCHIVE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.ARCHIVE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.ARCHIVE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.ARCHIVE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.ARCHIVE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.ARCHIVE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.ARCHIVE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.ARCHIVE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.ARCHIVE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.ARCHIVE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.ARCHIVE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.ARCHIVE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.ARCHIVE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.ARCHIVE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.ARCHIVE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.ARCHIVE__TYPES : - getTypes().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.ARCHIVE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.ARCHIVE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.ARCHIVE__SIZE : - return isSetSize(); - case CommonarchivePackage.ARCHIVE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.ARCHIVE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.ARCHIVE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.ARCHIVE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.ARCHIVE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.ARCHIVE__TYPES : - return types != null && !types.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - 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("duplicate_file_EXC_", (new Object[]{getURI(), aUri})), f); //$NON-NLS-1$ = "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("unable_replace_EXC_", (new Object[]{original.getAbsolutePath()}))); //$NON-NLS-1$ = "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("unable_replace_EXC_", (new Object[]{original.getAbsolutePath()}))); //$NON-NLS-1$ = "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("file_exist_as_dir_EXC_", (new Object[]{aFile.getAbsolutePath()})));//$NON-NLS-1$ = "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("error_saving_EXC_", (new Object[]{uri})), ex); //$NON-NLS-1$ = "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.getString("Extract_destination_is_the_EXC_")); //$NON-NLS-1$ = "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("error_saving_EXC_", (new Object[]{aUri})), ex); //$NON-NLS-1$ = "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 - */ - 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("io_ex_manifest_EXC_", (new Object[]{getURI()})), ex); //$NON-NLS-1$ = "An IOException occurred reading the manifest: " - } catch (IOException ex) { - throw new ManifestException(CommonArchiveResourceHandler.getString("io_ex_manifest_EXC_", (new Object[]{getURI()})), ex); //$NON-NLS-1$ = "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 - */ - 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("duplicate_entry_EXC_", (new Object[]{aUri, getURI()}))); //$NON-NLS-1$ = "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("io_ex_reopen_EXC_", (new Object[]{getURI()})), ex); //$NON-NLS-1$ = "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("error_saving_EXC_", (new Object[]{aUri})), ex); //$NON-NLS-1$ = "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("load_resource_EXC_", (new Object[]{resourceUri, getURI()})), ex); //$NON-NLS-1$ = "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() { - String absolutePath = internalGetBinariesPath(); - if (absolutePath == null) - return emptyClasspath(); - String parentPath = new java.io.File(absolutePath).getParentFile().getAbsolutePath(); - 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()]); - } - - 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 ae274d6c1..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ClientModuleRefImpl.java +++ /dev/null @@ -1,193 +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.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.jst.j2ee.application.Module; -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.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.ArchiveWrappedException; - - -public class ClientModuleRefImpl extends ModuleRefImpl implements ClientModuleRef, ModuleRef { - /** - * @generated This field/method will be replaced during code generation. - */ - protected ClientModuleRefImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getClientModuleRef(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - return eBasicSetContainer(null, CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - return eContainer.eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE_FILE : - if (resolve) - return getModuleFile(); - return basicGetModuleFile(); - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - return getEarFile(); - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE : - if (resolve) - return getModule(); - return basicGetModule(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) newValue); - return; - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - setEarFile((EARFile) newValue); - return; - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE : - setModule((Module) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) null); - return; - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - setEarFile((EARFile) null); - return; - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE : - setModule((Module) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE_FILE : - return moduleFile != null; - case CommonarchivePackage.CLIENT_MODULE_REF__EAR_FILE : - return getEarFile() != null; - case CommonarchivePackage.CLIENT_MODULE_REF__MODULE : - return module != null; - } - return eDynamicIsSet(eFeature); - } - - public ApplicationClient getApplicationClient() throws ArchiveWrappedException { - return (ApplicationClient) getDeploymentDescriptor(); - } - - - /* - * @see ModuleRef#isClient() - */ - 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 b20034dc7..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchiveFactoryImpl.java +++ /dev/null @@ -1,1071 +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 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.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.impl.EFactoryImpl; -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.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.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.looseconfig.LooseArchive; -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; - - -/** - * @generated - */ -public class CommonarchiveFactoryImpl extends EFactoryImpl implements CommonarchiveFactory { - - - 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() { - - public ApplicationClientFile createApplicationClientFile() { - return createApplicationClientFileGen(); - } - - - public ClientModuleRef createClientModuleRef() { - return createClientModuleRefGen(); - } - - public ConnectorModuleRef createConnectorModuleRef() { - return createConnectorModuleRefGen(); - } - - public EARFile createEARFile() { - return createEARFileGen(); - } - - public EJBJarFile createEJBJarFile() { - return createEJBJarFileGen(); - } - - public EJBModuleRef createEJBModuleRef() { - return createEJBModuleRefGen(); - } - - public RARFile createRARFile() { - return createRARFileGen(); - } - - public WARFile createWARFile() { - return createWARFileGen(); - } - - public WebModuleRef createWebModuleRef() { - return createWebModuleRefGen(); - } - }; - } - - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - 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; - 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("file_not_found_EXC_", (new Object[]{uri, file.getAbsolutePath()}))); //$NON-NLS-1$ = "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); - tempFile.deleteOnExit(); - 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("make_temp_file_WARN_", (new Object[]{uri})) + ex.getLocalizedMessage()); //$NON-NLS-1$ = "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 = new WeakHashMap(); - return openArchives; - } - - /** - * @see com.ibm.etools.commonarchive.CommonarchiveFactory - */ - public Set getOpenArchivesDependingOn(Archive anArchive) { - Set dependents = new HashSet(); - 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; - 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 { - 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("open_nested_EXC_", (new Object[]{uri, parent.getURI()})), ex); //$NON-NLS-1$ = "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("open_nested_EXC_", (new Object[]{uri, parent.getURI()})), ex); //$NON-NLS-1$ = "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("could_not_find_dir_EXC_", (new Object[]{uri}))); //$NON-NLS-1$ = "Unable to open directory " - if (!aFile.isDirectory()) - throw new IOException(CommonArchiveResourceHandler.getString("not_a_dir_EXC_", (new Object[]{uri}))); //$NON-NLS-1$ = "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("could_not_open_EXC_", (new Object[]{uri})), ex); //$NON-NLS-1$ = "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 --> - * - * @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 b6413825d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/CommonarchivePackageImpl.java +++ /dev/null @@ -1,635 +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.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.impl.EPackageImpl; -import org.eclipse.emf.ecore.impl.EcorePackageImpl; -import org.eclipse.jem.java.impl.JavaRefPackageImpl; -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.looseconfig.LooseconfigPackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.impl.LooseconfigPackageImpl; -import org.eclipse.jst.j2ee.internal.application.ApplicationPackage; -import org.eclipse.jst.j2ee.internal.application.impl.ApplicationPackageImpl; -import org.eclipse.jst.j2ee.internal.client.ClientPackage; -import org.eclipse.jst.j2ee.internal.client.impl.ClientPackageImpl; -import org.eclipse.jst.j2ee.internal.common.impl.CommonPackageImpl; -import org.eclipse.jst.j2ee.internal.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.ejb.impl.EjbPackageImpl; -import org.eclipse.jst.j2ee.internal.jca.JcaPackage; -import org.eclipse.jst.j2ee.internal.jca.impl.JcaPackageImpl; -import org.eclipse.jst.j2ee.internal.jsp.impl.JspPackageImpl; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.internal.webapplication.impl.WebapplicationPackageImpl; -import org.eclipse.jst.j2ee.webservice.internal.wsclient.impl.Webservice_clientPackageImpl; - - -/** - * @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.getEPackage(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new CommonarchivePackageImpl()); - - isInited = true; - - // Initialize simple dependencies - JcaPackageImpl.init(); - Webservice_clientPackageImpl.init(); - EcorePackageImpl.init(); - JavaRefPackageImpl.init(); - CommonPackageImpl.init(); - ClientPackageImpl.init(); - WebapplicationPackageImpl.init(); - EjbPackageImpl.init(); - JspPackageImpl.init(); - ApplicationPackageImpl.init(); - - // Obtain or create and register interdependencies - LooseconfigPackageImpl theLooseconfigPackage = (LooseconfigPackageImpl) (EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI) : LooseconfigPackage.eINSTANCE); - - // Step 1: create meta-model objects - theCommonarchivePackage.createPackageContents(); - theLooseconfigPackage.createPackageContents(); - - // Step 2: complete initialization - theCommonarchivePackage.initializePackageContents(); - theLooseconfigPackage.initializePackageContents(); - - 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.getEReferences().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.getEReferences().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.getEReferences().get(1); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getEARFile_ModuleRefs() { - return (EReference) earFileEClass.getEReferences().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.getEReferences().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getModuleRef_EarFile() { - return (EReference) moduleRefEClass.getEReferences().get(1); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public EReference getModuleRef_Module() { - return (EReference) moduleRefEClass.getEReferences().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.getEReferences().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.getEReferences().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.getEReferences().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.getEAttributes().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.getEAttributes().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getFile_LastModified() { - return (EAttribute) fileEClass.getEAttributes().get(1); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getFile_Size() { - return (EAttribute) fileEClass.getEAttributes().get(2); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public EAttribute getFile_DirectoryEntry() { - return (EAttribute) fileEClass.getEAttributes().get(3); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getFile_OriginalURI() { - return (EAttribute) fileEClass.getEAttributes().get(4); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getFile_LoadingContainer() { - return (EReference) fileEClass.getEReferences().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getFile_Container() { - return (EReference) fileEClass.getEReferences().get(1); - } - - /** - * @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 - LooseconfigPackageImpl theLooseconfigPackage = (LooseconfigPackageImpl) EPackage.Registry.INSTANCE.getEPackage(LooseconfigPackage.eNS_URI); - EjbPackageImpl theEjbPackage = (EjbPackageImpl) EPackage.Registry.INSTANCE.getEPackage(EjbPackage.eNS_URI); - WebapplicationPackageImpl theWebapplicationPackage = (WebapplicationPackageImpl) EPackage.Registry.INSTANCE.getEPackage(WebapplicationPackage.eNS_URI); - ApplicationPackageImpl theApplicationPackage = (ApplicationPackageImpl) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI); - ClientPackageImpl theClientPackage = (ClientPackageImpl) EPackage.Registry.INSTANCE.getEPackage(ClientPackage.eNS_URI); - JcaPackageImpl theJcaPackage = (JcaPackageImpl) EPackage.Registry.INSTANCE.getEPackage(JcaPackage.eNS_URI); - - // Add subpackages - getESubpackages().add(theLooseconfigPackage); - - // Add supertypes to classes - 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()); - 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); //$NON-NLS-1$ - initEAttribute(getFile_URI(), ecorePackage.getEString(), "URI", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getFile_LastModified(), ecorePackage.getELong(), "lastModified", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getFile_Size(), ecorePackage.getELong(), "size", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getFile_DirectoryEntry(), ecorePackage.getEBoolean(), "directoryEntry", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getFile_OriginalURI(), ecorePackage.getEString(), "originalURI", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getFile_LoadingContainer(), this.getContainer(), null, "loadingContainer", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getFile_Container(), this.getContainer(), this.getContainer_Files(), "container", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(archiveEClass, Archive.class, "Archive", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEAttribute(getArchive_Types(), ecorePackage.getEString(), "types", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(ejbJarFileEClass, EJBJarFile.class, "EJBJarFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getEJBJarFile_DeploymentDescriptor(), theEjbPackage.getEJBJar(), null, "deploymentDescriptor", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(warFileEClass, WARFile.class, "WARFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getWARFile_DeploymentDescriptor(), theWebapplicationPackage.getWebApp(), null, "deploymentDescriptor", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(earFileEClass, EARFile.class, "EARFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getEARFile_ModuleRefs(), this.getModuleRef(), this.getModuleRef_EarFile(), "moduleRefs", null, 1, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getEARFile_DeploymentDescriptor(), theApplicationPackage.getApplication(), null, "deploymentDescriptor", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(applicationClientFileEClass, ApplicationClientFile.class, "ApplicationClientFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getApplicationClientFile_DeploymentDescriptor(), theClientPackage.getApplicationClient(), null, "deploymentDescriptor", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(moduleFileEClass, ModuleFile.class, "ModuleFile", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - initEClass(containerEClass, Container.class, "Container", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getContainer_Files(), this.getFile(), this.getFile_Container(), "files", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(readOnlyDirectoryEClass, ReadOnlyDirectory.class, "ReadOnlyDirectory", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - initEClass(rarFileEClass, RARFile.class, "RARFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getRARFile_DeploymentDescriptor(), theJcaPackage.getConnector(), null, "deploymentDescriptor", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(moduleRefEClass, ModuleRef.class, "ModuleRef", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getModuleRef_ModuleFile(), this.getModuleFile(), null, "moduleFile", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getModuleRef_EarFile(), this.getEARFile(), this.getEARFile_ModuleRefs(), "earFile", null, 1, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getModuleRef_Module(), theApplicationPackage.getModule(), null, "module", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(ejbModuleRefEClass, EJBModuleRef.class, "EJBModuleRef", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - initEClass(webModuleRefEClass, WebModuleRef.class, "WebModuleRef", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - initEClass(clientModuleRefEClass, ClientModuleRef.class, "ClientModuleRef", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - initEClass(connectorModuleRefEClass, ConnectorModuleRef.class, "ConnectorModuleRef", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - - // Create resource - createResource(eNS_URI); - } -} //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 dff058cea..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ConnectorModuleRefImpl.java +++ /dev/null @@ -1,192 +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.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.jst.j2ee.application.Module; -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.ModuleFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleRef; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException; -import org.eclipse.jst.j2ee.jca.Connector; - - -public class ConnectorModuleRefImpl extends ModuleRefImpl implements ConnectorModuleRef, ModuleRef { - /** - * @generated This field/method will be replaced during code generation. - */ - protected ConnectorModuleRefImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getConnectorModuleRef(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - return eBasicSetContainer(null, CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - return eContainer.eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE_FILE : - if (resolve) - return getModuleFile(); - return basicGetModuleFile(); - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - return getEarFile(); - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE : - if (resolve) - return getModule(); - return basicGetModule(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) newValue); - return; - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - setEarFile((EARFile) newValue); - return; - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE : - setModule((Module) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) null); - return; - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - setEarFile((EARFile) null); - return; - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE : - setModule((Module) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE_FILE : - return moduleFile != null; - case CommonarchivePackage.CONNECTOR_MODULE_REF__EAR_FILE : - return getEarFile() != null; - case CommonarchivePackage.CONNECTOR_MODULE_REF__MODULE : - return module != null; - } - return eDynamicIsSet(eFeature); - } - - public Connector getConnector() throws ArchiveWrappedException { - return (Connector) getDeploymentDescriptor(); - } - - /* - * @see ModuleRef#isConnector() - */ - 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 d20d834ac..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ContainerImpl.java +++ /dev/null @@ -1,513 +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 java.util.Collection; -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.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.EStructuralFeature; -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 { - 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); - } - - 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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getContainer(); - } - - /** - * @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(); - } - File file = (File) getFileIndex().get(URI); - 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; - } - - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CONTAINER__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.CONTAINER__CONTAINER, msgs); - case CommonarchivePackage.CONTAINER__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.CONTAINER__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.CONTAINER__CONTAINER, msgs); - case CommonarchivePackage.CONTAINER__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.CONTAINER__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONTAINER__URI : - return getURI(); - case CommonarchivePackage.CONTAINER__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.CONTAINER__SIZE : - return new Long(getSize()); - case CommonarchivePackage.CONTAINER__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.CONTAINER__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.CONTAINER__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.CONTAINER__CONTAINER : - return getContainer(); - case CommonarchivePackage.CONTAINER__FILES : - return getFiles(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONTAINER__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.CONTAINER__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.CONTAINER__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.CONTAINER__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.CONTAINER__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.CONTAINER__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.CONTAINER__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.CONTAINER__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONTAINER__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.CONTAINER__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.CONTAINER__SIZE : - unsetSize(); - return; - case CommonarchivePackage.CONTAINER__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.CONTAINER__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.CONTAINER__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.CONTAINER__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.CONTAINER__FILES : - getFiles().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.CONTAINER__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.CONTAINER__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.CONTAINER__SIZE : - return isSetSize(); - case CommonarchivePackage.CONTAINER__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.CONTAINER__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.CONTAINER__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.CONTAINER__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.CONTAINER__FILES : - return files != null && !files.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - 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 f24c11216..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EARFileImpl.java +++ /dev/null @@ -1,1324 +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 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.EStructuralFeature; -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.EcoreUtil; -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.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.Archive; -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.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.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -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.EnterpriseBean; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.application.ApplicationPackage; -import org.eclipse.jst.j2ee.internal.client.impl.ApplicationClientResourceFactory; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.common.impl.J2EEResourceFactoryRegistry; -import org.eclipse.jst.j2ee.internal.ejb.EjbPackage; -import org.eclipse.jst.j2ee.internal.ejb.impl.EJBJarResourceFactory; -import org.eclipse.jst.j2ee.internal.jca.impl.ConnectorResourceFactory; -import org.eclipse.jst.j2ee.internal.webapplication.impl.WebAppResourceFactory; -import org.eclipse.jst.j2ee.jca.Connector; -import org.eclipse.jst.j2ee.webapplication.WebApp; -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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getEARFile(); - } - - 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 (ModuleFile) 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("dd_in_ear_load_EXC_", (new Object[]{aModule.getUri(), getURI()})), e); //$NON-NLS-1$ = "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("dup_sec_role_module_EXC_", (new Object[]{aModule.getUri(), roleName})), ejbJar.getAssemblyDescriptor().getSecurityRoleNamed(roleName)); //$NON-NLS-1$ = "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("dup_sec_role_module_EXC_", (new Object[]{aModule.getUri(), roleName})), webApp.getSecurityRoleNamed(roleName));//$NON-NLS-1$ = "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("dup_resource_EXC_", (new Object[]{aUri, getURI()}))); //$NON-NLS-1$ = "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(); - } - 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 - */ - 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 { - 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("dd_in_ear_load_EXC_", (new Object[]{aModule.getUri(), getURI()})), e); //$NON-NLS-1$ = "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; - } - - public void initializeAfterOpen() { - super.initializeAfterOpen(); - } - - public boolean isDeploymentDescriptorSet() { - return deploymentDescriptor != null; - } - - /** - * @see com.ibm.etools.commonarchive.File - */ - public boolean isEARFile() { - return true; - } - - /** - * Return true if super returns true, or return whether the app dd contains a module having the - * uri - */ - public boolean isNestedArchive(String aUri) { - if (super.isNestedArchive(aUri)) - return true; - return getDeploymentDescriptor().getFirstModule(aUri) != null; - } - - /** - * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl - */ - 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 - */ - 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 - */ - 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("nested_open_fail_EXC_", (new Object[]{aUri, getURI()})), ex); //$NON-NLS-1$ = "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.getString("Parameter_should_not_be_nu_EXC_")); //$NON-NLS-1$ = "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("dd_in_ear_load_EXC_", (new Object[]{aModule.getUri(), getURI()})), e); //$NON-NLS-1$ = "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(); - ((J2EEResourceFactoryRegistry) 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("dd_in_ear_load_EXC_", (new Object[]{m.getUri(), getURI()})), e); //$NON-NLS-1$ = "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("no_sec_role_EXC_", (new Object[]{getURI(), existingRoleName}))); //$NON-NLS-1$ = ": EAR File deployment descriptor does not contain a security role named " - if (app.getSecurityRoleNamed(newRoleName) != null) - throw new DuplicateObjectException(CommonArchiveResourceHandler.getString("dup_sec_role_EXC_", (new Object[]{getURI(), newRoleName})), app.getSecurityRoleNamed(newRoleName)); //$NON-NLS-1$ = ": 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("dd_in_ear_load_EXC_", (new Object[]{aModule.getUri(), getURI()})), e); //$NON-NLS-1$ = "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 boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EAR_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.EAR_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.EAR_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.EAR_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.EAR_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.EAR_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.EAR_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.EAR_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.EAR_FILE__TYPES : - return types != null && !types.isEmpty(); - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - return moduleRefs != null && !moduleRefs.isEmpty(); - case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR : - return deploymentDescriptor != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EAR_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.EAR_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.EAR_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.EAR_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.EAR_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.EAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.EAR_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.EAR_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.EAR_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - getModuleRefs().clear(); - getModuleRefs().addAll((Collection) newValue); - return; - case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((Application) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EAR_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.EAR_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.EAR_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.EAR_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.EAR_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.EAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.EAR_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.EAR_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.EAR_FILE__TYPES : - getTypes().clear(); - return; - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - getModuleRefs().clear(); - return; - case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((Application) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public Application getDeploymentDescriptorGen() { - if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) { - Application oldDeploymentDescriptor = deploymentDescriptor; - deploymentDescriptor = (Application) EcoreUtil.resolve(deploymentDescriptor, this); - 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)); - } - - /** - * @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; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EAR_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.EAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.EAR_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - return ((InternalEList) getModuleRefs()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EAR_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.EAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.EAR_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - return ((InternalEList) getModuleRefs()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.EAR_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EAR_FILE__URI : - return getURI(); - case CommonarchivePackage.EAR_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.EAR_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.EAR_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.EAR_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.EAR_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.EAR_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.EAR_FILE__FILES : - return getFiles(); - case CommonarchivePackage.EAR_FILE__TYPES : - return getTypes(); - case CommonarchivePackage.EAR_FILE__MODULE_REFS : - return getModuleRefs(); - case CommonarchivePackage.EAR_FILE__DEPLOYMENT_DESCRIPTOR : - if (resolve) - return getDeploymentDescriptor(); - return basicGetDeploymentDescriptor(); - } - return eDynamicGet(eFeature, resolve); - } - - 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(); - - 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 81b8404b7..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBJarFileImpl.java +++ /dev/null @@ -1,418 +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 java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -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.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -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.EJBJarFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException; -import org.eclipse.jst.j2ee.ejb.EJBJar; -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; -import org.eclipse.jst.j2ee.internal.ejb.EjbPackage; - - -/** - * @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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getEJBJarFile(); - } - - /** - * 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(); - } - - public java.lang.String getDeploymentDescriptorUri() { - return J2EEConstants.EJBJAR_DD_URI; - } - - /** - * Return the DeployementDescriptor. - */ - public EObject getStandardDeploymentDescriptor() throws DeploymentDescriptorLoadException { - return getDeploymentDescriptor(); - } - - public boolean isDeploymentDescriptorSet() { - return deploymentDescriptor != null; - } - - /** - * @see com.ibm.etools.commonarchive.File - */ - 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 - */ - 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 boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_JAR_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.EJB_JAR_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.EJB_JAR_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.EJB_JAR_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.EJB_JAR_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.EJB_JAR_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.EJB_JAR_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.EJB_JAR_FILE__TYPES : - return types != null && !types.isEmpty(); - case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR : - return deploymentDescriptor != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_JAR_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.EJB_JAR_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.EJB_JAR_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.EJB_JAR_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((EJBJar) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_JAR_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.EJB_JAR_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.EJB_JAR_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.EJB_JAR_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.EJB_JAR_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.EJB_JAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.EJB_JAR_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.EJB_JAR_FILE__TYPES : - getTypes().clear(); - return; - case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((EJBJar) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public EJBJar getDeploymentDescriptorGen() { - if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) { - EJBJar oldDeploymentDescriptor = deploymentDescriptor; - deploymentDescriptor = (EJBJar) EcoreUtil.resolve(deploymentDescriptor, this); - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.EJB_JAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.EJB_JAR_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.EJB_JAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.EJB_JAR_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_JAR_FILE__URI : - return getURI(); - case CommonarchivePackage.EJB_JAR_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.EJB_JAR_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.EJB_JAR_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.EJB_JAR_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.EJB_JAR_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.EJB_JAR_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.EJB_JAR_FILE__FILES : - return getFiles(); - case CommonarchivePackage.EJB_JAR_FILE__TYPES : - return getTypes(); - case CommonarchivePackage.EJB_JAR_FILE__DEPLOYMENT_DESCRIPTOR : - if (resolve) - return getDeploymentDescriptor(); - return basicGetDeploymentDescriptor(); - } - return eDynamicGet(eFeature, resolve); - } - -} 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 c1d6efaa2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/EJBModuleRefImpl.java +++ /dev/null @@ -1,194 +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.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.EJBModuleRef; -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.ejb.EJBJar; - - -public class EJBModuleRefImpl extends ModuleRefImpl implements EJBModuleRef, ModuleRef { - - - /** - * @generated This field/method will be replaced during code generation. - */ - protected EJBModuleRefImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getEJBModuleRef(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.EJB_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - return eBasicSetContainer(null, CommonarchivePackage.EJB_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - return eContainer.eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_MODULE_REF__MODULE_FILE : - if (resolve) - return getModuleFile(); - return basicGetModuleFile(); - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - return getEarFile(); - case CommonarchivePackage.EJB_MODULE_REF__MODULE : - if (resolve) - return getModule(); - return basicGetModule(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) newValue); - return; - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - setEarFile((EARFile) newValue); - return; - case CommonarchivePackage.EJB_MODULE_REF__MODULE : - setModule((Module) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) null); - return; - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - setEarFile((EARFile) null); - return; - case CommonarchivePackage.EJB_MODULE_REF__MODULE : - setModule((Module) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.EJB_MODULE_REF__MODULE_FILE : - return moduleFile != null; - case CommonarchivePackage.EJB_MODULE_REF__EAR_FILE : - return getEarFile() != null; - case CommonarchivePackage.EJB_MODULE_REF__MODULE : - return module != null; - } - return eDynamicIsSet(eFeature); - } - - public EJBJar getEJBJar() throws ArchiveWrappedException { - return (EJBJar) getDeploymentDescriptor(); - } - - /* - * @see ModuleRef#isEJB() - */ - 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 9ba124a06..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/FileImpl.java +++ /dev/null @@ -1,680 +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.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -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.Container; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; - - - -/** - * @generated - */ -public class FileImpl extends EObjectImpl 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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getFile(); - } - - 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()) { - Container oldLoadingContainer = loadingContainer; - loadingContainer = (Container) EcoreUtil.resolve(loadingContainer, this); - 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; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setContainer(Container newContainer) { - if (newContainer != eContainer || (eContainerFeatureID != CommonarchivePackage.FILE__CONTAINER && newContainer != null)) { - if (EcoreUtil.isAncestor(this, newContainer)) - throw new IllegalArgumentException(CommonArchiveResourceHandler.getString("FileImpl._Error_0") + toString()); //$NON-NLS-1$ - NotificationChain msgs = null; - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newContainer != null) - msgs = ((InternalEObject) newContainer).eInverseAdd(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - msgs = eBasicSetContainer((InternalEObject) newContainer, CommonarchivePackage.FILE__CONTAINER, 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.FILE__CONTAINER, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.FILE__CONTAINER, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - 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 b5909a331..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleFileImpl.java +++ /dev/null @@ -1,408 +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 java.io.FileNotFoundException; -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.resource.Resource; -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.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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getModuleFile(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.MODULE_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.MODULE_FILE__CONTAINER, msgs); - case CommonarchivePackage.MODULE_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.MODULE_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.MODULE_FILE__CONTAINER, msgs); - case CommonarchivePackage.MODULE_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.MODULE_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.MODULE_FILE__URI : - return getURI(); - case CommonarchivePackage.MODULE_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.MODULE_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.MODULE_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.MODULE_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.MODULE_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.MODULE_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.MODULE_FILE__FILES : - return getFiles(); - case CommonarchivePackage.MODULE_FILE__TYPES : - return getTypes(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.MODULE_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.MODULE_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.MODULE_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.MODULE_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.MODULE_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.MODULE_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.MODULE_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.MODULE_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.MODULE_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.MODULE_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.MODULE_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.MODULE_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.MODULE_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.MODULE_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.MODULE_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.MODULE_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.MODULE_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.MODULE_FILE__TYPES : - getTypes().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.MODULE_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.MODULE_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.MODULE_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.MODULE_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.MODULE_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.MODULE_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.MODULE_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.MODULE_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.MODULE_FILE__TYPES : - return types != null && !types.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - 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 - */ - 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 - */ - 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; - } - - 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 4d12cbb9b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ModuleRefImpl.java +++ /dev/null @@ -1,544 +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 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.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -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.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.util.ArchiveUtil; - - -public class ModuleRefImpl extends EObjectImpl implements ModuleRef, EObject { - /** - * @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() - * @generated - * @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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getModuleRef(); - } - - 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()) { - ModuleFile oldModuleFile = moduleFile; - moduleFile = (ModuleFile) EcoreUtil.resolve(moduleFile, this); - 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()); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicUnset(eFeature); - } - - 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; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setEarFile(EARFile newEarFile) { - if (newEarFile != eContainer || (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 (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newEarFile != null) - msgs = ((InternalEObject) newEarFile).eInverseAdd(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - msgs = eBasicSetContainer((InternalEObject) newEarFile, CommonarchivePackage.MODULE_REF__EAR_FILE, msgs); - if (msgs != null) - msgs.dispatch(); - } else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CommonarchivePackage.MODULE_REF__EAR_FILE, newEarFile, newEarFile)); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.MODULE_REF__EAR_FILE : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.MODULE_REF__EAR_FILE : - return eBasicSetContainer(null, CommonarchivePackage.MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.MODULE_REF__EAR_FILE : - return eContainer.eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicGet(eFeature, resolve); - } - - /** - * 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("Module_not_in_EAR", new Object[]{getUri()})); //$NON-NLS-1$ - } - - /** - * @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("Module_file_does_not_exist_2", new Object[]{getUri()})); //$NON-NLS-1$ - } - - protected void checkType(Module moduleDescriptor, File aFile) { - if (aFile == null) { - String message = CommonArchiveResourceHandler.getString("A_file_does_not_exist_for_module", new Object[]{moduleDescriptor.getUri()}); //$NON-NLS-1$ - throw new NoModuleFileException(message); - } - //Added for defect 113929 - boolean isValid = true; - String type = CommonArchiveResourceHandler.getString("Module_file"); //$NON-NLS-1$ - if (moduleDescriptor.isWebModule() && !aFile.isWARFile()) { - isValid = false; - type = CommonArchiveResourceHandler.getString("A_WAR_file"); //$NON-NLS-1$ - } else if (moduleDescriptor.isEjbModule() && !aFile.isEJBJarFile()) { - isValid = false; - type = CommonArchiveResourceHandler.getString("An_EJB_JAR_file"); //$NON-NLS-1$ - } else if (moduleDescriptor.isJavaModule() && !aFile.isApplicationClientFile()) { - isValid = false; - type = CommonArchiveResourceHandler.getString("An_Application_Client_JAR_file"); //$NON-NLS-1$ - } else if (moduleDescriptor.isConnectorModule() && !aFile.isRARFile()) { - isValid = false; - type = CommonArchiveResourceHandler.getString("A_RAR_file"); //$NON-NLS-1$ - } 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 947cdd471..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RARFileImpl.java +++ /dev/null @@ -1,402 +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 java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.InternalEList; -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.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.internal.jca.JcaPackage; -import org.eclipse.jst.j2ee.jca.Connector; -import org.eclipse.jst.j2ee.jca.JcaFactory; - - -/** - * @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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getRARFile(); - } - - /** - * @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("add_copy_class_dir_EXC_", (new Object[]{aFile.getURI()}))); //$NON-NLS-1$ = "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.getString("Extract_destination_is_the_EXC_")); //$NON-NLS-1$ = "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("error_saving_EXC_", (new Object[]{uri})), ex); //$NON-NLS-1$ = "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; - } - - 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(); - } - - public boolean isDeploymentDescriptorSet() { - return deploymentDescriptor != null; - } - - /** - * @see com.ibm.etools.commonarchive.File - */ - public boolean isRARFile() { - return true; - } - - /** - * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl - */ - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.RAR_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.RAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.RAR_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.RAR_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.RAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.RAR_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.RAR_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.RAR_FILE__URI : - return getURI(); - case CommonarchivePackage.RAR_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.RAR_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.RAR_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.RAR_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.RAR_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.RAR_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.RAR_FILE__FILES : - return getFiles(); - case CommonarchivePackage.RAR_FILE__TYPES : - return getTypes(); - case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR : - if (resolve) - return getDeploymentDescriptor(); - return basicGetDeploymentDescriptor(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.RAR_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.RAR_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.RAR_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.RAR_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.RAR_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.RAR_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.RAR_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.RAR_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.RAR_FILE__TYPES : - return types != null && !types.isEmpty(); - case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR : - return deploymentDescriptor != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.RAR_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.RAR_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.RAR_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.RAR_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.RAR_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.RAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.RAR_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.RAR_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.RAR_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((Connector) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.RAR_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.RAR_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.RAR_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.RAR_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.RAR_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.RAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.RAR_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.RAR_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.RAR_FILE__TYPES : - getTypes().clear(); - return; - case CommonarchivePackage.RAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((Connector) null); - return; - } - eDynamicUnset(eFeature); - } - - 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 c87e1e8fd..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/ReadOnlyDirectoryImpl.java +++ /dev/null @@ -1,304 +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 java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -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.ReadOnlyDirectory; - -/** - * @generated - */ -public class ReadOnlyDirectoryImpl extends ContainerImpl implements ReadOnlyDirectory { - - public ReadOnlyDirectoryImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getReadOnlyDirectory(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER, msgs); - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER, msgs); - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__URI : - return getURI(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.READ_ONLY_DIRECTORY__SIZE : - return new Long(getSize()); - case CommonarchivePackage.READ_ONLY_DIRECTORY__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.READ_ONLY_DIRECTORY__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - return getContainer(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - return getFiles(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__SIZE : - unsetSize(); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - getFiles().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.READ_ONLY_DIRECTORY__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.READ_ONLY_DIRECTORY__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__SIZE : - return isSetSize(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.READ_ONLY_DIRECTORY__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.READ_ONLY_DIRECTORY__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.READ_ONLY_DIRECTORY__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.READ_ONLY_DIRECTORY__FILES : - return files != null && !files.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * @see com.ibm.etools.commonarchive.Archive - */ - 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. - */ - 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 26356725e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootArchiveTypeDescriminatorImpl.java +++ /dev/null @@ -1,89 +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 implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator { - protected static ArchiveTypeDiscriminatorImpl singleton; - - /** - * CommonArchiveFactoryDescriminator constructor comment. - */ - public RootArchiveTypeDescriminatorImpl() { - super(); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public boolean canImport(Archive anArchive) { - return true; - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public Archive convert(Archive anArchive) { - return anArchive; - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this - * implementer. - */ - 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. - */ - 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 ed9acc836..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/RootEJBJarDescriminatorImpl.java +++ /dev/null @@ -1,120 +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 implements org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminator { - protected static ArchiveTypeDiscriminatorImpl singleton; - - /** - * CommonArchiveFactoryDescriminator constructor comment. - */ - public RootEJBJarDescriminatorImpl() { - super(); - initialize(); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - 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 - */ - public Archive convert(Archive anArchive) { - return anArchive; - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator This never gets called for this - * implementer. - */ - 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. - */ - 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) - */ - 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 5bf215e29..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WARFileImpl.java +++ /dev/null @@ -1,589 +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 java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -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.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -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.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.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.WarFileDynamicClassLoader; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.WebApp; - - -/** - * @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 - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getWARFile(); - } - - /** - * @see com.ibm.etools.commonarchive.WARFile - */ - public File addCopyClass(File aFile) throws DuplicateObjectException { - if (aFile.isReadOnlyDirectory()) - throw new IllegalArgumentException(CommonArchiveResourceHandler.getString("add_copy_class_dir_EXC_", (new Object[]{aFile.getURI()}))); //$NON-NLS-1$ = "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("add_copy_lib_dir_EXC_", (new Object[]{aFile.getURI()}))); //$NON-NLS-1$ = "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(); - } - - 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 - */ - 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()]); - } - - 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()); - 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(); - } - - public boolean isDeploymentDescriptorSet() { - return deploymentDescriptor != null; - } - - /** - * @see com.ibm.etools.commonarchive.File - */ - public boolean isWARFile() { - return true; - } - - /** - * @see com.ibm.etools.commonarchive.impl.ModuleFileImpl - */ - 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 boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WAR_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case CommonarchivePackage.WAR_FILE__LAST_MODIFIED : - return isSetLastModified(); - case CommonarchivePackage.WAR_FILE__SIZE : - return isSetSize(); - case CommonarchivePackage.WAR_FILE__DIRECTORY_ENTRY : - return isSetDirectoryEntry(); - case CommonarchivePackage.WAR_FILE__ORIGINAL_URI : - return ORIGINAL_URI_EDEFAULT == null ? originalURI != null : !ORIGINAL_URI_EDEFAULT.equals(originalURI); - case CommonarchivePackage.WAR_FILE__LOADING_CONTAINER : - return loadingContainer != null; - case CommonarchivePackage.WAR_FILE__CONTAINER : - return getContainer() != null; - case CommonarchivePackage.WAR_FILE__FILES : - return files != null && !files.isEmpty(); - case CommonarchivePackage.WAR_FILE__TYPES : - return types != null && !types.isEmpty(); - case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR : - return deploymentDescriptor != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WAR_FILE__URI : - setURI((String) newValue); - return; - case CommonarchivePackage.WAR_FILE__LAST_MODIFIED : - setLastModified(((Long) newValue).longValue()); - return; - case CommonarchivePackage.WAR_FILE__SIZE : - setSize(((Long) newValue).longValue()); - return; - case CommonarchivePackage.WAR_FILE__DIRECTORY_ENTRY : - setDirectoryEntry(((Boolean) newValue).booleanValue()); - return; - case CommonarchivePackage.WAR_FILE__ORIGINAL_URI : - setOriginalURI((String) newValue); - return; - case CommonarchivePackage.WAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) newValue); - return; - case CommonarchivePackage.WAR_FILE__CONTAINER : - setContainer((Container) newValue); - return; - case CommonarchivePackage.WAR_FILE__FILES : - getFiles().clear(); - getFiles().addAll((Collection) newValue); - return; - case CommonarchivePackage.WAR_FILE__TYPES : - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((WebApp) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WAR_FILE__URI : - setURI(URI_EDEFAULT); - return; - case CommonarchivePackage.WAR_FILE__LAST_MODIFIED : - unsetLastModified(); - return; - case CommonarchivePackage.WAR_FILE__SIZE : - unsetSize(); - return; - case CommonarchivePackage.WAR_FILE__DIRECTORY_ENTRY : - unsetDirectoryEntry(); - return; - case CommonarchivePackage.WAR_FILE__ORIGINAL_URI : - setOriginalURI(ORIGINAL_URI_EDEFAULT); - return; - case CommonarchivePackage.WAR_FILE__LOADING_CONTAINER : - setLoadingContainer((Container) null); - return; - case CommonarchivePackage.WAR_FILE__CONTAINER : - setContainer((Container) null); - return; - case CommonarchivePackage.WAR_FILE__FILES : - getFiles().clear(); - return; - case CommonarchivePackage.WAR_FILE__TYPES : - getTypes().clear(); - return; - case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR : - setDeploymentDescriptor((WebApp) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public WebApp getDeploymentDescriptorGen() { - if (deploymentDescriptor != null && deploymentDescriptor.eIsProxy()) { - WebApp oldDeploymentDescriptor = deploymentDescriptor; - deploymentDescriptor = (WebApp) EcoreUtil.resolve(deploymentDescriptor, this); - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.WAR_FILE__CONTAINER : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.WAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.WAR_FILE__FILES : - return ((InternalEList) getFiles()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.WAR_FILE__CONTAINER : - return eBasicSetContainer(null, CommonarchivePackage.WAR_FILE__CONTAINER, msgs); - case CommonarchivePackage.WAR_FILE__FILES : - return ((InternalEList) getFiles()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.WAR_FILE__CONTAINER : - return eContainer.eInverseRemove(this, CommonarchivePackage.CONTAINER__FILES, Container.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WAR_FILE__URI : - return getURI(); - case CommonarchivePackage.WAR_FILE__LAST_MODIFIED : - return new Long(getLastModified()); - case CommonarchivePackage.WAR_FILE__SIZE : - return new Long(getSize()); - case CommonarchivePackage.WAR_FILE__DIRECTORY_ENTRY : - return isDirectoryEntry() ? Boolean.TRUE : Boolean.FALSE; - case CommonarchivePackage.WAR_FILE__ORIGINAL_URI : - return getOriginalURI(); - case CommonarchivePackage.WAR_FILE__LOADING_CONTAINER : - if (resolve) - return getLoadingContainer(); - return basicGetLoadingContainer(); - case CommonarchivePackage.WAR_FILE__CONTAINER : - return getContainer(); - case CommonarchivePackage.WAR_FILE__FILES : - return getFiles(); - case CommonarchivePackage.WAR_FILE__TYPES : - return getTypes(); - case CommonarchivePackage.WAR_FILE__DEPLOYMENT_DESCRIPTOR : - if (resolve) - return getDeploymentDescriptor(); - return basicGetDeploymentDescriptor(); - } - return eDynamicGet(eFeature, resolve); - } - - 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 17c5e4ee8..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/impl/WebModuleRefImpl.java +++ /dev/null @@ -1,197 +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.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -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.WebModuleRef; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveWrappedException; -import org.eclipse.jst.j2ee.webapplication.WebApp; - - -public class WebModuleRefImpl extends ModuleRefImpl implements WebModuleRef, ModuleRef { - - - /** - * @generated This field/method will be replaced during code generation. - */ - protected WebModuleRefImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return CommonarchivePackage.eINSTANCE.getWebModuleRef(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, CommonarchivePackage.WEB_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - return eBasicSetContainer(null, CommonarchivePackage.WEB_MODULE_REF__EAR_FILE, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - return eContainer.eInverseRemove(this, CommonarchivePackage.EAR_FILE__MODULE_REFS, EARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WEB_MODULE_REF__MODULE_FILE : - if (resolve) - return getModuleFile(); - return basicGetModuleFile(); - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - return getEarFile(); - case CommonarchivePackage.WEB_MODULE_REF__MODULE : - if (resolve) - return getModule(); - return basicGetModule(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WEB_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) newValue); - return; - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - setEarFile((EARFile) newValue); - return; - case CommonarchivePackage.WEB_MODULE_REF__MODULE : - setModule((Module) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WEB_MODULE_REF__MODULE_FILE : - setModuleFile((ModuleFile) null); - return; - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - setEarFile((EARFile) null); - return; - case CommonarchivePackage.WEB_MODULE_REF__MODULE : - setModule((Module) null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case CommonarchivePackage.WEB_MODULE_REF__MODULE_FILE : - return moduleFile != null; - case CommonarchivePackage.WEB_MODULE_REF__EAR_FILE : - return getEarFile() != null; - case CommonarchivePackage.WEB_MODULE_REF__MODULE : - return module != null; - } - return eDynamicIsSet(eFeature); - } - - /* - * @see WebModuleRef#getWebApp() - */ - public WebApp getWebApp() throws ArchiveWrappedException { - return (WebApp) getDeploymentDescriptor(); - } - - /* - * @see ModuleRef#isWeb() - */ - public boolean isWeb() { - return true; - } - -} //WebModuleRefImpl - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseApplication.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseApplication.java deleted file mode 100644 index 738464ae2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseApplication.java +++ /dev/null @@ -1,28 +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.looseconfig; - - - -import org.eclipse.emf.common.util.EList; - - -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/internal/looseconfig/LooseArchive.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseArchive.java deleted file mode 100644 index 2fb9bc734..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseArchive.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.looseconfig; - - - -import org.eclipse.emf.ecore.EObject; - - -public interface LooseArchive extends EObject { - /** - * @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/internal/looseconfig/LooseConfigRegister.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseConfigRegister.java deleted file mode 100644 index 530cdbe3b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseConfigRegister.java +++ /dev/null @@ -1,358 +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.looseconfig; - -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/internal/looseconfig/LooseConfiguration.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseConfiguration.java deleted file mode 100644 index 67056494c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseConfiguration.java +++ /dev/null @@ -1,29 +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.looseconfig; - - - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - - -public interface LooseConfiguration extends EObject { - /** - * @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/internal/looseconfig/LooseLibrary.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseLibrary.java deleted file mode 100644 index 9d3d86ca4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseLibrary.java +++ /dev/null @@ -1,33 +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.looseconfig; - - - - -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/internal/looseconfig/LooseModule.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseModule.java deleted file mode 100644 index 3f5b3913c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseModule.java +++ /dev/null @@ -1,33 +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.looseconfig; - - - - -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/internal/looseconfig/LooseWARFile.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseWARFile.java deleted file mode 100644 index 53b224adb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseWARFile.java +++ /dev/null @@ -1,28 +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.looseconfig; - - - -import org.eclipse.emf.common.util.EList; - - -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/internal/looseconfig/LooseconfigFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseconfigFactory.java deleted file mode 100644 index c6f94e7fe..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseconfigFactory.java +++ /dev/null @@ -1,63 +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.looseconfig; - - -import org.eclipse.emf.ecore.EFactory; - - -public interface LooseconfigFactory extends EFactory { - /** - * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - LooseconfigFactory eINSTANCE = new org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.impl.LooseconfigFactoryImpl(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseApplication value - */ - LooseApplication createLooseApplication(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseLibrary value - */ - LooseLibrary createLooseLibrary(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseWARFile value - */ - LooseWARFile createLooseWARFile(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseModule value - */ - LooseModule createLooseModule(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseConfiguration value - */ - LooseConfiguration createLooseConfiguration(); - - /** - * @generated This field/method will be replaced during code generation. - */ - LooseconfigPackage getLooseconfigPackage(); - -} //LooseconfigFactory - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseconfigPackage.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseconfigPackage.java deleted file mode 100644 index a4949c569..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/LooseconfigPackage.java +++ /dev/null @@ -1,334 +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.looseconfig; - - - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - - -/** - * @lastgen interface LooseconfigPackage extends EPackage {} - */ -public interface LooseconfigPackage extends EPackage { - /** - * The package name. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - String eNAME = "looseconfig"; //$NON-NLS-1$ - - /** - * @generated This field/method will be replaced during code generation. - */ - - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_ARCHIVE = 1; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_ARCHIVE__URI = 0; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_ARCHIVE__BINARIES_PATH = 1; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_ARCHIVE__RESOURCES_PATH = 2; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_ARCHIVE__LOOSE_APP = 3; - - /** - * The number of structural features of the the '<em>Loose Archive</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int LOOSE_ARCHIVE_FEATURE_COUNT = 4; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION__URI = LOOSE_ARCHIVE__URI; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_APPLICATION__LOOSE_ARCHIVES = LOOSE_ARCHIVE_FEATURE_COUNT + 0; - /** - * The number of structural features of the the '<em>Loose Application</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int LOOSE_APPLICATION_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY = 2; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY__URI = LOOSE_ARCHIVE__URI; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_LIBRARY__LOOSE_WAR = LOOSE_ARCHIVE_FEATURE_COUNT + 0; - /** - * The number of structural features of the the '<em>Loose Library</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int LOOSE_LIBRARY_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE = 5; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE = 3; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE__URI = LOOSE_ARCHIVE__URI; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE__BINARIES_PATH = LOOSE_ARCHIVE__BINARIES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE__RESOURCES_PATH = LOOSE_ARCHIVE__RESOURCES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE__LOOSE_APP = LOOSE_ARCHIVE__LOOSE_APP; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_MODULE__ALT_DD = LOOSE_ARCHIVE_FEATURE_COUNT + 0; - /** - * The number of structural features of the the '<em>Loose Module</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int LOOSE_MODULE_FEATURE_COUNT = LOOSE_ARCHIVE_FEATURE_COUNT + 1; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_CONFIGURATION = 4; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_CONFIGURATION__APPLICATIONS = 0; - - - /** - * The number of structural features of the the '<em>Loose Configuration</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int LOOSE_CONFIGURATION_FEATURE_COUNT = 1; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__URI = LOOSE_MODULE__URI; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__BINARIES_PATH = LOOSE_MODULE__BINARIES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__RESOURCES_PATH = LOOSE_MODULE__RESOURCES_PATH; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__LOOSE_APP = LOOSE_MODULE__LOOSE_APP; - - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__ALT_DD = LOOSE_MODULE__ALT_DD; - /** - * @generated This field/method will be replaced during code generation. - */ - int LOOSE_WAR_FILE__LOOSE_LIBS = LOOSE_MODULE_FEATURE_COUNT + 0; - /** - * The number of structural features of the 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; - - - /** - * @generated This field/method will be replaced during code generation. - */ - 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.internal.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.internal.looseconfig.impl.LooseconfigPackageImpl.init(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseApplication object - */ - EClass getLooseApplication(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getLooseApplication_LooseArchives(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseArchive object - */ - EClass getLooseArchive(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getLooseArchive_Uri(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getLooseArchive_BinariesPath(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getLooseArchive_ResourcesPath(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getLooseArchive_LooseApp(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseLibrary object - */ - EClass getLooseLibrary(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getLooseLibrary_LooseWAR(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseWARFile object - */ - EClass getLooseWARFile(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getLooseWARFile_LooseLibs(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseModule object - */ - EClass getLooseModule(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EAttribute getLooseModule_AltDD(); - - /** - * @generated This field/method will be replaced during code generation - * @return LooseConfiguration object - */ - EClass getLooseConfiguration(); - - /** - * @generated This field/method will be replaced during code generation. - */ - EReference getLooseConfiguration_Applications(); - - /** - * @generated This field/method will be replaced during code generation. - */ - LooseconfigFactory getLooseconfigFactory(); - -} //LooseconfigPackage - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseApplicationImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseApplicationImpl.java deleted file mode 100644 index 0575f3e5b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseApplicationImpl.java +++ /dev/null @@ -1,221 +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.looseconfig.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.EStructuralFeature; -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.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - -public class LooseApplicationImpl extends LooseArchiveImpl implements LooseApplication, LooseArchive { - /** - * @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 - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseApplication(); - } - - /** - * @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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - return ((InternalEList) getLooseArchives()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - return ((InternalEList) getLooseArchives()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_APPLICATION__URI : - return getUri(); - case LooseconfigPackage.LOOSE_APPLICATION__BINARIES_PATH : - return getBinariesPath(); - case LooseconfigPackage.LOOSE_APPLICATION__RESOURCES_PATH : - return getResourcesPath(); - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - return getLooseApp(); - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - return getLooseArchives(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_APPLICATION__URI : - setUri((String) newValue); - return; - case LooseconfigPackage.LOOSE_APPLICATION__BINARIES_PATH : - setBinariesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_APPLICATION__RESOURCES_PATH : - setResourcesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - setLooseApp((LooseApplication) newValue); - return; - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - getLooseArchives().clear(); - getLooseArchives().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_APPLICATION__URI : - setUri(URI_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_APPLICATION__BINARIES_PATH : - setBinariesPath(BINARIES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_APPLICATION__RESOURCES_PATH : - setResourcesPath(RESOURCES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - setLooseApp((LooseApplication) null); - return; - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - getLooseArchives().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_APPLICATION__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case LooseconfigPackage.LOOSE_APPLICATION__BINARIES_PATH : - return BINARIES_PATH_EDEFAULT == null ? binariesPath != null : !BINARIES_PATH_EDEFAULT.equals(binariesPath); - case LooseconfigPackage.LOOSE_APPLICATION__RESOURCES_PATH : - return RESOURCES_PATH_EDEFAULT == null ? resourcesPath != null : !RESOURCES_PATH_EDEFAULT.equals(resourcesPath); - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_APP : - return getLooseApp() != null; - case LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES : - return looseArchives != null && !looseArchives.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - public boolean isEAR() { - return true; - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseArchiveImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseArchiveImpl.java deleted file mode 100644 index 0449059dc..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseArchiveImpl.java +++ /dev/null @@ -1,335 +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.looseconfig.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.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - -public class LooseArchiveImpl extends EObjectImpl implements LooseArchive, EObject { - /** - * 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 - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseArchive(); - } - - /** - * @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; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setLooseApp(LooseApplication newLooseApp) { - if (newLooseApp != eContainer || (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 (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newLooseApp != null) - msgs = ((InternalEObject) newLooseApp).eInverseAdd(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - msgs = eBasicSetContainer((InternalEObject) newLooseApp, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP, 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case LooseconfigPackage.LOOSE_ARCHIVE__LOOSE_APP : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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 eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - 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; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - 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/internal/looseconfig/impl/LooseConfigurationImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseConfigurationImpl.java deleted file mode 100644 index 880a318b7..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseConfigurationImpl.java +++ /dev/null @@ -1,140 +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.looseconfig.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.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfiguration; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - - -public class LooseConfigurationImpl extends EObjectImpl implements LooseConfiguration, EObject { - /** - * @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 - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseConfiguration(); - } - - /** - * @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 - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS : - return ((InternalEList) getApplications()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS : - return getApplications(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS : - getApplications().clear(); - getApplications().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS : - getApplications().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_CONFIGURATION__APPLICATIONS : - return applications != null && !applications.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - -} //LooseConfigurationImpl - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseLibraryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseLibraryImpl.java deleted file mode 100644 index 5485f541c..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseLibraryImpl.java +++ /dev/null @@ -1,227 +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.looseconfig.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.EStructuralFeature; -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.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - - -public class LooseLibraryImpl extends LooseArchiveImpl implements LooseLibrary, LooseArchive { - /** - * @generated This field/method will be replaced during code generation. - */ - protected LooseLibraryImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseLibrary(); - } - - /** - * @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; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void setLooseWAR(LooseWARFile newLooseWAR) { - if (newLooseWAR != eContainer || (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 (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newLooseWAR != null) - msgs = ((InternalEObject) newLooseWAR).eInverseAdd(this, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS, LooseWARFile.class, msgs); - msgs = eBasicSetContainer((InternalEObject) newLooseWAR, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR, 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS, LooseWARFile.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_LIBRARY__URI : - return getUri(); - case LooseconfigPackage.LOOSE_LIBRARY__BINARIES_PATH : - return getBinariesPath(); - case LooseconfigPackage.LOOSE_LIBRARY__RESOURCES_PATH : - return getResourcesPath(); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - return getLooseApp(); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - return getLooseWAR(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_LIBRARY__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case LooseconfigPackage.LOOSE_LIBRARY__BINARIES_PATH : - return BINARIES_PATH_EDEFAULT == null ? binariesPath != null : !BINARIES_PATH_EDEFAULT.equals(binariesPath); - case LooseconfigPackage.LOOSE_LIBRARY__RESOURCES_PATH : - return RESOURCES_PATH_EDEFAULT == null ? resourcesPath != null : !RESOURCES_PATH_EDEFAULT.equals(resourcesPath); - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - return getLooseApp() != null; - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - return getLooseWAR() != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_LIBRARY__URI : - setUri((String) newValue); - return; - case LooseconfigPackage.LOOSE_LIBRARY__BINARIES_PATH : - setBinariesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_LIBRARY__RESOURCES_PATH : - setResourcesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - setLooseApp((LooseApplication) newValue); - return; - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - setLooseWAR((LooseWARFile) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_LIBRARY__URI : - setUri(URI_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_LIBRARY__BINARIES_PATH : - setBinariesPath(BINARIES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_LIBRARY__RESOURCES_PATH : - setResourcesPath(RESOURCES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_APP : - setLooseApp((LooseApplication) null); - return; - case LooseconfigPackage.LOOSE_LIBRARY__LOOSE_WAR : - setLooseWAR((LooseWARFile) null); - return; - } - eDynamicUnset(eFeature); - } - -} //LooseLibraryImpl - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseModuleImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseModuleImpl.java deleted file mode 100644 index b9463c4a4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseModuleImpl.java +++ /dev/null @@ -1,237 +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.looseconfig.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.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - -public class LooseModuleImpl extends LooseArchiveImpl implements LooseModule, LooseArchive { - /** - * 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 - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseModule(); - } - - /** - * @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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_MODULE__LOOSE_APP, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_MODULE__LOOSE_APP, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_MODULE__URI : - return getUri(); - case LooseconfigPackage.LOOSE_MODULE__BINARIES_PATH : - return getBinariesPath(); - case LooseconfigPackage.LOOSE_MODULE__RESOURCES_PATH : - return getResourcesPath(); - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - return getLooseApp(); - case LooseconfigPackage.LOOSE_MODULE__ALT_DD : - return getAltDD(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_MODULE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case LooseconfigPackage.LOOSE_MODULE__BINARIES_PATH : - return BINARIES_PATH_EDEFAULT == null ? binariesPath != null : !BINARIES_PATH_EDEFAULT.equals(binariesPath); - case LooseconfigPackage.LOOSE_MODULE__RESOURCES_PATH : - return RESOURCES_PATH_EDEFAULT == null ? resourcesPath != null : !RESOURCES_PATH_EDEFAULT.equals(resourcesPath); - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - return getLooseApp() != null; - case LooseconfigPackage.LOOSE_MODULE__ALT_DD : - return ALT_DD_EDEFAULT == null ? altDD != null : !ALT_DD_EDEFAULT.equals(altDD); - } - return eDynamicIsSet(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_MODULE__URI : - setUri((String) newValue); - return; - case LooseconfigPackage.LOOSE_MODULE__BINARIES_PATH : - setBinariesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_MODULE__RESOURCES_PATH : - setResourcesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - setLooseApp((LooseApplication) newValue); - return; - case LooseconfigPackage.LOOSE_MODULE__ALT_DD : - setAltDD((String) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_MODULE__URI : - setUri(URI_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_MODULE__BINARIES_PATH : - setBinariesPath(BINARIES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_MODULE__RESOURCES_PATH : - setResourcesPath(RESOURCES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_MODULE__LOOSE_APP : - setLooseApp((LooseApplication) null); - return; - case LooseconfigPackage.LOOSE_MODULE__ALT_DD : - setAltDD(ALT_DD_EDEFAULT); - return; - } - eDynamicUnset(eFeature); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - 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/internal/looseconfig/impl/LooseWARFileImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseWARFileImpl.java deleted file mode 100644 index 7aa670b2a..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseWARFileImpl.java +++ /dev/null @@ -1,236 +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.looseconfig.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.EStructuralFeature; -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.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - - -public class LooseWARFileImpl extends LooseModuleImpl implements LooseWARFile, LooseModule { - /** - * @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 - */ - protected EClass eStaticClass() { - return LooseconfigPackage.eINSTANCE.getLooseWARFile(); - } - - 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 - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - return ((InternalEList) getLooseLibs()).basicAdd(otherEnd, msgs); - default : - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - return eBasicSetContainer(null, LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP, msgs); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - return ((InternalEList) getLooseLibs()).basicRemove(otherEnd, msgs); - default : - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { - if (eContainerFeatureID >= 0) { - switch (eContainerFeatureID) { - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - return eContainer.eInverseRemove(this, LooseconfigPackage.LOOSE_APPLICATION__LOOSE_ARCHIVES, LooseApplication.class, msgs); - default : - return eDynamicBasicRemoveFromContainer(msgs); - } - } - return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_WAR_FILE__URI : - return getUri(); - case LooseconfigPackage.LOOSE_WAR_FILE__BINARIES_PATH : - return getBinariesPath(); - case LooseconfigPackage.LOOSE_WAR_FILE__RESOURCES_PATH : - return getResourcesPath(); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - return getLooseApp(); - case LooseconfigPackage.LOOSE_WAR_FILE__ALT_DD : - return getAltDD(); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - return getLooseLibs(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_WAR_FILE__URI : - setUri((String) newValue); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__BINARIES_PATH : - setBinariesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__RESOURCES_PATH : - setResourcesPath((String) newValue); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - setLooseApp((LooseApplication) newValue); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__ALT_DD : - setAltDD((String) newValue); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - getLooseLibs().clear(); - getLooseLibs().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_WAR_FILE__URI : - setUri(URI_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__BINARIES_PATH : - setBinariesPath(BINARIES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__RESOURCES_PATH : - setResourcesPath(RESOURCES_PATH_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - setLooseApp((LooseApplication) null); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__ALT_DD : - setAltDD(ALT_DD_EDEFAULT); - return; - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - getLooseLibs().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case LooseconfigPackage.LOOSE_WAR_FILE__URI : - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case LooseconfigPackage.LOOSE_WAR_FILE__BINARIES_PATH : - return BINARIES_PATH_EDEFAULT == null ? binariesPath != null : !BINARIES_PATH_EDEFAULT.equals(binariesPath); - case LooseconfigPackage.LOOSE_WAR_FILE__RESOURCES_PATH : - return RESOURCES_PATH_EDEFAULT == null ? resourcesPath != null : !RESOURCES_PATH_EDEFAULT.equals(resourcesPath); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_APP : - return getLooseApp() != null; - case LooseconfigPackage.LOOSE_WAR_FILE__ALT_DD : - return ALT_DD_EDEFAULT == null ? altDD != null : !ALT_DD_EDEFAULT.equals(altDD); - case LooseconfigPackage.LOOSE_WAR_FILE__LOOSE_LIBS : - return looseLibs != null && !looseLibs.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - -} //LooseWARFileImpl - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseconfigFactoryImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseconfigFactoryImpl.java deleted file mode 100644 index 6ed7676fe..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseconfigFactoryImpl.java +++ /dev/null @@ -1,114 +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.looseconfig.impl; - - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfiguration; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; - - -public class LooseconfigFactoryImpl extends EFactoryImpl implements LooseconfigFactory, EFactory { - /** - * @generated This field/method will be replaced during code generation. - */ - public LooseconfigFactoryImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - 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/internal/looseconfig/impl/LooseconfigPackageImpl.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseconfigPackageImpl.java deleted file mode 100644 index 6de7641df..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/impl/LooseconfigPackageImpl.java +++ /dev/null @@ -1,349 +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.looseconfig.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.impl.EPackageImpl; -import org.eclipse.emf.ecore.impl.EcorePackageImpl; -import org.eclipse.jem.java.impl.JavaRefPackageImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchivePackageImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfiguration; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; -import org.eclipse.jst.j2ee.internal.application.impl.ApplicationPackageImpl; -import org.eclipse.jst.j2ee.internal.client.impl.ClientPackageImpl; -import org.eclipse.jst.j2ee.internal.common.impl.CommonPackageImpl; -import org.eclipse.jst.j2ee.internal.ejb.impl.EjbPackageImpl; -import org.eclipse.jst.j2ee.internal.jca.impl.JcaPackageImpl; -import org.eclipse.jst.j2ee.internal.jsp.impl.JspPackageImpl; -import org.eclipse.jst.j2ee.internal.webapplication.impl.WebapplicationPackageImpl; -import org.eclipse.jst.j2ee.webservice.internal.wsclient.impl.Webservice_clientPackageImpl; - - -/** - * @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.getEPackage(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new LooseconfigPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - JcaPackageImpl.init(); - Webservice_clientPackageImpl.init(); - EcorePackageImpl.init(); - JavaRefPackageImpl.init(); - CommonPackageImpl.init(); - ClientPackageImpl.init(); - WebapplicationPackageImpl.init(); - EjbPackageImpl.init(); - JspPackageImpl.init(); - ApplicationPackageImpl.init(); - - // Obtain or create and register interdependencies - CommonarchivePackageImpl theCommonarchivePackage = (CommonarchivePackageImpl) (EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI) : CommonarchivePackage.eINSTANCE); - - // Step 1: create meta-model objects - theLooseconfigPackage.createPackageContents(); - theCommonarchivePackage.createPackageContents(); - - // Step 2: complete initialization - theLooseconfigPackage.initializePackageContents(); - theCommonarchivePackage.initializePackageContents(); - - 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.getEReferences().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.getEAttributes().get(0); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getLooseArchive_BinariesPath() { - return (EAttribute) looseArchiveEClass.getEAttributes().get(1); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EAttribute getLooseArchive_ResourcesPath() { - return (EAttribute) looseArchiveEClass.getEAttributes().get(2); - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public EReference getLooseArchive_LooseApp() { - return (EReference) looseArchiveEClass.getEReferences().get(0); - } - - /** - * @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.getEReferences().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.getEReferences().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.getEAttributes().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.getEReferences().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); - - // Add supertypes to classes - looseApplicationEClass.getESuperTypes().add(this.getLooseArchive()); - looseLibraryEClass.getESuperTypes().add(this.getLooseArchive()); - looseModuleEClass.getESuperTypes().add(this.getLooseArchive()); - looseWARFileEClass.getESuperTypes().add(this.getLooseModule()); - - // Initialize classes and features; add operations and parameters - initEClass(looseApplicationEClass, LooseApplication.class, "LooseApplication", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getLooseApplication_LooseArchives(), this.getLooseArchive(), this.getLooseArchive_LooseApp(), "looseArchives", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(looseArchiveEClass, LooseArchive.class, "LooseArchive", IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEAttribute(getLooseArchive_Uri(), ecorePackage.getEString(), "uri", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getLooseArchive_BinariesPath(), ecorePackage.getEString(), "binariesPath", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEAttribute(getLooseArchive_ResourcesPath(), ecorePackage.getEString(), "resourcesPath", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - initEReference(getLooseArchive_LooseApp(), this.getLooseApplication(), this.getLooseApplication_LooseArchives(), "looseApp", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - addEOperation(looseArchiveEClass, ecorePackage.getEBoolean(), "isModule"); //$NON-NLS-1$ - - initEClass(looseLibraryEClass, LooseLibrary.class, "LooseLibrary", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getLooseLibrary_LooseWAR(), this.getLooseWARFile(), this.getLooseWARFile_LooseLibs(), "looseWAR", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(looseModuleEClass, LooseModule.class, "LooseModule", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEAttribute(getLooseModule_AltDD(), ecorePackage.getEString(), "altDD", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(looseConfigurationEClass, LooseConfiguration.class, "LooseConfiguration", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getLooseConfiguration_Applications(), this.getLooseApplication(), null, "applications", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - - initEClass(looseWARFileEClass, LooseWARFile.class, "LooseWARFile", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ - initEReference(getLooseWARFile_LooseLibs(), this.getLooseLibrary(), this.getLooseLibrary_LooseWAR(), "looseLibs", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, false); //$NON-NLS-1$ - } -} //LooseconfigPackageImpl - - - diff --git a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/util/LooseconfigAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/util/LooseconfigAdapterFactory.java deleted file mode 100644 index 5bb720ca0..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/util/LooseconfigAdapterFactory.java +++ /dev/null @@ -1,168 +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.looseconfig.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.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfiguration; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.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. - */ - 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() { - public Object caseLooseApplication(LooseApplication object) { - return createLooseApplicationAdapter(); - } - - public Object caseLooseArchive(LooseArchive object) { - return createLooseArchiveAdapter(); - } - - public Object caseLooseLibrary(LooseLibrary object) { - return createLooseLibraryAdapter(); - } - - public Object caseLooseModule(LooseModule object) { - return createLooseModuleAdapter(); - } - - public Object caseLooseConfiguration(LooseConfiguration object) { - return createLooseConfigurationAdapter(); - } - - public Object caseLooseWARFile(LooseWARFile object) { - return createLooseWARFileAdapter(); - } - - public Object defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * @generated This field/method will be replaced during code generation. - */ - 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 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/internal/looseconfig/util/LooseconfigSwitch.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/util/LooseconfigSwitch.java deleted file mode 100644 index 5e1933ea5..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/looseconfig/util/LooseconfigSwitch.java +++ /dev/null @@ -1,156 +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.looseconfig.util; - - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfiguration; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseLibrary; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseModule; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.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) { - EClass theEClass = theEObject.eClass(); - if (theEClass.eContainer() == modelPackage) { - switch (theEClass.getClassifierID()) { - case LooseconfigPackage.LOOSE_APPLICATION : { - LooseApplication looseApplication = (LooseApplication) theEObject; - Object result = caseLooseApplication(looseApplication); - if (result == null) - result = caseLooseArchive(looseApplication); - 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 = 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 = defaultCase(theEObject); - return result; - } - case LooseconfigPackage.LOOSE_CONFIGURATION : { - LooseConfiguration looseConfiguration = (LooseConfiguration) theEObject; - Object result = caseLooseConfiguration(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 = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - 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; - } - - /** - * @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 - - - 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 aa51be7fb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/AppClient12ImportStrategyImpl.java +++ /dev/null @@ -1,91 +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.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 { - public boolean canImport(Archive anArchive) { - return anArchive.containsFile(J2EEConstants.APP_CLIENT_DD_URI); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return new AppClient12ImportStrategyImpl(); - } - - public String getUnableToOpenMessage() { - return getXmlDDMessage(CommonArchiveResourceHandler.getString("Application_Client_Jar_Fil"), J2EEConstants.APP_CLIENT_DD_URI); //$NON-NLS-1$ = "Application Client Jar File" - } - - 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 b7587d073..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ConnectorDirectorySaveStrategyImpl.java +++ /dev/null @@ -1,217 +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.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 implements SaveStrategy { - 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 - */ - 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 - */ - 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 - */ - 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 - */ - 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); - } - } - } - - 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 4ce76d89f..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryArchiveLoadStrategyImpl.java +++ /dev/null @@ -1,50 +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.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfigRegister; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; - - -/** - * 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); - } - - protected void addDirectory(java.io.File aFile, java.util.List aList) { - addFiles(aFile, aList); - } - - protected java.io.File getDirectoryForList() { - return new java.io.File(getDirectoryUri()); - } - - - - 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 634c1d382..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectoryLoadStrategyImpl.java +++ /dev/null @@ -1,244 +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.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.looseconfig.LooseApplication; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseWARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseconfigPackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; - - -/** - * 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 - */ - protected boolean primContains(java.lang.String uri) { - return new java.io.File(getFileNameFrom(uri)).exists(); - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - 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 - */ - public java.util.List getFiles() { - List list = new ArrayList(); - java.io.File directory = getDirectoryForList(); - addFiles(directory, list); - return list; - } - - /** - * @see com.ibm.etools.archive.impl.LoadStrategyImpl - */ - 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; - String name = null; - for (; root.endsWith("/"); root = ArchiveUtil.truncateIgnoreCase(root, "/")); //$NON-NLS-1$ //$NON-NLS-2$ - name = replaceSeparators(fileName); - if (name.startsWith(root)) - name = name.substring(root.length() + 1); - else - name = null; - return name; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - public boolean isDirectory() { - return true; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - 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 dce6e70fb..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/DirectorySaveStrategyImpl.java +++ /dev/null @@ -1,245 +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.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 implements SaveStrategy { - 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 - */ - 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 - */ - 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 - */ - 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 - */ - 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); - } - } - } - - 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; - - } - - 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 02913c9c4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/Ear12ImportStrategyImpl.java +++ /dev/null @@ -1,91 +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.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 { - public Archive createConvertedArchive() { - return getArchiveFactory().createEARFile(); - } - - public boolean canImport(Archive anArchive) { - return anArchive.containsFile(J2EEConstants.APPLICATION_DD_URI); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return new Ear12ImportStrategyImpl(); - } - - public String getUnableToOpenMessage() { - return getXmlDDMessage(CommonArchiveResourceHandler.getString("EAR_File"), J2EEConstants.APPLICATION_DD_URI); //$NON-NLS-1$ = "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 ae03129e9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/EjbJar11ImportStrategyImpl.java +++ /dev/null @@ -1,90 +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; -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 { - public boolean canImport(Archive anArchive) { - return anArchive.containsFile(J2EEConstants.EJBJAR_DD_URI); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return new EjbJar11ImportStrategyImpl(); - } - - public String getUnableToOpenMessage() { - return getXmlDDMessage(CommonArchiveResourceHandler.getString("EJB_Jar_File"), J2EEConstants.EJBJAR_DD_URI); //$NON-NLS-1$ = "EJB Jar File" - } - - 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 46bdf49ef..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, 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.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 81a70371b..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategy.java +++ /dev/null @@ -1,148 +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.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.internal.looseconfig.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 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 0b42d603e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/LoadStrategyImpl.java +++ /dev/null @@ -1,557 +0,0 @@ -package org.eclipse.jst.j2ee.commonarchivecore.internal.strategy; - -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2002 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ - -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2001 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ -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.jem.util.logger.proxy.Logger; -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.looseconfig.LooseArchive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.looseconfig.LooseConfigRegister; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.common.impl.J2EEResouceFactorySaxRegistry; -import org.eclipse.jst.j2ee.internal.common.impl.J2EEResourceFactoryDomRegistry; -import org.eclipse.jst.j2ee.internal.common.impl.J2EEResourceFactoryRegistry; -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; - - 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); - } - - 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 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; - } - - protected void finalize() throws Throwable { - close(); - } - - /** - * @see LoadStrategy - */ - public java.lang.String getAbsolutePath() throws FileNotFoundException { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString("Absolute_path_unknown_EXC_")); //$NON-NLS-1$ = "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) - */ - 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)); - } - default : - break; - } - } - - /** - * 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 = null; - 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 result = new ArrayList(resources.size()); - Iterator iter = resources.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()); - 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 - Logger.getLogger().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 - Logger.getLogger().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("load_resource_EXC_", (new Object[]{resourceUri, getContainer().getURI()})), ex); //$NON-NLS-1$ = "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; - } -} 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 ec211da10..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NestedArchiveLoadStrategyImpl.java +++ /dev/null @@ -1,260 +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.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 - */ - 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 - */ - 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 - */ - 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 - */ - 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.getString("Null_uri_EXC_")); //$NON-NLS-1$ = "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("nested_jar_EXC_", (new Object[]{getContainer().getURI(), getParent().getContainer().getURI()})), caughtException);//$NON-NLS-1$ = "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 5ef61c3f4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/NullLoadStrategyImpl.java +++ /dev/null @@ -1,56 +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 - */ - public boolean contains(String uri) { - return false; - } - - protected boolean primContains(String uri) { - return false; - } - - /** - * @see com.ibm.etools.archive.impl.LoadStrategyImpl - */ - public java.util.List getFiles() { - return emptyList; - } - - /** - * @see com.ibm.etools.archive.impl.LoadStrategyImpl - */ - 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 10c35f8b9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/RarImportStrategyImpl.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.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 { - public boolean canImport(Archive anArchive) { - return anArchive.containsFile(J2EEConstants.RAR_DD_URI); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return new RarImportStrategyImpl(); - } - - public String getUnableToOpenMessage() { - return getXmlDDMessage(CommonArchiveResourceHandler.getString("RAR_File"), J2EEConstants.RAR_DD_URI); //$NON-NLS-1$ = "RAR File" - } - - 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 cf08edb88..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ReadOnlyDirectoryLoadStrategyImpl.java +++ /dev/null @@ -1,113 +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. - */ - 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); - - } - - public boolean contains(java.lang.String uri) { - return super.contains(uri) && (getSubdirectory() == null || subdirectoryContains(uri)); - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - 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. - */ - 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 - */ - 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 19549c679..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, 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.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.getString("Error_occurred_iterating_f_EXC_"), iox); //$NON-NLS-1$ = "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 54a85d29e..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/TempZipFileLoadStrategyImpl.java +++ /dev/null @@ -1,58 +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.io.FileNotFoundException; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonArchiveResourceHandler; - - -/** - * 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); - } - - public void close() { - super.close(); - getFile().delete(); - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - public java.lang.String getAbsolutePath() throws java.io.FileNotFoundException { - throw new FileNotFoundException(CommonArchiveResourceHandler.getString("Absolute_path_unknown_EXC_")); //$NON-NLS-1$ = "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 3d14872ff..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/War22ImportStrategyImpl.java +++ /dev/null @@ -1,91 +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; -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 { - public boolean canImport(Archive anArchive) { - return anArchive.containsFile(J2EEConstants.WEBAPP_DD_URI); - } - - /** - * @see com.ibm.etools.archive.ArchiveTypeDiscriminator - */ - public org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.ImportStrategy createImportStrategy(Archive old, Archive newArchive) { - return new War22ImportStrategyImpl(); - } - - public String getUnableToOpenMessage() { - return getXmlDDMessage(CommonArchiveResourceHandler.getString("WAR_File"), J2EEConstants.WEBAPP_DD_URI); //$NON-NLS-1$ = "WAR File" - } - - 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 2c03dbfb0..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipFileLoadStrategyImpl.java +++ /dev/null @@ -1,153 +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.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; - - -/** - * 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(new ZipFile(file)); - } - - public void close() { - super.close(); - try { - getZipFile().close(); - } catch (Throwable t) { - //Ignore - } - } - - /** - * @see com.ibm.etools.archive.impl.LoadStrategyImpl - */ - protected boolean primContains(java.lang.String uri) { - return getZipFile().getEntry(uri) != null; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - 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 - */ - public java.util.List getFiles() { - List list = new ArrayList(); - Enumeration entries = getZipFile().entries(); - while (entries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) entries.nextElement(); - if (!entry.isDirectory() && !collectedLooseArchiveFiles.containsKey(entry.getName())) { - File aFile = createFile(entry.getName()); - aFile.setSize(entry.getSize()); - aFile.setLastModified(entry.getTime()); - list.add(aFile); - } - } - return list; - } - - /** - * @see com.ibm.etools.archive.impl.LoadStrategyImpl - */ - 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 - */ - 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; - } -} 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 445c878f4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/strategy/ZipStreamSaveStrategyImpl.java +++ /dev/null @@ -1,161 +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.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 implements SaveStrategy { - 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)); - } - - public void close() throws IOException { - getDestinationStream().close(); - } - - protected SaveStrategy createNestedSaveStrategy(Archive anArchive) { - return new ZipStreamSaveStrategyImpl(getZipOutputStream()); - } - - 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 - */ - protected java.io.OutputStream getOutputStreamForResource(Resource aResource) throws java.io.IOException { - return getZipOutputStream(); - } - - /** - * @see com.ibm.etools.archive.SaveStrategy#saveMofResource(Resource) - */ - 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); - } - } - - 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); - } - } - - 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 eb86a98e6..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveFileDynamicClassLoader.java +++ /dev/null @@ -1,188 +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.util; - - -import java.io.InputStream; -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; - - -/** - * 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; - - public ArchiveFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) { - super(parentCl); - setArchive(anArchive); - setExtraClassLoader(extraCl); - inEARFile = anArchive.getContainer() != null && anArchive.getContainer().isEARFile(); - } - - /** - * Loads a specified class. This gets called only after the parent class loader has had it's - * chance, based on the Java2 delegation model - */ - 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) { - result = defineClass(name, bytes, 0, bytes.length); - 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; - } - - protected byte[] getClassBytesFor(String className) { - - if (className == null) - return null; - // Change the class name to a jar entry name - String jarEntryName = ArchiveUtil.classNameToUri(className); - - try { - InputStream in = getArchive().getInputStream(jarEntryName); - return ArchiveUtil.inputStreamToBytes(in); - } catch (java.io.FileNotFoundException ex) { - return null; - } catch (java.io.IOException ex) { - throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString("io_ex_loading_EXC_", (new Object[]{className})), ex); //$NON-NLS-1$ = "An IO exception occurred loading " - } - } - - 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); - } - } - - 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) throws ClassNotFoundException { - - Set visitedArchives = new HashSet(5); - visitedArchives.add(getArchive()); - return loadClassInDependentJarInEAR(name, visitedArchives); - } - - protected Class loadClassInDependentJarInEAR(String name, Set visitedArchives) throws ClassNotFoundException { - - 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 file = getEARFile().getFile(uri); - if (file.isArchive()) { - Archive dep = (Archive) file; - try { - return ((ArchiveFileDynamicClassLoader) dep.getArchiveClassLoader()).loadClass(name, visitedArchives); - } catch (ClassNotFoundException noDice) { - continue; - } - } - } catch (java.io.FileNotFoundException depJarNotInEAR) { - //Ignore - } - } - throw new ClassNotFoundException(name); - } - - /** - * 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; - } -} 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 9f4c32e6d..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ArchiveUtil.java +++ /dev/null @@ -1,865 +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.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.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.StringTokenizer; -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.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.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.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; - - -/** - * 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$ - - 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; - - 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.isDirectory()) { - File[] files = aFile.listFiles(); - 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; - } - - /** - * 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) { - 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.getString("A_Application_file"); //$NON-NLS-1$ - case XMLResource.APP_CLIENT_TYPE : - return CommonArchiveResourceHandler.getString("An_Application_Client_JAR_file"); //$NON-NLS-1$ - case XMLResource.EJB_TYPE : - return CommonArchiveResourceHandler.getString("An_EJB_JAR_file"); //$NON-NLS-1$ - case XMLResource.WEB_APP_TYPE : - return CommonArchiveResourceHandler.getString("A_WAR_file"); //$NON-NLS-1$ - case XMLResource.RAR_TYPE : - return CommonArchiveResourceHandler.getString("A_RAR_file"); //$NON-NLS-1$ - } - 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 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 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("make_temp_dir_EXC_", (new Object[]{newTempDirectoryName}))); //$NON-NLS-1$ = "Unable to make temp directory: " - dir.deleteOnExit(); - } - 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 = new ZipFile(aFile); - } catch (Exception ex) { - inform(CommonArchiveResourceHandler.getString("invalid_classpath_WARN_", (new Object[]{pathEntry}))); //$NON-NLS-1$ = "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(); //$NON-NLS-1$ - urls.add(aUrl); - } catch (java.net.MalformedURLException ex) { - inform(CommonArchiveResourceHandler.getString("invalid_cp_file_WARN_", (new Object[]{pathEntry}))); //$NON-NLS-1$ = "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)) { - version = J2EEVersionConstants.J2EE_1_3_ID; - } else if (publicID.equals(J2EEConstants.APPLICATION_PUBLICID_1_2) && systemID.equals(J2EEConstants.APPLICATION_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)) { - version = J2EEVersionConstants.EJB_2_0_ID; - } else if (publicID.equals(J2EEConstants.EJBJAR_PUBLICID_1_1) && systemID.equals(J2EEConstants.EJBJAR_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)) { - version = J2EEVersionConstants.J2EE_1_3_ID; - } else if (publicID.equals(J2EEConstants.APP_CLIENT_PUBLICID_1_2) && systemID.equals(J2EEConstants.APP_CLIENT_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)) { - version = J2EEVersionConstants.WEB_2_3_ID; - } else if (publicID.equals(J2EEConstants.WEBAPP_PUBLICID_2_2) && systemID.equals(J2EEConstants.WEBAPP_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)) { - 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 496258357..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ClasspathUtil.java +++ /dev/null @@ -1,124 +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.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.StringTokenizer; -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; - - -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 19c6bef65..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveAdapterFactory.java +++ /dev/null @@ -1,381 +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.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.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); - } - } - - 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() { - public Object caseContainer(Container object) { - return createContainerAdapter(); - } - - public Object caseWARFile(WARFile object) { - return createWARFileAdapter(); - } - - public Object caseModuleFile(ModuleFile object) { - return createModuleFileAdapter(); - } - - public Object caseEARFile(EARFile object) { - return createEARFileAdapter(); - } - - public Object caseApplicationClientFile(ApplicationClientFile object) { - return createApplicationClientFileAdapter(); - } - - public Object caseEJBJarFile(EJBJarFile object) { - return createEJBJarFileAdapter(); - } - - public Object caseRARFile(RARFile object) { - return createRARFileAdapter(); - } - - public Object caseArchive(Archive object) { - return createArchiveAdapter(); - } - - public Object caseFile(File object) { - return createFileAdapter(); - } - - public Object caseReadOnlyDirectory(ReadOnlyDirectory object) { - return createReadOnlyDirectoryAdapter(); - } - }; - - 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 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() { - public Object caseFile(File object) { - return createFileAdapter(); - } - - public Object caseArchive(Archive object) { - return createArchiveAdapter(); - } - - public Object caseEJBJarFile(EJBJarFile object) { - return createEJBJarFileAdapter(); - } - - public Object caseWARFile(WARFile object) { - return createWARFileAdapter(); - } - - public Object caseEARFile(EARFile object) { - return createEARFileAdapter(); - } - - public Object caseApplicationClientFile(ApplicationClientFile object) { - return createApplicationClientFileAdapter(); - } - - public Object caseModuleFile(ModuleFile object) { - return createModuleFileAdapter(); - } - - public Object caseContainer(Container object) { - return createContainerAdapter(); - } - - public Object caseReadOnlyDirectory(ReadOnlyDirectory object) { - return createReadOnlyDirectoryAdapter(); - } - - public Object caseRARFile(RARFile object) { - return createRARFileAdapter(); - } - - public Object caseModuleRef(ModuleRef object) { - return createModuleRefAdapter(); - } - - public Object caseEJBModuleRef(EJBModuleRef object) { - return createEJBModuleRefAdapter(); - } - - public Object caseWebModuleRef(WebModuleRef object) { - return createWebModuleRefAdapter(); - } - - public Object caseClientModuleRef(ClientModuleRef object) { - return createClientModuleRefAdapter(); - } - - public Object caseConnectorModuleRef(ConnectorModuleRef object) { - return createConnectorModuleRefAdapter(); - } - - 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 1fb6e52b3..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/CommonarchiveSwitch.java +++ /dev/null @@ -1,479 +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.util; - - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -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; - } - - /** - * @generated This field/method will be replaced during code generation. - */ - public Object doSwitchGen(EObject theEObject) { - EClass theEClass = theEObject.eClass(); - if (theEClass.eContainer() == modelPackage) { - switch (theEClass.getClassifierID()) { - case CommonarchivePackage.FILE : { - File file = (File) theEObject; - Object result = caseFile(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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = defaultCase(theEObject); - return result; - } - default : - return defaultCase(theEObject); - } - } - 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/EARFileUtil.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/EARFileUtil.java deleted file mode 100644 index ef6ea5227..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, 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.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 fbb2081c9..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/FileDups.java +++ /dev/null @@ -1,201 +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.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.StringTokenizer; -import java.util.TreeMap; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -/** - * 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) { - x.printStackTrace(); - } - } - - 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 = new ZipFile(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/ObjectInputStreamCustomResolver.java b/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.java deleted file mode 100644 index b7ac91a20..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/ObjectInputStreamCustomResolver.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.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. - */ - - 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 a882bc907..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/RarFileDynamicClassLoader.java +++ /dev/null @@ -1,58 +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 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.io.InputStream; -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.RARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException; - - -public class RarFileDynamicClassLoader extends ArchiveFileDynamicClassLoader { - - - public RarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) { - super(anArchive, parentCl, extraCl); - } - - protected byte[] getClassBytesFor(String className) { - - if (className == null) - return null; - // Change the class name to a jar entry name - List children = getRarFile().getArchiveFiles(); - String jarEntryName = ArchiveUtil.classNameToUri(className); - for (int i = 0; i < children.size(); i++) { - try { - InputStream in = ((Archive) children.get(i)).getInputStream(jarEntryName); - return ArchiveUtil.inputStreamToBytes(in); - } catch (java.io.FileNotFoundException ex) { - continue; - } catch (java.io.IOException ex) { - throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString("io_ex_loading_EXC_", (new Object[]{className})), ex); //$NON-NLS-1$ = "An IO exception occurred loading " - } - } - return null; - } - - 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 1a9a84afa..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/commonArchive/org/eclipse/jst/j2ee/commonarchivecore/internal/util/WarFileDynamicClassLoader.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 - *******************************************************************************/ -/* - * 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.io.InputStream; -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.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; - - -/** - * @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 { - - public WarFileDynamicClassLoader(Archive anArchive, ClassLoader parentCl, ClassLoader extraCl) { - super(anArchive, parentCl, extraCl); - } - - protected byte[] getClassBytesFor(String className) { - - String jarEntryName = ArchiveUtil.classNameToUri(className); - String swizzledName = ArchiveUtil.concatUri(ArchiveConstants.WEBAPP_CLASSES_URI, jarEntryName, '/'); - - try { - InputStream in = getWarFile().getInputStream(swizzledName); - return ArchiveUtil.inputStreamToBytes(in); - } catch (java.io.FileNotFoundException ex) { - //Ignore - } catch (java.io.IOException ex) { - throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString("io_ex_loading_EXC_", (new Object[]{className})), ex); //$NON-NLS-1$ = "An IO exception occurred loading " - } - - List children = getWarFile().getLibs(); - for (int i = 0; i < children.size(); i++) { - try { - InputStream in = ((Archive) children.get(i)).getInputStream(jarEntryName); - return ArchiveUtil.inputStreamToBytes(in); - } catch (java.io.FileNotFoundException ex) { - continue; - } catch (java.io.IOException ex) { - throw new ArchiveRuntimeException(CommonArchiveResourceHandler.getString("io_ex_loading_EXC_", (new Object[]{className})), ex); //$NON-NLS-1$ = "An IO exception occurred loading " - } - } - return super.getClassBytesFor(className); - } - - private WARFile getWarFile() { - return (WARFile) getArchive(); - } -} |