woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file ProjectPatternsets.java,NONE,1.1 FileAdapterFactory.java,1.1,1.2 FileTypesTestSuite.java,1.1,1.2 DotWOLipsAdapter.java,1.2,NONE DotWOLipsAdapterTest.java,1.1,NONE DefaultDotWOLips.xml,1.1,NONE

[email protected] Sat, 25 Mar 2006 03:32:03 -0800 (PST)
Newsgroups gmane.comp.web.webobjects.woproject.cvs
Message-ID <[email protected]>
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11894/java/org/objectstyle/wolips/core/resources/internal/types/file

Modified Files:
	FileAdapterFactory.java FileTypesTestSuite.java 
Added Files:
	ProjectPatternsets.java 
Removed Files:
	DotWOLipsAdapter.java DotWOLipsAdapterTest.java 
	DefaultDotWOLips.xml 
Log Message:
Get rid of the .WOLips file.

--- NEW FILE: ProjectPatternsets.java ---
/* ====================================================================
 * 
 * The ObjectStyle Group Software License, Version 1.0 
 *
 * Copyright (c) 2004 - 2006 The ObjectStyle Group 
 * and individual authors of the software.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowlegement:  
 *       "This product includes software developed by the 
 *        ObjectStyle Group (http://objectstyle.org/)."
 *    Alternately, this acknowlegement may appear in the software itself,
 *    if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "ObjectStyle Group" and "Cayenne" 
 *    must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written 
 *    permission, please contact [email protected].
 *
 * 5. Products derived from this software may not be called "ObjectStyle"
 *    nor may "ObjectStyle" appear in their names without prior written
 *    permission of the ObjectStyle Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the ObjectStyle Group.  For more
 * information on the ObjectStyle Group, please see
 * <http://objectstyle.org/>.
 *
 */
package org.objectstyle.wolips.core.resources.internal.types.file;

import java.io.File;
import java.util.ArrayList;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.objectstyle.wolips.core.CorePlugin;
import org.objectstyle.wolips.core.resources.pattern.PatternsetMatcher;
import org.objectstyle.wolips.core.resources.pattern.PatternsetWriter;

