org.eclipse.wst.web_1.1.501.v201201190400

roject = ProjectFacetsManager.create(project);
      if (facetedProject == null) {
        return false;
      }
      IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet("wst.web");
      return facetedProject.hasProjectFacet(webFacet);
    }
    catch (Exception localException) {}
    return false;
  }
  
  public ModuleDelegate getModuleDelegate(IModule module)
  {
    for (Iterator iter = moduleDelegates.iterator(); iter.hasNext();)
    {
      ModuleDelegate element = (ModuleDelegate)iter.next();
      if (module == element.getModule()) {
        return element;
      }
    }
    return null;
  }
  
  protected IModule[] createModules(IProject project)
  {
    IVirtualComponent component = ComponentCore.createComponent(project);
    if (component != null) {
      try
      {
        return createModuleDelegates(component);
      }
      catch (CoreException e)
      {
        WSTWebPlugin.logError(e);
      }
    }
    return null;
  }
  
  /* Error */
  protected IModule[] createModuleDelegates(IVirtualComponent component)
    throws CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: aconst_null
    //   5: areturn
    //   6: aconst_null
    //   7: astore_2
    //   8: aconst_null
    //   9: astore_3
    //   10: aload_0
    //   11: aload_1
    //   12: invokeinterface 170 1 0
    //   17: invokevirtual 162	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:isValidModule	(Lorg/eclipse/core/resources/IProject;)Z
    //   20: ifeq +110 -> 130
    //   23: new 81	org/eclipse/wst/web/internal/deployables/StaticWebDeployable
    //   26: dup
    //   27: aload_1
    //   28: invokeinterface 170 1 0
    //   33: aload_1
    //   34: invokespecial 161	org/eclipse/wst/web/internal/deployables/StaticWebDeployable:<init>	(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/wst/common/componentcore/resources/IVirtualComponent;)V
    //   37: astore_2
    //   38: aload_0
    //   39: aload_1
    //   40: invokeinterface 169 1 0
    //   45: aload_1
    //   46: invokeinterface 169 1 0
    //   51: ldc 4
    //   53: aload_2
    //   54: invokevirtual 158	org/eclipse/wst/web/internal/deployables/StaticWebDeployable:getVersion	()Ljava/lang/String;
    //   57: aload_2
    //   58: invokevirtual 159	org/eclipse/wst/web/internal/deployables/StaticWebDeployable:getProject	()Lorg/eclipse/core/resources/IProject;
    //   61: invokevirtual 166	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:createModule	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/wst/server/core/IModule;
    //   64: astore_3
    //   65: aload_2
    //   66: aload_3
    //   67: invokevirtual 160	org/eclipse/wst/web/internal/deployables/StaticWebDeployable:initialize	(Lorg/eclipse/wst/server/core/IModule;)V
    //   70: goto +60 -> 130
    //   73: astore 4
    //   75: aload 4
    //   77: invokestatic 156	org/eclipse/wst/web/internal/WSTWebPlugin:logError	(Ljava/lang/Throwable;)V
    //   80: aload_3
    //   81: ifnull +70 -> 151
    //   84: aload_0
    //   85: aload_3
    //   86: invokevirtual 165	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:getModuleDelegate	(Lorg/eclipse/wst/server/core/IModule;)Lorg/eclipse/wst/server/core/model/ModuleDelegate;
    //   89: ifnonnull +62 -> 151
    //   92: aload_0
    //   93: getfield 145	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:moduleDelegates	Ljava/util/ArrayList;
    //   96: aload_2
    //   97: invokevirtual 147	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   100: pop
    //   101: goto +50 -> 151
    //   104: astore 5
    //   106: aload_3
    //   107: ifnull +20 -> 127
    //   110: aload_0
    //   111: aload_3
    //   112: invokevirtual 165	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:getModuleDelegate	(Lorg/eclipse/wst/server/core/IModule;)Lorg/eclipse/wst/server/core/model/ModuleDelegate;
    //   115: ifnonnull +12 -> 127
    //   118: aload_0
    //   119: getfield 145	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:moduleDelegates	Ljava/util/ArrayList;
    //   122: aload_2
    //   123: invokevirtual 147	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   126: pop
    //   127: aload 5
    //   129: athrow
    //   130: aload_3
    //   131: ifnull +20 -> 151
    //   134: aload_0
    //   135: aload_3
    //   136: invokevirtual 165	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:getModuleDelegate	(Lorg/eclipse/wst/server/core/IModule;)Lorg/eclipse/wst/server/core/model/ModuleDelegate;
    //   139: ifnonnull +12 -> 151
    //   142: aload_0
    //   143: getfield 145	org/eclipse/wst/web/internal/deployables/StaticWebDeployableFactory:moduleDelegates	Ljava/util/ArrayList;
    //   146: aload_2
    //   147: invokevirtual 147	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   150: pop
    //   151: aload_3
    //   152: ifnonnull +5 -> 157
    //   155: aconst_null
    //   156: areturn
    //   157: iconst_1
    //   158: anewarray 77	org/eclipse/wst/server/core/IModule
    //   161: dup
    //   162: iconst_0
    //   163: aload_3
    //   164: aastore
    //   165: areturn
    // Line number table:
    //   Java source line #105	-> byte code offset #0
    //   Java source line #106	-> byte code offset #4
    //   Java source line #108	-> byte code offset #6
    //   Java source line #109	-> byte code offset #8
    //   Java source line #111	-> byte code offset #10
    //   Java source line #112	-> byte code offset #23
    //   Java source line #113	-> byte code offset #38
    //   Java source line #114	-> byte code offset #65
    //   Java source line #116	-> byte code offset #73
    //   Java source line #117	-> byte code offset #75
    //   Java source line #119	-> byte code offset #80
    //   Java source line #120	-> byte code offset #84
    //   Java source line #121	-> byte code offset #92
    //   Java source line #118	-> byte code offset #104
    //   Java source line #119	-> byte code offset #106
    //   Java source line #120	-> byte code offset #110
    //   Java source line #121	-> byte code offset #118
    //   Java source line #123	-> byte code offset #127
    //   Java source line #119	-> byte code offset #130
    //   Java source line #120	-> byte code offset #134
    //   Java source line #121	-> byte code offset #142
    //   Java source line #124	-> byte code offset #151
    //   Java source line #125	-> byte code offset #155
    //   Java source line #126	-> byte code offset #157
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	166	0	this	StaticWebDeployableFactory
    //   0	166	1	component	IVirtualComponent
    //   7	140	2	moduleDelegate	StaticWebDeployable
    //   9	155	3	module	IModule
    //   73	3	4	e	Exception
    //   104	24	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   10	70	73	java/lang/Exception
    //   10	80	104	finally
  }
  
  protected IPath[] getListenerPaths()
  {
    return new IPath[] {
      new Path(".project"), 
      new Path(StructureEdit.MODULE_META_FILE_NAME), 
      new Path(".settings/org.eclipse.wst.common.project.facet.core.xml") };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.deployables.StaticWebDeployableFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.deployables;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.wst.server.core.IModuleArtifact;
import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;

public class StaticWebDeployableObjectAdapter
  extends ModuleArtifactAdapterDelegate
  implements IAdapterFactory
{
  public Object getAdapter(Object adaptableObject, Class adapterType)
  {
    return null;
  }
  
  public Class[] getAdapterList()
  {
    return new Class[] { IStaticWebModuleArtifact.class };
  }
  
  public IModuleArtifact getModuleArtifact(Object obj)
  {
    return StaticWebDeployableObjectAdapterUtil.getModuleObject(obj);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.deployables.StaticWebDeployableObjectAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.deployables;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleArtifact;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.util.WebResource;

public class StaticWebDeployableObjectAdapterUtil
{
  private static final String[] extensionsToExclude = { "sql", "xmi" };
  static String INFO_DIRECTORY = "WEB-INF";
  
  public static IModuleArtifact getModuleObject(Object obj)
  {
    IResource resource = null;
    if ((obj instanceof IResource)) {
      resource = (IResource)obj;
    } else if ((obj instanceof IAdaptable)) {
      resource = (IResource)((IAdaptable)obj).getAdapter(IResource.class);
    }
    if (resource == null) {
      return null;
    }
    if ((resource instanceof IProject))
    {
      IProject project = (IProject)resource;
      if (hasInterestedComponents(project)) {
        return new WebResource(getModule(project), new Path(""));
      }
      return null;
    }
    IProject project = ProjectUtilities.getProject(resource);
    if ((project != null) && (!hasInterestedComponents(project))) {
      return null;
    }
    IVirtualComponent comp = ComponentCore.createComponent(project);
    
    IPath rootPath = comp.getRootFolder().getProjectRelativePath();
    IPath resourcePath = resource.getProjectRelativePath();
    if (resourcePath.matchingFirstSegments(rootPath) != rootPath.segmentCount()) {
      return null;
    }
    resourcePath = resourcePath.removeFirstSegments(rootPath.segmentCount());
    if ((resourcePath.segmentCount() > 1) && (resourcePath.segment(0).equals(INFO_DIRECTORY))) {
      return null;
    }
    if (shouldExclude(resource)) {
      return null;
    }
    return new WebResource(getModule(project), resourcePath);
  }
  
  private static boolean shouldExclude(IResource resource)
  {
    String fileExt = resource.getFileExtension();
    for (int i = 0; i < extensionsToExclude.length; i++)
    {
      String extension = extensionsToExclude[i];
      if (extension.equalsIgnoreCase(fileExt)) {
        return true;
      }
    }
    return false;
  }
  
  protected static IModule getModule(IProject project)
  {
    if (hasInterestedComponents(project)) {
      return ServerUtil.getModule(project);
    }
    return null;
  }
  
  protected static boolean hasInterestedComponents(IProject project)
  {
    return isProjectOfType(project, "wst.web");
  }
  
  protected static boolean isProjectOfType(IProject project, String typeID)
  {
    IFacetedProject facetedProject = null;
    try
    {
      facetedProject = ProjectFacetsManager.create(project);
    }
    catch (CoreException localCoreException)
    {
      return false;
    }
    if ((facetedProject != null) && (ProjectFacetsManager.isProjectFacetDefined(typeID)))
    {
      IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID);
      return (projectFacet != null) && (facetedProject.hasProjectFacet(projectFacet));
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.deployables.StaticWebDeployableObjectAdapterUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.facet;

import org.eclipse.core.runtime.IConfigurationElement;

public class MappingDescriptor
{
  protected IConfigurationElement element = null;
  
  public MappingDescriptor(IConfigurationElement configurationElement)
  {
    element = configurationElement;
  }
  
  public IConfigurationElement getElement()
  {
    return element;
  }
  
  public String getID()
  {
    return element.getAttribute("id");
  }
  
  public String getFacetRuntimeTypeID()
  {
    return element.getAttribute("facetRuntimeTypeID");
  }
  
  public String getFacetRuntimeVersion()
  {
    return element.getAttribute("facetRuntimeVersion");
  }
  
  public String getFacetID()
  {
    return element.getAttribute("facetID");
  }
  
  public String getFacetVersion()
  {
    return element.getAttribute("facetVersion");
  }
  
  public String getPresetID()
  {
    return element.getAttribute("presetID");
  }
  
  public String toString()
  {
    StringBuffer buff = new StringBuffer();
    buff.append("id:");
    buff.append(getID());
    buff.append(" facetRuntimeTypeID:");
    buff.append(getFacetRuntimeTypeID());
    buff.append(" facetRuntimeVersion:");
    buff.append(getFacetRuntimeVersion());
    buff.append(" facetID:");
    buff.append(getFacetID());
    buff.append(" facetVersion:");
    buff.append(getFacetVersion());
    buff.append(" presetID:");
    buff.append(getPresetID());
    return buff.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.facet.MappingDescriptor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.facet;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentType;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentVersion;
import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.web.internal.WSTWebPlugin;

public class RuntimePresetMappingRegistry
{
  static final String EXTENSION_POINT = "runtimePresetMappings";
  static final String ELEMENT_MAPPING = "mapping";
  static final String ATTRIBUTE_ID = "id";
  static final String ATTRIBUTE_FACET_RUNTIME_TYPE_ID = "facetRuntimeTypeID";
  static final String ATTRIBUTE_FACET_RUNTIME_VERSION = "facetRuntimeVersion";
  static final String ATTRIBUTE_FACET_ID = "facetID";
  static final String ATTRIBUTE_FACET_VERSION = "facetVersion";
  static final String ATTRIBUTE_PRESET_ID = "presetID";
  public static RuntimePresetMappingRegistry INSTANCE = new RuntimePresetMappingRegistry();
  private List<MappingDescriptor> descriptors = null;
  
  public String getPresetID(String facetRuntimeTypeID, String facetRuntimeVersion, String facetID, String facetVersion)
  {
    if (descriptors == null) {
      readDescriptors();
    }
    for (MappingDescriptor descriptor : descriptors) {
      if ((matches(facetRuntimeTypeID, descriptor.getFacetRuntimeTypeID())) && 
        (matches(facetRuntimeVersion, descriptor.getFacetRuntimeVersion())) && 
        (matches(facetID, descriptor.getFacetID())) && 
        (matches(facetVersion, descriptor.getFacetVersion()))) {
        return descriptor.getPresetID();
      }
    }
    return null;
  }
  
  private static boolean matches(String value, String pattern)
  {
    StringTokenizer strTok = new StringTokenizer(pattern, ",");
    while (strTok.hasMoreTokens())
    {
      String simplePattern = strTok.nextToken().trim();
      if (simplePattern.startsWith("*"))
      {
        if (simplePattern.length() < 2) {
          return true;
        }
        if (simplePattern.endsWith("*"))
        {
          if (simplePattern.length() < 3) {
            return true;
          }
          if (value.indexOf(simplePattern.substring(1, simplePattern.length() - 2)) != -1) {
            return true;
          }
        }
        else if (value.endsWith(simplePattern.substring(1)))
        {
          return true;
        }
      }
      else if (simplePattern.endsWith("*"))
      {
        if (value.startsWith(simplePattern.substring(0, simplePattern.length() - 2))) {
          return true;
        }
      }
      else if (value.equals(simplePattern))
      {
        return true;
      }
    }
    return false;
  }
  
  private static List<String> getStaticTokens(String pattern)
  {
    List<String> staticTokens = new ArrayList();
    StringTokenizer strTok = new StringTokenizer(pattern, ",");
    while (strTok.hasMoreTokens())
    {
      String simplePattern = strTok.nextToken().trim();
      if ((!simplePattern.startsWith("*")) && (!simplePattern.endsWith("*"))) {
        staticTokens.add(simplePattern);
      }
    }
    return staticTokens;
  }
  
  private void readDescriptors()
  {
    descriptors = new ArrayList();
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.wst.web", "runtimePresetMappings");
    if (point == null) {
      return;
    }
    IConfigurationElement[] elements = point.getConfigurationElements();
    for (int i = 0; i < elements.length; i++)
    {
      IConfigurationElement element = elements[i];
      if ("mapping".equals(element.getName()))
      {
        String id = element.getAttribute("id");
        if ((id == null) || (id.trim().length() == 0))
        {
          WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute id");
        }
        else
        {
          String runtimeID = element.getAttribute("facetRuntimeTypeID");
          if ((runtimeID == null) || (runtimeID.trim().length() == 0))
          {
            WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute facetRuntimeTypeID");
          }
          else
          {
            List<String> staticRuntimeIDs = getStaticTokens(runtimeID);
            List<IRuntimeComponentType> staticRuntimeTypes = new ArrayList();
            for (String staticRuntimeID : staticRuntimeIDs) {
              try
              {
                IRuntimeComponentType runtimeType = RuntimeManager.getRuntimeComponentType(staticRuntimeID);
                if (runtimeType != null) {
                  staticRuntimeTypes.add(runtimeType);
                }
              }
              catch (IllegalArgumentException e)
              {
                WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping defined invalid attribute facetRuntimeTypeID: " + runtimeID + " unable to resolve runtime: " + staticRuntimeID, e);
              }
            }
            String runtimeVersionStr = element.getAttribute("facetRuntimeVersion");
            if ((runtimeVersionStr == null) || (runtimeVersionStr.trim().length() == 0))
            {
              WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute facetRuntimeVersion");
            }
            else
            {
              StringBuffer validVersions;
              Iterator localIterator3;
              if (!staticRuntimeTypes.isEmpty())
              {
                Object staticRuntimeVersions = getStaticTokens(runtimeVersionStr);
                for (String staticVersion : (List)staticRuntimeVersions)
                {
                  boolean foundVersion = false;
                  for (int k = 0; (k < staticRuntimeTypes.size()) && (!foundVersion); k++)
                  {
                    IRuntimeComponentType runtimeType = (IRuntimeComponentType)staticRuntimeTypes.get(k);
                    try
                    {
                      runtimeType.getVersion(staticVersion);
                      foundVersion = true;
                    }
                    catch (IllegalArgumentException localIllegalArgumentException1) {}
                  }
                  if (!foundVersion)
                  {
                    validVersions = new StringBuffer(" valid versions include: ");
                    Iterator<IRuntimeComponentVersion> iterator;
                    for (localIterator3 = staticRuntimeTypes.iterator(); localIterator3.hasNext(); iterator.hasNext())
                    {
                      IRuntimeComponentType runtimeType = (IRuntimeComponentType)localIterator3.next();
                      validVersions.append("\n");
                      validVersions.append(runtimeType.getId());
                      validVersions.append(": ");
                      iterator = runtimeType.getVersions().iterator(); continue;
                      validVersions.append(((IRuntimeComponentVersion)iterator.next()).getVersionString());
                      if (iterator.hasNext()) {
                        validVersions.append(" ");
                      }
                    }
                    WSTWebPlugin.logError(
                      "Extension: runtimePresetMappings Element: mapping defined invalid attribute facetRuntimeVersion: " + staticVersion + validVersions);
                  }
                }
              }
              String facetID = element.getAttribute("facetID");
              if ((facetID == null) || (facetID.trim().length() == 0))
              {
                WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute facetID");
              }
              else
              {
                List<String> staticFacetIDs = getStaticTokens(facetID);
                Object staticFacets = new ArrayList();
                for (String staticFacetID : staticFacetIDs) {
                  try
                  {
                    IProjectFacet facet = ProjectFacetsManager.getProjectFacet(staticFacetID);
                    if (facet != null) {
                      ((List)staticFacets).add(facet);
                    }
                  }
                  catch (IllegalArgumentException e)
                  {
                    WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping defined invalid attribute facetID: " + staticFacetID, e);
                  }
                }
                String facetVersionStr = element.getAttribute("facetVersion");
                if ((facetVersionStr == null) || (facetVersionStr.trim().length() == 0))
                {
                  WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute facetVersion");
                }
                else
                {
                  List<String> staticFacetVersionStrs = getStaticTokens(facetVersionStr);
                  if ((!((List)staticFacets).isEmpty()) && (!staticFacetVersionStrs.isEmpty())) {
                    for (String staticFacetVersion : staticFacetVersionStrs)
                    {
                      boolean foundFacetVersion = false;
                      IProjectFacetVersion staticVersion;
                      for (int k = 0; (k < ((List)staticFacets).size()) && (!foundFacetVersion); k++)
                      {
                        IProjectFacet staticFacet = (IProjectFacet)((List)staticFacets).get(k);
                        try
                        {
                          staticVersion = staticFacet.getVersion(staticFacetVersion);
                          if (staticVersion != null) {
                            foundFacetVersion = true;
                          }
                        }
                        catch (IllegalArgumentException localIllegalArgumentException2) {}
                      }
                      if (!foundFacetVersion)
                      {
                        StringBuffer validVersions = new StringBuffer(" valid versions include: ");
                        Iterator<IProjectFacetVersion> iterator;
                        for (staticVersion = ((List)staticFacets).iterator(); staticVersion.hasNext(); iterator.hasNext())
                        {
                          IProjectFacet staticFacet = (IProjectFacet)staticVersion.next();
                          validVersions.append("\n");
                          validVersions.append(staticFacet.getId());
                          validVersions.append(": ");
                          iterator = staticFacet.getVersions().iterator(); continue;
                          validVersions.append(((IProjectFacetVersion)iterator.next()).getVersionString());
                          if (iterator.hasNext()) {
                            validVersions.append(" ");
                          }
                        }
                        WSTWebPlugin.logError(
                          "Extension: runtimePresetMappings Element: mapping defined invalid attribute facetVersion: " + staticFacetVersion + validVersions);
                      }
                    }
                  }
                  String presetID = element.getAttribute("presetID");
                  if ((presetID == null) || (presetID.trim().length() == 0))
                  {
                    WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping is missing attribute presetID");
                  }
                  else
                  {
                    try
                    {
                      ProjectFacetsManager.getPreset(presetID);
                    }
                    catch (IllegalArgumentException e)
                    {
                      WSTWebPlugin.logError("Extension: runtimePresetMappings Element: mapping defined invalid attribute presetID: " + presetID, e);
                      continue;
                    }
                    MappingDescriptor descriptor = new MappingDescriptor(element);
                    descriptors.add(descriptor);
                  }
                }
              }
            }
          }
        }
      }
      else
      {
        WSTWebPlugin.logError("Elements must be named: mapping within the extension: runtimePresetMappings");
        WSTWebPlugin.logError("Element: " + element.getName() + " is invalid within the extension: " + "runtimePresetMappings");
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.facet.RuntimePresetMappingRegistry
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.operation;

/**
 * @deprecated
 */
public abstract interface IWebProjectPropertiesUpdateDataModelProperties
{
  public static final String PROJECT = "IWebProjectPropertiesUpdateDataModelProperties.PROJECT";
  public static final String CONTEXT_ROOT = "IWebProjectPropertiesUpdateDataModelProperties.CONTEXT_ROOT";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.operation.IWebProjectPropertiesUpdateDataModelProperties
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.operation;

import java.util.Set;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;

/**
 * @deprecated
 */
public class WebProjectPropertiesUpdateDataModelProvider
  extends AbstractDataModelProvider
  implements IWebProjectPropertiesUpdateDataModelProperties
{
  public Set getPropertyNames()
  {
    Set names = super.getPropertyNames();
    names.add("IWebProjectPropertiesUpdateDataModelProperties.PROJECT");
    names.add("IWebProjectPropertiesUpdateDataModelProperties.CONTEXT_ROOT");
    return names;
  }
  
  public IDataModelOperation getDefaultOperation()
  {
    return new WebProjectPropertiesUpdateOperation(model);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.operation.WebProjectPropertiesUpdateDataModelProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.web.internal.operation;

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;

/**
 * @deprecated
 */
public class WebProjectPropertiesUpdateOperation
  extends AbstractDataModelOperation
  implements IWebProjectPropertiesUpdateDataModelProperties
{
  public WebProjectPropertiesUpdateOperation(IDataModel model)
  {
    super(model);
  }
  
  public IStatus execute(IProgressMonitor monitor, IAdaptable info)
    throws ExecutionException
  {
    IProject project = (IProject)model.getProperty("IWebProjectPropertiesUpdateDataModelProperties.PROJECT");
    String contextRoot = model.getStringProperty("IWebProjectPropertiesUpdateDataModelProperties.CONTEXT_ROOT");
    if (contextRoot != null) {
      ComponentUtilities.setServerContextRoot(project, contextRoot);
    }
    return OK_STATUS;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.web.internal.operation.WebProjectPropertiesUpdateOperation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1 2 3

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd