Author: Grid.Qian
Date: 2008-04-23 04:33:57 -0400 (Wed, 23 Apr 2008)
New Revision: 7701
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCore.properties
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCoreMessages.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JbossWSInstallRuntimeDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java
Log:
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCore.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCore.properties 2008-04-23
07:50:21 UTC (rev 7700)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCore.properties 2008-04-23
08:33:57 UTC (rev 7701)
@@ -1,4 +1,5 @@
PROGRESS_INSTALL_JBOSSWS_RUNTIME=JBoss Web Service Runtime
DIR_LIB=lib
DIR_WEB_INF=WEB-INF
-DIR_WEB_CONTENT=WebContent
\ No newline at end of file
+DIR_WEB_CONTENT=WebContent
+ERROR_COPY=Exception while copy JBossWS jars
\ No newline at end of file
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCoreMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCoreMessages.java 2008-04-23
07:50:21 UTC (rev 7700)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCoreMessages.java 2008-04-23
08:33:57 UTC (rev 7701)
@@ -25,6 +25,7 @@
public static String DIR_LIB;
public static String DIR_WEB_INF;
public static String DIR_WEB_CONTENT;
+ public static String ERROR_COPY;
static {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java 2008-04-23
07:50:21 UTC (rev 7700)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/command/JbossWSRuntimeCommand.java 2008-04-23
08:33:57 UTC (rev 7701)
@@ -11,8 +11,6 @@
package org.jboss.tools.ws.core.command;
-import java.util.List;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
@@ -42,13 +40,13 @@
}
public IStatus executeOverride(IProgressMonitor monitor) {
- IStatus status = null;
+ IStatus status = Status.OK_STATUS;
IPreferenceStore ps = JbossWSCorePlugin.getDefault()
.getPreferenceStore();
runtimeLocation = ps.getString("jbosswsruntimelocation");
- // copy lib to project's folder
+ // copy jars to project's folder
IPath libPath = new Path(runtimeLocation);
libPath = libPath.append(JbossWSCoreMessages.DIR_LIB);
@@ -57,54 +55,9 @@
targetPath = targetPath
.append(JbossWSCoreMessages.DIR_WEB_INF).append(
JbossWSCoreMessages.DIR_LIB);
- JbossWSCoreUtils.copy(libPath, targetPath);
+ status = JbossWSCoreUtils.copy(libPath, targetPath);
- status = Status.OK_STATUS;
return status;
}
- private void cleanupIfFacetStatusFailed(String runtimeLocation) {
- // File tempFacetDirectory = new File(runtimeLocation);
- // if (tempFacetDirectory.exists()) {
- // FileUtils.deleteDir(tempFacetDirectory);
- // }
- }
-
- private IStatus handleExceptionStatus(Exception e) {
- IStatus status = null;
- // status = new
- // Status(1,project.toString(),1,Axis2CoreUIMessages.ERROR_SERVER_IS_NOT_SET,e);
- // cleanupIfFacetStatusFailed(Axis2CoreUtils.tempAxis2Directory());
- return status;
- }
-
- /**
- * Load the exact libraries list from the axis2 jars with the correct
- * versions to the <code>path</code>. Doing it this way introduce the
- * scalability to the solution where the need comes in the future releases
- * to include additional libraries and if needed filter out some libraries.
- *
- * @param runtimeLocation
- * @param includeList
- * @return loaded list
- */
- private List loadIncludeListWithAxis2Libs(String path, List includeList) {
- // for (int i = 0; i < Axis2Constants.AXIS2_LIB_PREFIXES.length; i++) {
- // File[] jarFileList = FileUtils.getMatchingFiles(path,
- // Axis2Constants.AXIS2_LIB_PREFIXES[i],
- // Axis2Constants.JAR);
- // for (int j = 0; j < jarFileList.length; j++) {
- // includeList.add(jarFileList[j].getAbsolutePath());
- // }
- // // Fix for the 205972
- // File[] licenseFileList = FileUtils.getMatchingFiles(path,
- // Axis2Constants.AXIS2_LIB_PREFIXES[i],
- // Axis2Constants.TXT);
- // for (int k = 0; k < licenseFileList.length; k++) {
- // includeList.add(licenseFileList[k].getAbsolutePath());
- // }
- // }
- return includeList;
- }
-
}
\ No newline at end of file
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JbossWSInstallRuntimeDelegate.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JbossWSInstallRuntimeDelegate.java 2008-04-23
07:50:21 UTC (rev 7700)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JbossWSInstallRuntimeDelegate.java 2008-04-23
08:33:57 UTC (rev 7701)
@@ -14,7 +14,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.ws.core.JbossWSCoreMessages;
@@ -22,22 +21,12 @@
public class JbossWSInstallRuntimeDelegate implements IDelegate {
- private IStatus status;
-
public void execute(IProject project, IProjectFacetVersion arg1, Object arg2,
IProgressMonitor monitor) throws CoreException {
monitor.beginTask(JbossWSCoreMessages.PROGRESS_INSTALL_JBOSSWS_RUNTIME, 2 );
JbossWSRuntimeCommand command = new JbossWSRuntimeCommand(project);
- status = command.executeOverride(monitor);
-// if (status.getCode() == Status.OK_STATUS.getCode() ){
-// RuntimePropertyUtils.writeServerStausToPropertiesFile(
-// Axis2Constants.SERVER_STATUS_PASS);
-// }else{
-// RuntimePropertyUtils.writeServerStausToPropertiesFile(
-// Axis2Constants.SERVER_STATUS_FAIL);
-// throw new CoreException(status);
-// }
+ command.executeOverride(monitor);
monitor.worked( 1 );
monitor.done();
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java 2008-04-23
07:50:21 UTC (rev 7700)
+++
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/utils/JbossWSCoreUtils.java 2008-04-23
08:33:57 UTC (rev 7701)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.core.utils;
@@ -30,6 +30,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.ws.internal.common.J2EEUtils;
import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.ws.core.JbossWSCoreMessages;
public class JbossWSCoreUtils {
@@ -108,9 +109,10 @@
getProjectNameFromFramewokNameString(projectString));
}
- public static void copy(IPath sourcePath, IPath targetPath) {
+ public static IStatus copy(IPath sourcePath, IPath targetPath) {
System.out.println(sourcePath + " >> " + targetPath);
+ IStatus status = Status.OK_STATUS;
File sourceDir = sourcePath.toFile();
File[] children = sourceDir.listFiles();
@@ -120,26 +122,32 @@
try {
finStream = new FileInputStream(children[i]);
} catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ status = StatusUtils.errorStatus(
+ NLS.bind(JbossWSCoreMessages.ERROR_COPY,
+ new String[]{e.getLocalizedMessage()}), e);
}
try {
makeFile(getWorkspaceRoot().getContainerForLocation(
targetPath), children[i].getName(), finStream);
} catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ status = StatusUtils.errorStatus(
+ NLS.bind(JbossWSCoreMessages.ERROR_COPY,
+ new String[]{e.getLocalizedMessage()}), e);
}
} else {
try {
- copy(sourcePath.append(children[i].getName()),makeFolder(getWorkspaceRoot().getContainerForLocation(
- targetPath),children[i].getName()).getFullPath());
+ copy(sourcePath.append(children[i].getName()), makeFolder(
+ getWorkspaceRoot().getContainerForLocation(
+ targetPath), children[i].getName())
+ .getFullPath());
} catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ status = StatusUtils.errorStatus(
+ NLS.bind(JbossWSCoreMessages.ERROR_COPY,
+ new String[]{e.getLocalizedMessage()}), e);
}
}
}
+ return status;
}
private static IFolder makeFolder(IContainer parent, String folderName)