/**
 * @author ulrich
 * 
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class ProjectPatternsets {
	
	/**
	 * EXTENSION file extension for patternset files
	 */
	public final static String EXTENSION = "patternset";

	/**
	 * name of the woproject folder
	 */
	public final static String ANT_FOLDER_NAME = "woproject";

	protected final static String LEGACY_ANT_FOLDER_NAME = "ant";

	private PatternsetMatcher woappResourcesIncludeMatcher = null;

	private PatternsetMatcher woappResourcesExcludeMatcher = null;

	private PatternsetMatcher resourcesIncludeMatcher = null;

	private PatternsetMatcher resourcesExcludeMatcher = null;

	private PatternsetMatcher classesIncludeMatcher = null;

	private PatternsetMatcher classesExcludeMatcher = null;

	private final static PatternsetMatcher DEFAULT_EXCLUDE_MATCHER = new PatternsetMatcher(
			new String[] { "**/.svn", "**/.svn/**", "**/CVS", "**.*~/**",
					"**/CVS/**", "**/build/**", "**/dist/**" });

	private IProject project;
	/**
	 * @param project
	 */
	public ProjectPatternsets(IProject project) {
		super();
		this.project = project;
	}

	/**
	 * Creates the folder "ant" within the project if it does not exist.
	 */
	public void createAntFolder() {
		if (this.getAntFolder().exists()) {
			return;
		}
		IWorkspaceRunnable operation = new IWorkspaceRunnable() {

			public void run(IProgressMonitor monitor) throws CoreException {
				String string = getAntFolder().getLocation().toOSString();
				File file = new File(string);
				file.mkdirs();
				try {
					getAntFolder().refreshLocal(IResource.DEPTH_ZERO, monitor);
				} catch (CoreException e) {
					CorePlugin.getDefault().log(e);
				}
			}

		};
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
		try {
			workspace.run(operation, this.getIProject(),
					IWorkspace.AVOID_UPDATE, new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @return the ant folder within the project
	 */
	public IFolder getAntFolder() {
		IFolder folder = this.getIProject().getFolder(
				ProjectPatternsets.LEGACY_ANT_FOLDER_NAME);
		if (!folder.exists())
			folder = this.getIProject().getFolder(
					ProjectPatternsets.ANT_FOLDER_NAME);
		return folder;
	}

	private void run(IProject rule,
			PatternsetWorkspaceRunnable patternsetWorkspaceRunnable) {
		try {
			ResourcesPlugin.getWorkspace().run(patternsetWorkspaceRunnable,
					rule, IResource.NONE, null);
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	class PatternsetWorkspaceRunnable implements IWorkspaceRunnable {
		private IFile patternset;

		private PatternsetMatcher matcher;

		private String[] defaultPattern;

		PatternsetWorkspaceRunnable(IFile patternset,
				String[] defaultPattern) {
			super();
			this.patternset = patternset;
			this.defaultPattern = defaultPattern;

		}

		public void run(IProgressMonitor pm) throws CoreException {
			if (!patternset.exists()) {
				PatternsetWriter.create(patternset, defaultPattern);
				try {
					patternset.refreshLocal(IResource.DEPTH_ONE,
							new NullProgressMonitor());
				} catch (CoreException e) {
					CorePlugin.getDefault().log(e);
				}
			}
			this.matcher = new PatternsetMatcher(patternset);

		}

		protected PatternsetMatcher getMatcher() {
			return matcher;
		}
	}

	/**
	 * @return Returns the classesExcludeMatcher.
	 */
	public PatternsetMatcher getClassesExcludeMatcher() {
		if (this.classesExcludeMatcher != null) {
			return this.classesExcludeMatcher;
		}
		this.createAntFolder();
		IFile classesExcludePatternset = this.getAntFolder().getFile(
				"classes.exclude.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
				classesExcludePatternset, new String[] { "build.properties" });
		this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.classesExcludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.classesExcludeMatcher;
	}

	/**
	 * @return Returns the classesIncludeMatcher.
	 */
	public PatternsetMatcher getClassesIncludeMatcher() {
		if (this.classesIncludeMatcher != null) {
			return this.classesIncludeMatcher;
		}
		this.createAntFolder();
		IFile classesIncludePatternset = this.getAntFolder().getFile(
				"classes.include.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
					classesIncludePatternset,
					new String[] { "**/*.class", "*.properties" });
			this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.classesIncludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.classesIncludeMatcher;
	}

	/**
	 * @return Returns the resourcesExcludeMatcher.
	 */
	public PatternsetMatcher getResourcesExcludeMatcher() {
		if (this.resourcesExcludeMatcher != null) {
			return this.resourcesExcludeMatcher;
		}
		this.createAntFolder();
		IFile resourcesExcludePatternset = this.getAntFolder().getFile(
				"resources.exclude.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
					resourcesExcludePatternset,
					new String[] { "**/*.eomodeld~/", "**/*.woa/**",
							"**/*.framework/**" });
			this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.resourcesExcludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.resourcesExcludeMatcher;
	}

	/**
	 * @return Returns the resourcesIncludeMatcher.
	 */
	public PatternsetMatcher getResourcesIncludeMatcher() {
		if (this.resourcesIncludeMatcher != null) {
			return this.resourcesIncludeMatcher;
		}
		this.createAntFolder();
		IFile resourcesIncludePatternset = this.getAntFolder().getFile(
				"resources.include.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
					resourcesIncludePatternset,
					new String[] { "Properties", "**/*.eomodeld/",
							"**/*.d2wmodel", "**/*.wo/", "**/*.api",
							"**/*.strings" });
			this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.resourcesIncludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.resourcesIncludeMatcher;
	}

	/**
	 * @return Returns the woappResourcesExcludeMatcher.
	 */
	public PatternsetMatcher getWoappResourcesExcludeMatcher() {
		if (this.woappResourcesExcludeMatcher != null) {
			return this.woappResourcesExcludeMatcher;
		}
		this.createAntFolder();
		IFile wsresourcesExcludePatternset = this.getAntFolder().getFile(
				"wsresources.exclude.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
					wsresourcesExcludePatternset,
					new String[] { "**/*.woa/**", "**/*.framework/**" });
			this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.woappResourcesExcludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.woappResourcesExcludeMatcher;
	}

	/**
	 * @return Returns the woappResourcesIncludeMatcher.
	 */
	public PatternsetMatcher getWoappResourcesIncludeMatcher() {
		if (this.woappResourcesIncludeMatcher != null) {
			return this.woappResourcesIncludeMatcher;
		}
		this.createAntFolder();
		IFile wsresourcesIncludePatternset = this.getAntFolder().getFile(
				"wsresources.include.patternset");
		PatternsetWorkspaceRunnable patternsetWorkspaceRunnable = new PatternsetWorkspaceRunnable(
					wsresourcesIncludePatternset,
					new String[] { "**/*.gif", "**/*.xsl", "**/*.css",
							"**/*.png", "**/*.jpg", "**/*.js" });
			this.run(this.getIProject(), patternsetWorkspaceRunnable);
		this.woappResourcesIncludeMatcher = patternsetWorkspaceRunnable.getMatcher();
		return this.woappResourcesIncludeMatcher;
	}

	private String[] toProjectRelativePaths(IResource resource) {
		String[] returnValue = null;
		if (resource.getParent().getType() != IResource.ROOT
		/* && resource.getParent().getType() != IResource.PROJECT */) {
			returnValue = new String[2];
			String string = null;
			if (resource.getType() != IResource.FOLDER) {
				IPath path = resource.getParent().getProjectRelativePath();
				/*
				 * String string = resource.getProject().getName() + "/" +
				 * path.toString() + "/";
				 */
				string = path.toString() + "/";
			} else {
				string = "/" + resource.getName() + "/";
			}
			returnValue[0] = string;
		} else {
			returnValue = new String[1];
		}
		IPath path = resource.getProjectRelativePath();
		//String string = resource.getProject().getName() + "/" +
		// path.toString();
		String string = path.toString();
		if (returnValue.length == 2) {
			returnValue[1] = string;
		} else {
			returnValue[0] = string;
		}
		return returnValue;
	}

	/**
	 * @param resource
	 * @return true if the resource matches the classes pattern
	 */
	public boolean matchesClassesPattern(IResource resource) {
		String[] strings = this.toProjectRelativePaths(resource);
		if (this.getClassesExcludeMatcher().match(strings))
			return false;
		if (DEFAULT_EXCLUDE_MATCHER.match(strings))
			return false;
		return this.getClassesIncludeMatcher().match(strings);
	}

	/**
	 * @param resource
	 * @return true if the resource matches the WOAppResources pattern
	 */
	public boolean matchesWOAppResourcesPattern(IResource resource) {
		String[] strings = this.toProjectRelativePaths(resource);
		if (this.getWoappResourcesExcludeMatcher().match(strings))
			return false;
		if (DEFAULT_EXCLUDE_MATCHER.match(strings))
			return false;
		return this.getWoappResourcesIncludeMatcher().match(strings);
	}

	/**
	 * @param resource
	 * @return true if the resource matches the Resources pattern
	 */
	public boolean matchesResourcesPattern(IResource resource) {
		String[] strings = this.toProjectRelativePaths(resource);
		if (this.getResourcesExcludeMatcher().match(strings))
			return false;
		if (DEFAULT_EXCLUDE_MATCHER.match(strings))
			return false;
		return this.getResourcesIncludeMatcher().match(strings);
	}

	/**
	 * Sets up the *.patternset files in the case they don't exist.
	 */
	public void setUpPatternsetFiles() {
		this.getClassesExcludeMatcher();
		this.getClassesIncludeMatcher();
		this.getResourcesExcludeMatcher();
		this.getResourcesIncludeMatcher();
		this.getWoappResourcesExcludeMatcher();
		this.getWoappResourcesIncludeMatcher();
	}

	/**
	 * Releases the patternset cache
	 */
	public void releasePatternsetCache() {
		this.woappResourcesIncludeMatcher = null;
		this.woappResourcesExcludeMatcher = null;
		this.resourcesIncludeMatcher = null;
		this.resourcesExcludeMatcher = null;
		this.classesIncludeMatcher = null;
		this.classesExcludeMatcher = null;
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasClassesIncludePattern(String string) {
		return this.getClassesIncludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasClassesExcludePattern(String string) {
		return this.getClassesExcludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasWOAppResourcesIncludePattern(String string) {
		return this.getWoappResourcesIncludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasWOAppResourcesExcludePattern(String string) {
		return this.getWoappResourcesExcludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasResourcesIncludePattern(String string) {
		return this.getResourcesIncludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 * @return true is the pattern allready exists
	 */
	public boolean hasResourcesExcludePattern(String string) {
		return this.getResourcesExcludeMatcher().hasPattern(string);
	}

	/**
	 * @param string
	 */
	public void addClassesIncludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this
				.getClassesIncludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile classesIncludePatternset = this.getAntFolder().getFile(
				"classes.include.patternset");
		PatternsetWriter.create(classesIncludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.classesIncludeMatcher = new PatternsetMatcher(
				classesIncludePatternset);
		try {
			classesIncludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @param string
	 */
	public void addClassesExcludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this
				.getClassesExcludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile classesExcludePatternset = this.getAntFolder().getFile(
				"classes.exclude.patternset");
		PatternsetWriter.create(classesExcludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.classesExcludeMatcher = new PatternsetMatcher(
				classesExcludePatternset);
		try {
			classesExcludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @param string
	 */
	public void addWOAppResourcesIncludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this
				.getWoappResourcesIncludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile wsresourcesIncludePatternset = this.getAntFolder().getFile(
				"wsresources.include.patternset");
		PatternsetWriter.create(wsresourcesIncludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.woappResourcesIncludeMatcher = new PatternsetMatcher(
				wsresourcesIncludePatternset);
		try {
			wsresourcesIncludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @param string
	 */
	public void addWOAppResourcesExcludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this
				.getWoappResourcesExcludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile wsresourcesExcludePatternset = this.getAntFolder().getFile(
				"wsresources.exclude.patternset");
		PatternsetWriter.create(wsresourcesExcludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.woappResourcesExcludeMatcher = new PatternsetMatcher(
				wsresourcesExcludePatternset);
		try {
			wsresourcesExcludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @param string
	 */
	public void addResourcesIncludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this
				.getResourcesIncludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile resourcesIncludePatternset = this.getAntFolder().getFile(
				"resources.include.patternset");
		PatternsetWriter.create(resourcesIncludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.resourcesIncludeMatcher = new PatternsetMatcher(
				resourcesIncludePatternset);
		try {
			resourcesIncludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	/**
	 * @param string
	 */
	public void addResourcesExcludePattern(String string) {
		PatternsetMatcher patternsetMatcher = this.getResourcesExcludeMatcher();
		String[] pattern = patternsetMatcher.getPattern();
		ArrayList list = new ArrayList();
		for (int i = 0; i < pattern.length; i++) {
			list.add(pattern[i]);
		}
		list.add(string);
		IFile resourcesexcludePatternset = this.getAntFolder().getFile(
				"resources.exclude.patternset");
		PatternsetWriter.create(resourcesexcludePatternset, (String[]) list
				.toArray(new String[list.size()]));
		this.resourcesIncludeMatcher = new PatternsetMatcher(
				resourcesexcludePatternset);
		try {
			resourcesexcludePatternset.refreshLocal(IResource.DEPTH_ONE,
					new NullProgressMonitor());
		} catch (CoreException e) {
			CorePlugin.getDefault().log(e);
		}
	}

	public IProject getIProject() {
		return project;
	}

}
Index: FileAdapterFactory.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file/FileAdapterFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- FileAdapterFactory.java	12 Aug 2005 18:08:45 -0000	1.1
+++ FileAdapterFactory.java	25 Mar 2006 11:30:50 -0000	1.2
@@ -2,7 +2,7 @@
  *
  * The ObjectStyle Group Software License, Version 1.0
  *
- * Copyright (c) 2005 The ObjectStyle Group,
+ * Copyright (c) 2005 - 2006 The ObjectStyle Group,
  * and individual authors of the software.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -62,17 +62,14 @@
 import org.objectstyle.wolips.core.resources.internal.build.Nature;
 import org.objectstyle.wolips.core.resources.internal.types.AbstractResourceAdapterFactory;
 import org.objectstyle.wolips.core.resources.types.IResourceType;
-import org.objectstyle.wolips.core.resources.types.file.IDotWOLipsAdapter;
 import org.objectstyle.wolips.core.resources.types.file.IPBDotProjectAdapter;
 
 /**
- * @author ulrich To change the template for this generated type comment go to
- *         Window>Preferences>Java>Code Generation>Code and Comments
+ * @author ulrich
  */
 public class FileAdapterFactory extends AbstractResourceAdapterFactory {
 
-	private Class[] adapterList = new Class[] { IDotWOLipsAdapter.class,
-			IPBDotProjectAdapter.class };
+	private Class[] adapterList = new Class[] { IPBDotProjectAdapter.class };
 
 	public Class[] getAdapterList() {
 		return this.adapterList;
@@ -83,23 +80,16 @@
 			return false;
 		}
 		IFile file = (IFile) adaptableObject;
-		if (adapterType == IDotWOLipsAdapter.class) {
-				String name = file.getName();
-				if (IDotWOLipsAdapter.FILE_NAME.equals(name)) {
-					 return true;
-				}
-			}
-		else if (adapterType == IPBDotProjectAdapter.class) {
-				String name = file.getName();
-				if (IPBDotProjectAdapter.FILE_NAME.equals(name)) {
-					return true;
-				}
+		if (adapterType == IPBDotProjectAdapter.class) {
+			String name = file.getName();
+			if (IPBDotProjectAdapter.FILE_NAME.equals(name)) {
+				return true;
 			}
+		}
 		return false;
 	}
 
-	public IResourceType createAdapter(Object adaptableObject,
-			Class adapterType) {
+	public IResourceType createAdapter(Object adaptableObject, Class adapterType) {
 		IFile file = (IFile) adaptableObject;
 		IProject project = file.getProject();
 		Nature nature = null;
@@ -113,9 +103,7 @@
 		if (nature == null) {
 			return null;
 		}
-		if (adapterType == IDotWOLipsAdapter.class) {
-			return new DotWOLipsAdapter(file);
-		} else if (adapterType == IPBDotProjectAdapter.class) {
+		if (adapterType == IPBDotProjectAdapter.class) {
 			return new PBDotProjectAdapter(file);
 		}
 		return null;

Index: FileTypesTestSuite.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/file/FileTypesTestSuite.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- FileTypesTestSuite.java	12 Aug 2005 18:08:45 -0000	1.1
+++ FileTypesTestSuite.java	25 Mar 2006 11:30:50 -0000	1.2
@@ -2,7 +2,7 @@
  *
  * The ObjectStyle Group Software License, Version 1.0
  *
- * Copyright (c) 2005 The ObjectStyle Group,
+ * Copyright (c) 2005 - 2006 The ObjectStyle Group,
  * and individual authors of the software.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -60,7 +60,7 @@
 import junit.framework.TestSuite;
 
 /**
- * Run all compiler regression tests
+ * Run all file types regression tests
  */
 public class FileTypesTestSuite extends TestCase {
 
@@ -77,7 +77,6 @@
 	 */
 	public static Test suite() throws Exception {
 		TestSuite suite = new TestSuite();
-		suite.addTestSuite(DotWOLipsAdapterTest.class);
 		suite.addTestSuite(PBDotProjectAdapterTest.class);
 		return suite;
 	}

--- DotWOLipsAdapter.java DELETED ---

--- DotWOLipsAdapterTest.java DELETED ---

--- DefaultDotWOLips.xml DELETED ---



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642