summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Munoz2012-08-29 15:57:42 (EDT)
committerRoberto Sanchez2012-08-29 15:57:42 (EDT)
commit1523bbd63dfb8fb3c0f2c87aff45a9a010f44f8e (patch)
treee66787168387488d5df6a65fd62e7bea896ed816
parent44c11dc71c51b68cbf1e7ca29156d1f72548bdd0 (diff)
downloadwebtools.javaee-1523bbd63dfb8fb3c0f2c87aff45a9a010f44f8e.zip
webtools.javaee-1523bbd63dfb8fb3c0f2c87aff45a9a010f44f8e.tar.gz
webtools.javaee-1523bbd63dfb8fb3c0f2c87aff45a9a010f44f8e.tar.bz2
[372293] Meta-files should not be considered module membersv201208292200
-rw-r--r--plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java36
-rw-r--r--plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java2
2 files changed, 37 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
index 2f1dcb0..7396c7e 100644
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
@@ -13,11 +13,14 @@ package org.eclipse.jst.j2ee.internal.deployables;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -32,6 +35,7 @@ import org.eclipse.jst.j2ee.internal.IEJBModelExtenderManager;
import org.eclipse.jst.j2ee.internal.J2EEConstants;
import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyEnablement;
import org.eclipse.jst.j2ee.internal.common.exportmodel.JavaEESingleRootCallback;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.server.core.IApplicationClientModule;
@@ -48,6 +52,7 @@ import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.web.internal.deployables.FlatComponentDeployable;
@@ -58,6 +63,7 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements
IEnterpriseApplication, IApplicationClientModule,
IConnectorModule, IEJBModule, IWebModule, IUtilityModule, IWebFragmentModule {
+ private Set<String> metaResources = null;
/**
* Constructor for J2EEFlexProjDeployable.
*
@@ -66,8 +72,9 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements
*/
public J2EEFlexProjDeployable(IProject project, IVirtualComponent aComponent) {
super(project, aComponent);
+ declareMetadataResources();
}
-
+
/**
* Constructor for J2EEFlexProjDeployable.
*
@@ -248,4 +255,31 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements
}
return paths.toArray(new IPath[paths.size()]);
}
+
+
+ /**
+ * Retrieves the module members. The meta resources of project
+ * are filtered.
+ */
+ @Override
+ public IModuleResource[] members() throws CoreException {
+ List<IModuleResource> moduleResources = new ArrayList<IModuleResource>();
+ IModuleResource[] resources = super.members();
+
+ for(IModuleResource res : resources)
+ if(!metaResources.contains(res.getName()))
+ moduleResources.add(res);
+
+ return moduleResources.toArray(new IModuleResource[moduleResources.size()]);
+ }
+
+ /**
+ * This method declares the .project and .settings paths as
+ * meta resources, so they can be filtered from the members.
+ *
+ */
+ private void declareMetadataResources() {
+ metaResources = new HashSet<String>();
+ metaResources.add(IJ2EEModuleConstants.META_PROJECT_PATH);
+ }
}
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java
index 28a0a96..f64eeb7 100644
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java
+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java
@@ -29,4 +29,6 @@ public interface IJ2EEModuleConstants extends IModuleConstants {
public static final String JST_WEB_TEMPLATE = "template.jst.web"; //$NON-NLS-1$
public static final String WST_WEB_TEMPLATE = "template.wst.web"; //$NON-NLS-1$
public static final String JST_COMPONENT_FILE = "org.eclipse.wst.common.component";//$NON-NLS-1$
+
+ public static final String META_PROJECT_PATH = ".project";//$NON-NLS-1$
}