Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 48929 Details for
Bug 155439
Copy correct versions of Axis JARs to WEB-INF/lib as required
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch for org.eclipse.jst.ws.axis.consumption.ui plugin
org.eclipse.jst.ws.axis.consumption.ui.patch (text/plain), 4.59 KB, created by
Mark Hutchinson
on 2006-08-28 18:15:41 EDT
(
hide
)
Description:
Proposed patch for org.eclipse.jst.ws.axis.consumption.ui plugin
Filename:
MIME Type:
Creator:
Mark Hutchinson
Created:
2006-08-28 18:15:41 EDT
Size:
4.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.ws.axis.consumption.ui >Index: src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java >=================================================================== >RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java,v >retrieving revision 1.26 >diff -u -r1.26 CopyAxisJarCommand.java >--- src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java 18 May 2006 02:53:23 -0000 1.26 >+++ src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java 28 Aug 2006 22:18:08 -0000 >@@ -12,6 +12,7 @@ > * 20060509 125094 sengpl@ca.ibm.com - Seng Phung-Lu, Use WorkspaceModifyOperation > * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu > * 20060517 142342 kathy@ca.ibm.com - Kathy Chan >+ * 20060828 155439 mahutch@ca.ibm.com - Mark Hutchinson > *******************************************************************************/ > package org.eclipse.jst.ws.internal.axis.consumption.ui.task; > >@@ -60,6 +61,26 @@ > "saaj.jar", > "wsdl4j-1.5.1.jar" > }; >+ //these are the jar sizes that correspond to the jars in JARLIST. >+ private static long[] JARSIZES = { >+ 1632995L, >+ 71442L, >+ 32062L, >+ 19419L, >+ 126771L >+ }; >+ private static long COMMON_LOGGING_JAR_SIZE = 38015L; >+ //Web Services Jars Used in previous Versions of WTP but now obsolete >+ private static String[] OBSOLETE_JARS = new String[]{ >+ "commons-discovery.jar", >+ "commons-logging.jar", >+ "log4j-1.2.4.jar", >+ "log4j-1.2.8.jar", >+ "wsdl4j.jar", >+ "axis-ant.jar" >+ }; >+ >+ > public static String COMMON_LOGGING_PLUGIN_ID = "org.apache.commons_logging"; //$NON-NLS-1$ > public static String COMMON_LOGGING_JAR = "commons-logging-1.0.4.jar"; //$NON-NLS-1$ > public static String PATH_TO_JARS_IN_PLUGIN = "lib/"; >@@ -121,6 +142,8 @@ > return; > } > >+ deleteObsoleteJars(webModulePath); >+ > for (int i=0; i<JARLIST.length; ) { > copyIFile(AXIS_RUNTIME_PLUGIN_ID, "lib/"+JARLIST[i], webModulePath, "WEB-INF/lib/"+JARLIST[i++], status, env, monitor); > if (status.getSeverity() == Status.ERROR) >@@ -163,6 +186,72 @@ > } > } > >+ /* >+ * Check for any obsolete Jars in WEB-INF/lib folder >+ * Obsolete jars would be found in projects migrated >+ * from older versions of WTP >+ */ >+ private void deleteObsoleteJars(IPath webModulePath) >+ { >+ //First check for Any jars that have names that are known to be obsolete >+ for (int i=0; i <OBSOLETE_JARS.length; i++) >+ { >+ IPath path = webModulePath.append("WEB-INF/lib/" + OBSOLETE_JARS[i]); >+ >+ IFile resource = ResourceUtils.getWorkspaceRoot().getFile(path); >+ if (resource.exists()) >+ { >+ deleteResource(resource); >+ } >+ } >+ /* >+ * Next check for jars with the same name as a Jar in JARLIST >+ * but that have a different size than in JARSIZES. We need to >+ * do this because a jar could have the same name but still be out >+ * of date so size is only way to check. >+ * E.g. all versions of axis have the same name of axis.jar >+ */ >+ for (int i=0; i< JARLIST.length; i++) >+ { >+ IPath path = webModulePath.append("WEB-INF/lib/" + JARLIST[i]); >+ IFile resource = ResourceUtils.getWorkspaceRoot().getFile(path); >+ if (resource.exists()) >+ { >+ //calculate the size of the resource by getting the java.io.File >+ long fileSize =resource.getLocation().toFile().length(); >+ if (fileSize != JARSIZES[i]) >+ { >+ deleteResource(resource); >+ } >+ } >+ } >+ //Finally check logging plugin (only left seperate because not in JARLIST) >+ IPath path = webModulePath.append("WEB-INF/lib/" + COMMON_LOGGING_JAR); >+ IFile resource = ResourceUtils.getWorkspaceRoot().getFile(path); >+ if (resource.exists()) >+ { >+ //calculate the size of the resource by getting the java.io.File >+ long fileSize =resource.getLocation().toFile().length(); >+ if (fileSize != COMMON_LOGGING_JAR_SIZE) >+ { >+ deleteResource(resource); >+ } >+ } >+ } >+ >+ private void deleteResource(IFile resource) >+ { //delete the resource >+ try >+ { >+ //System.out.println("Obsolete Jar!! " + resource.getName()); >+ resource.delete(true, null); >+ } >+ catch (Exception e) >+ { //e.printStackTrace(); >+ } >+ } >+ >+ > public IStatus addAxisJarsToBuildPath(IProject p, IEnvironment env, IProgressMonitor monitor) > { > String[] jarNames = new String[JARLIST.length];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 155439
: 48929