[jbosstools-commits] JBoss Tools SVN: r43232 - in trunk/common: plugins and 20 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Sat Aug 25 02:08:32 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-08-25 02:08:31 -0400 (Sat, 25 Aug 2012)
New Revision: 43232

Added:
   trunk/common/plugins/org.jboss.tools.common.core/
   trunk/common/plugins/org.jboss.tools.common.core/.classpath
   trunk/common/plugins/org.jboss.tools.common.core/.project
   trunk/common/plugins/org.jboss.tools.common.core/META-INF/
   trunk/common/plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF
   trunk/common/plugins/org.jboss.tools.common.core/about.html
   trunk/common/plugins/org.jboss.tools.common.core/build.properties
   trunk/common/plugins/org.jboss.tools.common.core/plugin.properties
   trunk/common/plugins/org.jboss.tools.common.core/plugin.xml
   trunk/common/plugins/org.jboss.tools.common.core/pom.xml
   trunk/common/plugins/org.jboss.tools.common.core/src/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/databinding/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/jobs/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/BasePlugin.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/ILoggingAdapter.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/IPluginLog.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/LogHelper.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/PluginLogger.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/StatusFactory.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/text/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/BeanUtil.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/zip/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java
Removed:
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/jobs/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BasePlugin.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/ILoggingAdapter.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/IPluginLog.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/LogHelper.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/PluginLogger.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/StatusFactory.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/preferences/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/BeanUtil.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/StringUtil.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/zip/
Modified:
   trunk/common/features/org.jboss.tools.common.core.feature/feature.xml
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java
   trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/Messages.java
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
   trunk/common/plugins/pom.xml
Log:
JBIDE-12469 split of o.j.t.common and creation of o.j.t.common.core

Modified: trunk/common/features/org.jboss.tools.common.core.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.core.feature/feature.xml	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/features/org.jboss.tools.common.core.feature/feature.xml	2012-08-25 06:08:31 UTC (rev 43232)
@@ -16,6 +16,12 @@
    <license>
       %license
    </license>
+   <plugin
+         id="org.jboss.tools.common.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
 
    <plugin
          id="org.jboss.tools.common"

Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF	2012-08-25 06:08:31 UTC (rev 43232)
@@ -6,20 +6,10 @@
 Bundle-SymbolicName: org.jboss.tools.common;singleton:=true
 Bundle-Localization: plugin
 Export-Package: org.jboss.tools.common,
- org.jboss.tools.common.databinding,
- org.jboss.tools.common.java,
- org.jboss.tools.common.java.impl,
- org.jboss.tools.common.jobs,
  org.jboss.tools.common.log,
- org.jboss.tools.common.preferences,
  org.jboss.tools.common.quickfix,
  org.jboss.tools.common.refactoring,
- org.jboss.tools.common.reporting,
- org.jboss.tools.common.text,
- org.jboss.tools.common.util,
- org.jboss.tools.common.web,
- org.jboss.tools.common.xml,
- org.jboss.tools.common.zip
+ org.jboss.tools.common.util
 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
  org.eclipse.wst.xml.core;bundle-version="1.1.600";visibility:=reexport,
  org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
@@ -43,7 +33,8 @@
  org.eclipse.jpt.common.core;bundle-version="1.0.0",
  org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
  org.eclipse.wst.sse.ui;bundle-version="1.3.100",
- org.eclipse.jdt.core.manipulation;bundle-version="1.5.0"
+ org.eclipse.jdt.core.manipulation;bundle-version="1.5.0",
+ org.jboss.tools.common.core;bundle-version="3.4.0";visibility:=reexport
 Bundle-Version: 3.4.0.qualifier
 Bundle-ActivationPolicy: lazy
 Bundle-ManifestVersion: 2

Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/Messages.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/Messages.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -16,11 +16,6 @@
 public class Messages extends NLS {
 	private static final String BUNDLE_NAME = "org.jboss.tools.common.messages"; //$NON-NLS-1$
 	public static String BaseUIPlugin_ErrorDialogTitle;
-	public static String SAXValidator_IOExceptionMessage;
-	public static String SAXValidator_SAXExceptionMessage;
-	public static String SAXValidator_UnableToInstantiateMessage;
-	public static String XMLUtilities_IOExceptionMessage;
-	public static String XMLUtilities_SAXExceptionMessage;
 	public static String MethodNotImplementedException_MethodIsNotImplementedYet;
 	static {
 		// initialize resource bundle

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BasePlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BasePlugin.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BasePlugin.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.log;
-
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * Provides an easy way to log status of events.
- * 
- * NOTE: It is useful to make the static method getPluginLog()
- * which provides the interface IPluginLog for using it in your code
- * in future
- *  
- * @author Sergey Vasilyev
- *
- */
-
-public class BasePlugin extends Plugin implements IPluginLog {
-	public void logError(String message, Throwable t) {
-		LogHelper.logError(this, message, t);
-	}
-
-	public void logError(String message) {
-		LogHelper.logError(this, message);
-	}
-	
-	public void logError(Throwable t) {
-		LogHelper.logError(this, t);
-	}
-
-	public void logWarning(String message, Throwable t) {
-		LogHelper.logWarning(this, message, t);
-	}
-	
-	public void logWarning(String message) {
-		LogHelper.logWarning(this, message);
-	}
-	
-	public void logWarning(Throwable t) {
-		LogHelper.logWarning(this, t);
-	}
-
-	public void logInfo(String message, Throwable t) {
-		LogHelper.logInfo(this, message, t);
-	}
-	
-	public void logInfo(String message) {
-		LogHelper.logInfo(this, message);
-	}
-}
\ No newline at end of file

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/ILoggingAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/ILoggingAdapter.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/ILoggingAdapter.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.log;
-
-/**
- * @author Andre Dietisheim
- */
-public interface ILoggingAdapter {
-
-  public void error(String errorMessage);
-
-  public void debug(String message);
-
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/IPluginLog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/IPluginLog.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/IPluginLog.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.log;
-
-public interface IPluginLog {
-	public void logError(String message, Throwable t);
-	public void logError(String message);
-	public void logError(Throwable t);
-
-	public void logWarning(String message, Throwable t);	
-	public void logWarning(String message);	
-	public void logWarning(Throwable t);
-	
-	public void logInfo(String message, Throwable t);	
-	public void logInfo(String message);
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/LogHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/LogHelper.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/LogHelper.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.log;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.Bundle;
-
-public class LogHelper {
-	public static void logError(Plugin plugin, Throwable t) {
-		logError(plugin, null, t);
-	}
-
-	public static void logError(Plugin plugin, String message) {
-		logError(plugin, message, null);
-	}
-	
-	public static void logError(Plugin plugin, String message, Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.ERROR, 
-				plugin.getBundle().getSymbolicName(), message, t);
-		logStatus(plugin, status); 
-	}
-	
-	public static void logError(String pluginId, Throwable t) {
-		logError(pluginId, null, t);
-	}
-
-	public static void logError(String pluginId, String message) {
-		logError(pluginId, message, null);
-	}
-	
-	public static void logError(String pluginId, String message, Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.ERROR, pluginId,
-				message, t);
-		logStatus(pluginId, status);
-	}
-	
-	public static void logWarning(Plugin plugin, Throwable t) {
-		logWarning(plugin, null, t);
-	}
-	
-	public static void logWarning(Plugin plugin, String message) {
-		logWarning(plugin, message, null);
-	}
-	
-	
-	public static void logWarning(Plugin plugin, String message, Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.WARNING, 
-				plugin.getBundle().getSymbolicName(), message, t);
-		logStatus(plugin, status); 
-	}
-	
-	public static void logWarning(String pluginId, Throwable t) {
-		logWarning(pluginId, null, t);
-	}
-	
-	public static void logWarning(String pluginId, String message) {
-		logWarning(pluginId, message, null);
-	}
-	
-	
-	public static void logWarning(String pluginId, String message,
-								Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.WARNING, pluginId,
-				message, t);
-		logStatus(pluginId, status);
-	}
-
-	public static void logInfo(Plugin plugin, String message,
-								Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.INFO, 
-				plugin.getBundle().getSymbolicName(), message, t);
-		logStatus(plugin, status); 
-	}
-	
-	
-	public static void logInfo(Plugin plugin, String message) {
-		IStatus status = StatusFactory.getInstance(IStatus.INFO, 
-				plugin.getBundle().getSymbolicName(), message);
-		logStatus(plugin, status); 
-	}
-
-	public static void logInfo(String pluginId, String message,
-								Throwable t) {
-		IStatus status = StatusFactory.getInstance(IStatus.INFO, pluginId,
-				message, t);
-		logStatus(pluginId, status);
-	}
-	
-	public static void logInfo(String pluginId, String message) {
-		IStatus status = StatusFactory.getInstance(IStatus.INFO, pluginId,
-				message);
-		logStatus(pluginId, status);
-	}
-
-	public static void log(int severity, String pluginId, int code,
-							String message, Throwable t) {
-		IStatus status = StatusFactory.getInstance(severity, pluginId, code,
-				message, t);
-		logStatus(pluginId, status);
-	}
-	
-	public static void logStatus(Plugin plugin, IStatus status) {
-		plugin.getLog().log(status);
-	}
-
-	public static void logStatus(String pluginId, IStatus status) {
-		Bundle bundle = Platform.getBundle(pluginId);
-		logStatus(bundle, status);
-	}
-	
-	public static void logStatus(Bundle bundle, IStatus status) {
-		ILog log = Platform.getLog(bundle);
-		log.log(status);
-	}
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/PluginLogger.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/PluginLogger.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/PluginLogger.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.log;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-/**
- * A logging adapter that logs to a given plugin.
- * 
- * @author Andre Dietisheim
- */
-public class PluginLogger implements ILoggingAdapter {
-
-	private Plugin plugin;
-
-	public PluginLogger(Plugin plugin) {
-		this.plugin = plugin;
-	}
-
-	public void error(String message) {
-		log(IStatus.ERROR, message);
-	}
-
-	public void debug(String message) {
-		log(IStatus.INFO, message);
-	}
-
-	private void log(int severity, String message) {
-		if (!isTracingEnabled()) {
-			return;
-		}
-
-		if (plugin != null) {
-			IStatus status = new Status(severity, plugin.getBundle().getSymbolicName(), message);
-			plugin.getLog().log(status);
-		}
-	}
-
-	protected Plugin getPlugin() {
-		return plugin;
-	}
-	
-	protected boolean isTracingEnabled() {
-		// defaults to always log
-		return true;
-	}
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/StatusFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/StatusFactory.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/StatusFactory.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.log;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-
-public class StatusFactory {
-	public final static int UNDEFINED_ERROR = 0;
-	public final static String UNSPECIFIED_MESSAGE = null;
-	public final static String EMPTY_MESSAGE = ""; //$NON-NLS-1$
-
-	public static IStatus getInstance(int severity, String pluginId,
-									int code, String message, Throwable t) {
-		return new Status(severity, pluginId, code, checkMessage(message, t), t);
-	}
-
-	public static IStatus getInstance(int severity, String pluginId,
-			String message, Throwable t) {
-		return getInstance(severity, pluginId, UNDEFINED_ERROR, message, t);
-	}
-
-	public static IStatus getInstance(int severity, String pluginId,
-			String message) {
-		return getInstance(severity, pluginId, UNDEFINED_ERROR, message, null);
-	}
-
-	public static IStatus getInstance(int severity, String pluginId,
-			Throwable t) {
-		return getInstance(severity, pluginId, UNDEFINED_ERROR, EMPTY_MESSAGE, t);
-	}
-
-	public static IStatus getInstance(int severity, String pluginId,
-			int code, Throwable t) {
-		return getInstance(severity, pluginId, code, EMPTY_MESSAGE, t);
-	}
-
-	public static IStatus getInstance(int severity, String pluginId,
-			int code, String message) {
-		return getInstance(severity, pluginId, code, message, null);
-	}
-
-	/**
-	 * Returns a multi status with the given severity, plugin id, error code,
-	 * message, cause and child status instances.
-	 * 
-	 * @param severity
-	 * @param pluginId
-	 * @param message
-	 * @param t
-	 * @param status
-	 * @return a multi status
-	 */
-	public static IStatus getInstance(int severity, String pluginId, String message, Throwable t, IStatus... status) {
-		return new MultiStatus(pluginId, UNDEFINED_ERROR, status, message, t);
-	}
-
-	private static String checkMessage(String message, Throwable t) {
-		if (message == UNSPECIFIED_MESSAGE) {
-			if (t != null && t.getMessage() != null) {
-				return t.getMessage();
-			}
-			return EMPTY_MESSAGE;
-		}
-		return message;
-	}
-}

Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/messages.properties	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,7 +1,2 @@
 BaseUIPlugin_ErrorDialogTitle=Hibernate Console
-SAXValidator_IOExceptionMessage=Unidentified parser error
-SAXValidator_SAXExceptionMessage=Unidentified parser error
-SAXValidator_UnableToInstantiateMessage=error: Unable to instantiate parser ({0})
-XMLUtilities_IOExceptionMessage=Unexpected parser error
-XMLUtilities_SAXExceptionMessage=Unexpected parser error
 MethodNotImplementedException_MethodIsNotImplementedYet=Method is not implemented yet

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/BeanUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/BeanUtil.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/BeanUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,78 +0,0 @@
-/*******************************************************************************
-  * Copyright (c) 2010 Red Hat, Inc.
-  * Distributed under license by Red Hat, Inc. All rights reserved.
-  * This program is made available under the terms of the
-  * Eclipse Public License v1.0 which accompanies this distribution,
-  * and is available at http://www.eclipse.org/legal/epl-v10.html
-  *
-  * Contributors:
-  *     Red Hat, Inc. - initial API and implementation
-  ******************************************************************************/
-package org.jboss.tools.common.util;
-
-import org.eclipse.jdt.core.IMethod;
-
-/**
- * 
- * @author V. Kabanovich
- *
- */
-public class BeanUtil {
-	public static final String GET = "get"; //$NON-NLS-1$
-	public static final String SET = "set"; //$NON-NLS-1$
-	public static final String IS = "is"; //$NON-NLS-1$
-
-	public static boolean isGetter(String methodName, int numberOfParameters) {
-		return (((methodName.startsWith(GET) && !methodName.equals(GET))
-					|| (methodName.startsWith(IS) && !methodName.equals(IS)))
-				&& numberOfParameters == 0);
-	}
-
-	public static boolean isSetter(String methodName, int numberOfParameters) {
-		return (((methodName.startsWith(SET) && !methodName.equals(SET)))
-				&& numberOfParameters == 1);
-	}
-
-	public static boolean isGetter(IMethod method) {
-		return method != null && isGetter(method.getElementName(), method.getNumberOfParameters())
-			&& checkPropertyReturnType(method);
-	}
-
-	
-	public static boolean checkPropertyReturnType(String typeName, String methodName) {
-		if(typeName == null || typeName.equals("void")) { //$NON-NLS-1$
-			return false;
-		}
-		if(methodName.startsWith(BeanUtil.IS)) {
-			if(!"boolean".equals(typeName) && !"java.lang.Boolean".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
-				return false;
-			}			
-		}
-		return true;
-	}
-
-	private static boolean checkPropertyReturnType(IMethod method) {
-		return method != null && checkPropertyReturnType(EclipseJavaUtil.getMemberTypeAsString(method), method.getElementName());
-	}
-
-	public static boolean isSetter(IMethod method) {
-		return method != null && isSetter(method.getElementName(), method.getNumberOfParameters());
-	}
-
-	public static String getPropertyName(String methodName) {
-		if(isGetter(methodName, 0) || isSetter(methodName, 1)) {
-			StringBuffer name = new StringBuffer(methodName);
-			if(methodName.startsWith(IS)) {
-				name.delete(0, 2);
-			} else {
-				name.delete(0, 3);
-			}
-			if(name.length() < 2 || !Character.isUpperCase(name.charAt(1))) {
-				name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
-			}
-			return name.toString();
-		}
-		return null;
-	}
-
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.util;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IAnnotatable;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
-
-public class EclipseJavaUtil {
-
-	public static String getMemberTypeAsString(IMember member) {
-		if(member instanceof IField) return getMemberTypeAsString((IField)member);
-		if(member instanceof IMethod) return getMemberTypeAsString((IMethod)member);
-		return null;
-	}
-
-	public static String getMemberTypeAsString(IField f) {
-		if(f == null) return null;
-		try	{
-			String typeName = new String(Signature.toCharArray(f.getTypeSignature().toCharArray()));
-			return resolveType(f.getDeclaringType(), typeName);
-		} catch (JavaModelException e) {
-			CommonPlugin.getPluginLog().logError(e);
-		}
-		return null;
-	}
-
-	public static String getMemberTypeAsString(IMethod m) {
-		if(m == null) return null;
-		try	{
-			return resolveTypeAsString(m.getDeclaringType(), m.getReturnType());
-		} catch (JavaModelException e) {
-			CommonPlugin.getPluginLog().logError(e);
-		}
-		return null;
-	}
-
-	public static String resolveTypeAsString(IType type, String typeName) {
-		if(type == null || typeName == null) return null;
-		typeName = new String(Signature.toCharArray(typeName.toCharArray()));
-		int i = typeName.indexOf(Signature.C_GENERIC_START);
-		if(i > 0) typeName = typeName.substring(0, i);
-		return resolveType(type, typeName);
-	}
-
-	public static String resolveType(IType type, String typeName) {
-		return TypeResolutionCache.getInstance().resolveType(type, typeName);
-	}
-	
-	public static IType findType(IJavaProject javaProject, String qualifiedName) throws JavaModelException {
-		if(qualifiedName == null || qualifiedName.length() == 0) return null;
-		IType type = javaProject.findType(qualifiedName);
-		if(type != null) return type;
-		int dot = qualifiedName.lastIndexOf('.');
-		String packageName = (dot < 0) ? "" : qualifiedName.substring(0, dot); //$NON-NLS-1$
-		String shortName = qualifiedName.substring(dot + 1);
-		IPackageFragmentRoot[] rs = javaProject.getPackageFragmentRoots();
-		for (int i = 0; i < rs.length; i++) {
-			IPackageFragment f = rs[i].getPackageFragment(packageName);
-			if(f == null || !f.exists()) continue;
-			ICompilationUnit[] us = f.getCompilationUnits();
-			for (int j = 0; j < us.length; j++) {
-				IType t = us[j].getType(shortName);
-				if(t != null && t.exists()) return t;
-			}
-		}
-		return null;
-	}
-	
-	public static List<IType> getSupperTypes(IType type) throws JavaModelException {
-		ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
-		IType[] superTypes = typeHierarchy == null ? null : typeHierarchy.getAllSupertypes(type);
-		if(superTypes == null) {
-			return Collections.emptyList();
-		}
-		List<IType> suppers = new ArrayList<IType>();
-		for (int i = 0; i < superTypes.length; i++) {
-			suppers.add(superTypes[i]);
-		}
-		return suppers;
-	}
-	
-	public static IAnnotation findAnnotation(IType sourceType, IAnnotatable member, String qulifiedAnnotationName) throws JavaModelException{
-		IAnnotation[] annotations = member.getAnnotations();
-		String simpleAnnotationTypeName = qulifiedAnnotationName;
-		int lastDot = qulifiedAnnotationName.lastIndexOf('.');
-		if(lastDot>-1) {
-			simpleAnnotationTypeName = simpleAnnotationTypeName.substring(lastDot + 1);
-		}
-		for (IAnnotation annotation : annotations) {
-			if(qulifiedAnnotationName.equals(annotation.getElementName())) {
-				return annotation;
-			}
-			if(simpleAnnotationTypeName.equals(annotation.getElementName())) {
-				String fullAnnotationclassName = EclipseJavaUtil.resolveType(sourceType, simpleAnnotationTypeName);
-				if(fullAnnotationclassName!=null) {
-					IType annotationType = sourceType.getJavaProject().findType(fullAnnotationclassName);
-					if(annotationType!=null && annotationType.getFullyQualifiedName().equals(qulifiedAnnotationName)) {
-						return annotation;
-					}
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Finds field declared in the given type or its super types.
-	 * 
-	 * @param type
-	 * @param name
-	 * @return
-	 * @throws CoreException
-	 */
-	public static IField findField(IType type, String name) throws CoreException {
-		return findField(type, name, new HashSet<IType>());
-	}
-	private static IField findField(IType type, String name, Set<IType> processed) throws CoreException {
-		if(!type.exists() || processed.contains(type)) {
-			return null;
-		}
-		processed.add(type);
-		if(type.getField(name).exists()) {
-			return type.getField(name);
-		}
-		IField f = findField(type, type.getSuperclassName(), name, processed);
-		String[] is = type.getSuperInterfaceNames();
-		for (int i = 0; f == null && i < is.length; i++) {
-			f = findField(type, is[i], name, processed);
-		}
-		if(f == null) {
-			IType d = type.getDeclaringType();
-			if(d != null && d != type && d.exists()) {
-				f = findField(d, name);
-			}
-		}
-		
-		return f;
-	}
-	private static IField findField(IType context, String typeName, String fieldName, Set<IType> processed) throws CoreException {
-		typeName = resolveType(context, typeName);
-		if(typeName != null) {
-			IType s = findType(context.getJavaProject(), typeName);
-			return (s != null) ? findField(s, fieldName, processed) : null;
-		}
-		return null;
-	}
-
-	/**
-	 * Returns true if the given annotation has the given full name
-	 * @param annotation
-	 * @param fullName
-	 * @return
-	 * @throws JavaModelException
-	 */
-	public static boolean checkAnnotationByFulltName(IAnnotation annotation, String fullName) throws JavaModelException {
-		if(annotation.getElementName().equals(fullName)) {
-			return true;
-		}
-		boolean result = true;
-		IType sourceType = null;
-		IJavaElement parent = annotation.getParent();
-		if(parent instanceof IMember) {
-			if(parent instanceof IType) {
-				sourceType = (IType)parent;
-			} else {
-				sourceType = ((IMember)parent).getDeclaringType();
-			}
-			String fullAnnotationName = EclipseJavaUtil.resolveType(sourceType, annotation.getElementName());
-			if(fullAnnotationName!=null) {
-				IType annotationType = sourceType.getJavaProject().findType(fullAnnotationName);
-				result = annotationType!=null && annotationType.getFullyQualifiedName().equals(fullName);
-			} else {
-				result = false;
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * Returns annotation by the short name declared for the given java member and its parents.
-	 * Returns null if no annotation found.
-	 * @param member
-	 * @param name
-	 * @param checkParents
-	 * @return
-	 * @throws JavaModelException
-	 */
-	public static Set<IAnnotation> findAnnotationsByShortName(IJavaElement element, String name, boolean checkParents) throws JavaModelException {
-		return findAnnotationsByShortName(null, element, name, checkParents);
-	}
-
-	private static Set<IAnnotation> findAnnotationsByShortName(Set<IAnnotation> result, IJavaElement element, String name, boolean checkParents) throws JavaModelException {
-		if(element instanceof IAnnotatable) {
-			IAnnotation[] annotations = ((IAnnotatable)element).getAnnotations();
-			for (IAnnotation annotation : annotations) {
-				String aName = annotation.getElementName();
-				int i = aName.lastIndexOf('.');
-				if(i>-1) {
-					aName = aName.substring(i+1);
-				}
-				if(aName.equals(name)) {
-					if(result==null) {
-						result = new HashSet<IAnnotation>();
-					}
-					result.add(annotation);
-					break;
-				}
-			}
-		}
-		if(checkParents) {
-			IJavaElement parent = element.getParent();
-			if(parent instanceof IAnnotatable) {
-				return findAnnotationsByShortName(result, parent, name, true);
-			}
-		}
-		return result;
-	}
-}
\ No newline at end of file

Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -10,42 +10,12 @@
  ******************************************************************************/ 
 package org.jboss.tools.common.util;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
 import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.filebuffers.IFileBuffer;
 import org.eclipse.core.filebuffers.ITextFileBuffer;
 import org.eclipse.core.filebuffers.LocationKind;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IFileEditorInput;
@@ -53,686 +23,10 @@
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.jboss.tools.common.CommonPlugin;
 
-public final class FileUtil {
+public final class FileUtil extends FileUtils {
 
     public FileUtil() {}
 
-    public static String getEncoding(IFile f) {
-    	String encoding = null;
-    	if(f != null && f.exists() && f.isSynchronized(0)) try {
-    		encoding = f.getCharset();
-    	} catch (CoreException e) {
-    		CommonPlugin.getPluginLog().logError(e);
-    	}
-    	return encoding != null ? encoding : "8859_1"; //$NON-NLS-1$
-    }
-
-    public static String readFile(File f) {
-        if(!f.isFile()) return ""; //$NON-NLS-1$
-    	ReadBytes bs = readBytes(f);
-    	if(bs == null) return ""; //$NON-NLS-1$
-        String encoding = getEncoding(bs.bs);
-        if(encoding == null) return new String(bs.bs, 0, bs.length);
-        try {
-        	return new String(bs.bs, 0, bs.length, encoding);
-        } catch (UnsupportedEncodingException e) {
-        	return new String(bs.bs, 0, bs.length);
-        }
-    }
-
-    public static String readFileWithEncodingCheck(File f, String defaultEncoding) {
-        if(!f.isFile()) return ""; //$NON-NLS-1$
-    	ReadBytes bs = readBytes(f);
-    	if(bs == null) return ""; //$NON-NLS-1$
-        String encoding = getEncoding(bs.bs);
-        if(encoding == null) encoding = validateEncoding(defaultEncoding, null);
-        if(encoding == null) return new String(bs.bs, 0, bs.length);
-        try {
-        	return new String(bs.bs, 0, bs.length, encoding);
-        } catch (UnsupportedEncodingException e) {
-        	return new String(bs.bs, 0, bs.length);
-        }
-    }
-
-    public static ReadBytes readBytes(File f) {
-        if(!f.isFile()) return null;
-        BufferedInputStream br = null;
-        try {
-            FileInputStream fr = new FileInputStream(f);
-            br = new BufferedInputStream(fr);
-            int l = (int)f.length();
-            byte[] bs = new byte[l];
-            l = br.read(bs, 0, l);
-            br.close();
-            fr.close();
-            return new ReadBytes(bs, l);
-        } catch (IOException e) {
-        	return null;
-        } finally {
-        	if(br!=null) {
-        		try {
-					br.close();
-				} catch (IOException e) {
-					//ignore
-				}
-        	}
-        }
-    }
-    
-    static class ReadBytes {
-    	byte[] bs;
-    	int length;
-    	
-    	ReadBytes(byte[] bs, int l) {
-    		this.bs = bs;
-    		length = l;
-    	}
-    }
-
-    public static String readFile(File f, String encoding) {
-    	ReadBytes bs = readBytes(f);
-    	if(bs == null) return null;
-        try {
-            return new String(bs.bs, 0, bs.length, encoding);
-        } catch (UnsupportedEncodingException e) {
-        	return null;
-        }
-    }
-
-    public static boolean isTextFile(File f, int length) {
-        if(!f.isFile()) return false;
-        BufferedReader br = null;
-        try {
-            FileReader fr = new FileReader(f);
-            br = new BufferedReader(fr);
-            int l = (int)f.length();
-            if(l > length) l = length;
-            char[] cs = new char[l];
-            br.read(cs, 0, l);
-            br.close();
-            fr.close();
-            return isText(new String(cs));
-        } catch (IOException e) {
-            return false;
-        } finally {
-        	if(br!=null) {
-        		try {
-					br.close();
-				} catch (IOException e) {
-					// ignore
-				}
-        	}
-        }
-    }
-
-    public static boolean isText(String body) {
-        if(body == null) return false;
-        int l = body.length();
-        for (int i = 0; i < l; i++) {
-            char c = body.charAt(i);
-            if(((int)c) < 32 && c != '\n' && c != '\r' && c != 't') return false;
-        }
-        return true;
-    }
-
-    // FIXME Size of string buffer should be set to size of file by default 
-    // to avoid StringBuffer extension on each append
-    public static String readStream(InputStream is) {
-        StringBuffer sb = new StringBuffer(""); //$NON-NLS-1$
-        try {
-            byte[] b = new byte[4096];
-            while(true) {
-                int l = is.read(b, 0, b.length);
-                if(l < 0) break;
-                sb.append(new String(b, 0, l));
-            }
-        } catch (IOException e) {
-        	CommonPlugin.getPluginLog().logError(e);
-        } finally {
-            try {
-				is.close();
-			} catch (IOException e) {
-				// Ignore
-			}
-        }
-        return sb.toString();
-    }
-    
-    public static String readStream(IFile file) throws CoreException {
-		String content = null;
-		InputStream in = null;
-		try {
-			String charset = file.getCharset();
-			if(charset != null) {
-				charset = validateEncoding(charset, null);
-			}
-			in = file.getContents();
-			content = (charset == null) ? readStream(in) : readStream(in, charset);
-		} finally {
-			if(in!=null) {
-				try {
-					in.close();
-				} catch (IOException e) {
-					CommonPlugin.getPluginLog().logError(e);
-				}
-			}
-		}
-		return content;
-    }
-
-    public static String readStream(InputStream is, String charset) {
-        StringBuffer sb = new StringBuffer(""); //$NON-NLS-1$
-        try {
-            byte[] b = new byte[4096];
-            while(true) {
-                int l = is.read(b, 0, b.length);
-                if(l < 0) break;
-                sb.append(new String(b, 0, l, charset));
-            }
-        } catch (IOException e) {
-        	CommonPlugin.getPluginLog().logError(e);
-        } finally {
-            try {
-				is.close();
-			} catch (IOException e) {
-				// Ignore
-			}
-        }
-
-        return sb.toString();
-    }
-
-    public static void copyContent(IFile from, IFile to, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException {
-		InputStream is = null;
-		try {
-			is = from.getContents();
-			to.setContents(is, force, keepHistory, monitor);
-		} finally {
-			if(is!=null) {
-				try {
-					is.close();
-				} catch (IOException e) {
-					CommonPlugin.getPluginLog().logError(e);
-				}
-			}
-		}
-    }
-
-    public static boolean writeFile(File f, String value) {
-    	return writeFileWithEncodingCheck(f, value, null);
-    }
-
-    public static boolean writeFileWithEncodingCheck(File f, String value, String defaultEncoding) {
-    	if(value == null) return false;
-    	String encoding = getEncoding(value);
-    	if(encoding == null) encoding = validateEncoding(defaultEncoding, null);
-    	if(value.startsWith("<?xml")) { //$NON-NLS-1$
-    		String s = validateEncoding(encoding, "UTF-8"); //$NON-NLS-1$
-    		if(encoding == null) {
-    			encoding = s;
-    		} else if(s == null || !s.equals(encoding)) {
-    			return false;
-    		}
-    	}
-    	if(encoding == null) return writeFileDefault(f, value);
-    	return writeFile(f, value, encoding);
-    }
-
-    public static boolean writeFileDefault(File f, String value) {
-        try {
-            try {
-                if(f.isFile() && !isSameFile(f)) f.delete();
-                if(!f.exists()) f.createNewFile();
-            } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
-            } catch (SecurityException e) {
-            	CommonPlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
-            }
-            PrintWriter pw = new PrintWriter(new FileWriter(f));
-            pw.print(value);
-            pw.flush();
-            pw.close();
-            return true;
-        } catch (IOException e) {
-            return false;
-        }
-    }
-
-
-    public static boolean copyFile(File source, File dest, boolean mkdirs) {
-        return copyFile(source, dest, mkdirs, true);
-    }
-
-    public static boolean copyFile(File source, File dest) {
-        return copyFile(source, dest, false, true);
-    }
-
-    public static boolean copyFile(File source, File dest, boolean mkdirs, boolean overwrite) {
-        if (mkdirs) dest.getParentFile().mkdirs();
-        if(!source.isFile()) return false;
-        if(dest.isFile() && !isSameFile(dest)) dest.delete();
-        if(dest.isFile() && !overwrite) return false;
-        if(!dest.exists())
-			try {
-				dest.createNewFile();
-			} catch (IOException e1) {
-				CommonPlugin.getPluginLog().logError(e1);
-			}
-        InputStream is = null;
-        OutputStream os = null;
-        try {
-            is = new BufferedInputStream(new FileInputStream(source), 16 * 1024);
-            os = new BufferedOutputStream(new FileOutputStream(dest), 16 * 1024);
-            copyStream(is, os);
-            return true;
-        } catch (IOException e) {
-        	CommonPlugin.getPluginLog().logError(e);
-            return false;
-        } finally {
-            try {
-                if (is != null) is.close();
-            } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError(e);
-            }
-            try {
-                if (os != null) os.close();
-            } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError(e);
-            }
-        }
-    }
-
-    public static boolean updateFile(File source, File dest, boolean mkdirs) {
-        if(!source.isFile()) return false;
-        if(dest.isFile() && (dest.lastModified()<source.lastModified())) {
-            dest.delete();
-        }
-        return copyFile(source, dest, mkdirs);
-    }
-
-    public static void copyStream(InputStream is, OutputStream os) throws IOException {
-        byte[] buffer = new byte[1<<14];
-        while (true) {
-            int r = is.read(buffer);
-            if (r > 0) {
-                os.write(buffer, 0, r);
-            } else if (r == -1) break;
-        }
-        os.flush();
-    }
-
-	public static void clear(File f) {
-		if (f.isDirectory()) {
-			File[] fs = f.listFiles();
-			for (int i = 0; i < fs.length; i++) {
-				remove(fs[i]);
-			}
-		}
-	}
-
-	public static void remove(File f) {
-		if (f.isFile()) {
-			f.delete();
-		} else if (f.isDirectory()) {
-			File[] fs = f.listFiles();
-			for (int i = 0; i < fs.length; i++) {
-				remove(fs[i]);
-			}
-			f.delete();
-		}
-	}
-
-    public static boolean isSameFile(File f) {
-        if(!f.exists()) return false;
-        String fn = f.getName();
-        try {
-           String cn = f.getCanonicalFile().getName();
-           return fn.equals(cn);
-        } catch (IOException e) {
-            return false;
-        } 
-    }
-
-    public static void copyDir(File from, File to) {
-        copyDir(from, to, false);
-    }
-
-    public static void copyDir(File from, File to, boolean mkdirs) {
-        copyDir(from, to, mkdirs, true);
-    }
-
-    public static void copyDir(File from, File to, boolean mkdirs, boolean includeSubdirs) {
-        copyDir(from, to, includeSubdirs, mkdirs, false);
-    }
-
-    public static void copyDir(File from, boolean includeSubdirs, File to) {
-        copyDir(from, to, includeSubdirs, false, false);
-    }
-
-    public static void copyDir(File from, File to, boolean includeSubdirs, boolean mkdirs, boolean overwriteOnlyOlderFiles) {
-    	copyDir(from, to, includeSubdirs, mkdirs, overwriteOnlyOlderFiles, null);
-    }
-
-    public static void copyDir(File from, File to, boolean includeSubdirs, boolean mkdirs, boolean overwriteOnlyOlderFiles, FileFilter filter) {
-        if(filter != null && !filter.accept(from)) return;
-        if (mkdirs) to.mkdirs();
-        if(from == null || !from.isDirectory() || !to.isDirectory()) return;
-        File[] fs = from.listFiles();
-        if(fs == null) return;
-        for (int i = 0; i < fs.length; i++) {
-            String n = fs[i].getName();
-            File c = new File(to, n);
-            if (fs[i].isDirectory() && !includeSubdirs) continue;
-        	if(filter != null && !filter.accept(new File(from, n))) continue;
-
-            if(fs[i].isDirectory()) {
-                c.mkdirs();
-                copyDir(fs[i], c, includeSubdirs, mkdirs, overwriteOnlyOlderFiles, filter);
-            } else if (overwriteOnlyOlderFiles && fs[i].isFile() && c.isFile()) {
-                copyFile(fs[i], c, false, c.lastModified() < fs[i].lastModified());
-            } else {
-                copyFile(fs[i], c);
-            }
-        }
-    }
-
-    public static void unjar(File dest, String jar) throws IOException {
-        dest.mkdirs();
-        JarFile jf = new JarFile(jar);
-        try {
-            Enumeration es = jf.entries();
-            while(es.hasMoreElements()) {
-                JarEntry je = (JarEntry)es.nextElement();
-                String n = je.getName();
-                File f = new File(dest, n);
-                if (je.isDirectory()) {
-                    f.mkdirs();
-                } else {
-                    if (f.exists()) {
-                        f.delete();
-                    } else {
-                        f.getParentFile().mkdirs();
-                    }
-                    InputStream is = jf.getInputStream(je);
-                    FileOutputStream os = new FileOutputStream(f);
-                    try {
-                        copyStream(is, os);
-                    } finally {
-                        os.close();
-                    }
-                }
-                long time = je.getTime();
-                if (time != -1) f.setLastModified(time);
-            }
-        } finally {
-            jf.close();
-        }
-    }
-
-    public static void unjar(File dest, InputStream is) throws IOException {
-        dest.mkdirs();
-        JarInputStream jis = new JarInputStream(is);
-        try {
-            while(true) {
-                JarEntry je = jis.getNextJarEntry();
-                if (je == null) break;
-                String n = je.getName();
-                File f = new File(dest, n);
-                if (je.isDirectory()) {
-                    f.mkdirs();
-                } else {
-                    if (f.exists()) {
-                        f.delete();
-                    } else {
-                        f.getParentFile().mkdirs();
-                    }
-                    FileOutputStream os = new FileOutputStream(f);
-                    try {
-                        copyStream(jis, os);
-                    } finally {
-                        os.close();
-                    }
-                }
-                long time = je.getTime();
-                if (time != -1) f.setLastModified(time);
-            }
-        } finally {
-            jis.close();
-        }
-    }
-
-    public static void jar(File[] fs, String path) throws IOException {
-        jar(fs, path, null);
-    }
-
-    public static void jar(File[] fs, String path, Manifest mf) throws IOException  {
-        File f = new File(path);
-        FileOutputStream fos = new FileOutputStream(f);
-        JarOutputStream jos = mf == null ? new JarOutputStream(fos) : new JarOutputStream(fos, mf);
-        try {
-            for (int i = 0; i < fs.length; i++) add(fs[i].getParentFile(), fs[i], jos);
-        } finally {
-            jos.close();
-            fos.close();
-        }
-    }
-
-    public static void add(File root, File f, JarOutputStream jos) throws IOException {
-        int l = root.getAbsolutePath().length();
-        String en = f.getAbsolutePath().substring(l + 1).replace('\\', '/');
-        add(f, en, jos);
-    }
-
-    public static void add(File f, String name, JarOutputStream jos) throws IOException {
-        String en = name;
-        if(f.isDirectory()) en += "/"; //$NON-NLS-1$
-        JarEntry entry = (en.endsWith("/")) ? null : new JarEntry(en); //$NON-NLS-1$
-        if(f.isDirectory()) {
-            if("/".equals(en)) en = ""; //$NON-NLS-1$ //$NON-NLS-2$
-            File[] fs = f.listFiles();
-            if(fs != null) for (int i = 0; i < fs.length; i++)
-              add(fs[i], en + fs[i].getName(), jos);
-        } else {
-            try {
-                jos.putNextEntry(entry);
-            } catch (IOException e) {
-                return;
-            }
-            FileInputStream is = new FileInputStream(f);
-            byte[] b = new byte[1024];
-            int q = 0;
-            while((q = is.available()) > 0) {
-                if(q > 1024) q = 1024;
-                q = is.read(b, 0, q);
-                jos.write(b, 0, q);
-            }
-            is.close();
-        }
-        if(entry != null) jos.closeEntry();
-    }
-
-    public static void copy(InputStream f, OutputStream t) throws IOException {
-    	try {
-    		byte[] b = new byte[1024];
-    		int q = 0;
-    		while((q = f.read(b, 0, b.length)) > 0) t.write(b, 0, q);
-    	} finally {
-    		f.close();    
-    		t.close();
-    	}
-    }
-
-    public static void unzip(File dest, String jar) throws IOException {
-        dest.mkdirs();
-        ZipFile zf = new ZipFile(jar);
-        try {
-            Enumeration es = zf.entries();
-            while(es.hasMoreElements()) {
-                ZipEntry je = (ZipEntry)es.nextElement();
-                String n = je.getName();
-                File f = new File(dest, n);
-                if (je.isDirectory()) {
-                    f.mkdirs();
-                } else {
-                    if (f.exists()) {
-                        f.delete();
-                    } else {
-                        f.getParentFile().mkdirs();
-                    }
-                    InputStream is = zf.getInputStream(je);
-                    FileOutputStream os = new FileOutputStream(f);
-                    try {
-                        copyStream(is, os);
-                    } finally {
-                        os.close();
-                    }
-                }
-                long time = je.getTime();
-                if (time != -1) f.setLastModified(time);
-            }
-        } finally {
-            zf.close();
-        }
-    }
-
-    public static String fileURLToFilePath(String url) {
-        if(url == null) return null;
-        String resultUrl = url.replace('\\', '/');
-///        if(!url.startsWith("file:/")) return url;
-		if(!resultUrl.startsWith("file:")) return resultUrl; //$NON-NLS-1$
-        int iLast = resultUrl.lastIndexOf(':'), iFirst = resultUrl.indexOf(':');
-        return (iLast == iFirst) ? resultUrl.substring(5) : resultUrl.substring(iLast - 1);
-    }
-
-    //// Relative path
-
-	public static String getRelativePath(String rootpath, String path) {
-		String[] r = tokenizePath(rootpath);
-		String[] p = tokenizePath(path);
-		if(r.length == 0 || p.length == 0 || !r[0].equalsIgnoreCase(p[0])) return null;
-		int i = 0;
-		while(i < r.length && i < p.length && r[i].equalsIgnoreCase(p[i])) ++i;
-		StringBuffer sb = new StringBuffer();
-		for (int k = i; k < r.length; k++) sb.append("/.."); //$NON-NLS-1$
-		for (int k = i; k < p.length; k++) sb.append("/").append(p[k]); //$NON-NLS-1$
-		return sb.toString();
-	}
-
-	private static String[] tokenizePath(String path) {
-		String tokenizedPath = path.replace('\\', '/');
-		StringTokenizer st = new StringTokenizer(tokenizedPath, "/"); //$NON-NLS-1$
-		ArrayList l = new ArrayList();
-		while(st.hasMoreTokens()) {
-			String t = st.nextToken();
-			if(t.isEmpty() || ".".equals(t)) continue; //$NON-NLS-1$
-			if("..".equals(t)) { //$NON-NLS-1$
-				if(!l.isEmpty()) l.remove(l.size() - 1);
-				continue;
-			}
-			l.add(t);
-		}
-		return (String[])l.toArray(new String[l.size()]);
-	}
-
-    public static boolean writeFile(File f, String value, String encoding) {
-        try {
-            try {
-                if(f.isFile() && !isSameFile(f)) f.delete();
-                if(!f.exists()) {
-                	f.getParentFile().mkdirs();
-                	f.createNewFile();
-                }
-            } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError(e);
-            }
-            FileOutputStream fs = new FileOutputStream(f);
-            OutputStreamWriter osw = new OutputStreamWriter(fs, encoding);
-            PrintWriter pw = new PrintWriter(osw);
-            pw.print(value);
-            pw.flush();
-            pw.close();
-            return true;
-        } catch (FileNotFoundException e) {
-			//ignore
-            return writeFileDefault(f, value);
-        } catch (UnsupportedEncodingException e) {
-			//ignore
-            return writeFileDefault(f, value);        	
-        }
-    }
-    
-    
-    public static String getEncoding(String s) {
-    	if(s == null) return null;
-    	if(s.startsWith("<?xml")) { //$NON-NLS-1$
-    		int i = s.indexOf("encoding="); //$NON-NLS-1$
-    		if(i < 0) return null;
-    		i += "encoding=".length() + 1; //$NON-NLS-1$
-    		int j = s.indexOf('\"', i);
-    		if(j < 0) return null;
-    		return s.substring(i, j);
-    	}    	
-    	return null;
-    }
-    
-    static Set validEncodings = new HashSet();
-    static Set invalidEncodings = new HashSet();
-    
-    public static String validateEncoding(String encoding, String defaultEncoding) {
-    	if(encoding == null || encoding.equals(defaultEncoding)) return defaultEncoding;
-    	if(validEncodings.contains(encoding)) return encoding;
-    	if(invalidEncodings.contains(encoding)) return defaultEncoding;
-    	try {
-    		if(defaultEncoding != null && defaultEncoding.equals("UTF-16")) { //$NON-NLS-1$
-    			new String(XML_16, 0, XML_16.length, encoding);
-    		} else {
-    			new String(XML_8, 0, XML_8.length, encoding);
-    		}
-    		validEncodings.add(encoding);
-    		return encoding;
-    	} catch (UnsupportedEncodingException e) {
-    		invalidEncodings.add(encoding);
-    		return defaultEncoding;
-    	}
-    }
-    
-    static byte[] XML_8 = {(byte)'<',(byte)'?',(byte)'x',(byte)'m',(byte)'l'};
-    static byte[] XML_16 = {(byte)-2,(byte)-1,(byte)0,(byte)60,(byte)0,(byte)63,(byte)0,(byte)120,(byte)0,(byte)109,(byte)0,(byte)108};
-
-    public static String getEncoding(byte[] bs) {
-    	if(bs.length < 20) return null;
-    	if(startsWith(bs, XML_8)) {
-    		int i = getIndex(bs, (byte)'?', 5);
-    		if(i < 0) return "UTF-8"; //$NON-NLS-1$
-    		String encoding = getEncoding(new String(bs, 0, i));
-    		return validateEncoding(encoding, "UTF-8"); //$NON-NLS-1$
-    	} else if(startsWith(bs, XML_16)) {
-    		int i = getIndex(bs, (byte)'?', XML_16.length);
-    		if(i < 0) return "UTF-16"; //$NON-NLS-1$
-    		try {
-    			String encoding = getEncoding(new String(bs, 0, i, "UTF-16")); //$NON-NLS-1$
-        		return validateEncoding(encoding, "UTF-16"); //$NON-NLS-1$
-    		} catch (UnsupportedEncodingException e) {
-    			return null;
-    		}
-    	}
-    	return null;
-    }
-
-    static boolean startsWith(byte[] bs, byte[] prefix) {
-    	for (int i = 0; i < prefix.length; i++) {
-    		if(bs[i] != prefix[i]) return false;
-    	}
-    	return true;
-    }
-
-    static int getIndex(byte[] bs, byte b, int offset) {
-    	for (int i = offset; i < bs.length; i++) {
-    		if(bs[i] == b) return i;
-    	}
-    	return -1;
-    }
-
 	/**
 	 * Returns the content of the file. If this file is open in an active editor
 	 * then the content of the editor will be returned.

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.eclipse.core.net.proxy.IProxyData;
-import org.eclipse.core.net.proxy.IProxyService;
-import org.jboss.tools.common.CommonPlugin;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- * HTTP Utilities
- * @author Alexey Kazakov
- */
-public class HttpUtil {
-
-	private static IProxyService proxyService;
-
-	/**
-	 * @param url
-	 * @return InputStream of responce to http GET request. Use proxy settings from preferences.
-	 * @throws Exception
-	 */
-	public static InputStream getInputStreamFromUrlByGetMethod(String url) throws IOException {
-		InputStream is = executeGetMethod(url).getResponseBodyAsStream();
-		return is;
-	}
-
-	/**
-	 * @param url
-	 * @return InputStream of responce to http GET request. Use proxy settings from preferences.
-	 * @throws Exception
-	 */
-	public static InputStream getInputStreamFromUrlByGetMethod(String url, IProxyService proxyService) throws IOException {
-		InputStream is = executeGetMethod(url, proxyService).getResponseBodyAsStream();
-		return is;
-	}
-
-	/**
-	 * @param url
-	 * @param proxyService
-	 * @return Status code of responce to http GET request. Use given proxy settings.
-	 * @throws Exception
-	 */
-	public static int getStatusCodeFromUrlByGetMethod(String url, IProxyService proxyService) throws IOException {
-		int code = executeGetMethod(url, proxyService).getStatusCode();
-		return code;
-	}
-
-	/**
-	 * @param url
-	 * @return Status code of responce to http GET request. Use proxy settings from preferences.
-	 * @throws Exception
-	 */
-	public static int getStatusCodeFromUrlByGetMethod(String url) throws IOException {
-		int code = executeGetMethod(url).getStatusCode();
-		return code;
-	}
-
-	/**
-	 * @param url
-	 * @return InputStream of responce to http POST request. Use proxy settings from preferences.
-	 * @throws Exception
-	 */
-	public static InputStream getInputStreamFromUrlByPostMethod(String url) throws IOException {
-		InputStream is = executePostMethod(url).getResponseBodyAsStream();
-		return is;
-	}
-
-	/**
-	 * @param url
-	 * @param proxyService
-	 * @return Status code of responce to http POST request. Use given proxy settings.
-	 * @throws Exception
-	 */
-	public static int getStatusCodeFromUrlByPostMethod(String url, IProxyService proxyService) throws IOException {
-		int code = executePostMethod(url, proxyService).getStatusCode();
-		return code;
-	}
-
-	/**
-	 * @param url
-	 * @return Status code of responce to http POST request. Use proxy settings from preferences.
-	 * @throws Exception
-	 */
-	public static int getStatusCodeFromUrlByPostMethod(String url) throws IOException {
-		int code = executePostMethod(url).getStatusCode();
-		return code;
-	}
-
-	private static GetMethod executeGetMethod(String url) throws IOException {
-		IProxyService proxyService = getProxyService();
-		return executeGetMethod(url, proxyService);
-	}
-
-	private static PostMethod executePostMethod(String url) throws IOException {
-		IProxyService proxyService = getProxyService();
-		return executePostMethod(url, proxyService);
-	}
-
-	/**
-	 * @param url
-	 * @param proxyService
-	 * @return
-	 * @throws Exception
-	 */
-	public static GetMethod executeGetMethod(String url, IProxyService proxyService) throws IOException {
-		GetMethod httpGet = new GetMethod(url);
-		HttpClient httpClient = createHttpClient(url, proxyService);
-		httpClient.executeMethod(httpGet);
-		return httpGet;
-	}
-
-	private static PostMethod executePostMethod(String url, IProxyService proxyService) throws IOException {
-		PostMethod httpPost = new PostMethod(url);
-		HttpClient httpClient = createHttpClient(url, proxyService);
-	    httpClient.executeMethod(httpPost);
-		return httpPost;
-	}
-
-	/**
-	 * @param url
-	 * @return HttpClient with internet proxy settings;
-	 * @throws Exception
-	 */
-	public static HttpClient createHttpClient(String url) throws IOException {
-		return createHttpClient(url, getProxyService());
-	}
-
-	private static HttpClient createHttpClient(String url, IProxyService proxyService) throws IOException {
-		HttpClient httpClient = new HttpClient();
-
-		if(proxyService.isProxiesEnabled()) {
-			IProxyData[] proxyData = proxyService.getProxyData();
-			URL netUrl = new URL(url);
-			String hostName = netUrl.getHost();
-			String[] nonProxiedHosts = proxyService.getNonProxiedHosts();
-			boolean nonProxiedHost = false;
-			for (int i = 0; i < nonProxiedHosts.length; i++) {
-				String nonProxiedHostName = nonProxiedHosts[i];
-				if(nonProxiedHostName.equalsIgnoreCase(hostName)) {
-					nonProxiedHost = true;
-					break;
-				}
-			}
-			if(!nonProxiedHost) {
-				for (int i = 0; i < proxyData.length; i++) {
-					IProxyData proxy = proxyData[i];
-					if(IProxyData.HTTP_PROXY_TYPE.equals(proxy.getType())) {
-						String proxyHostName = proxy.getHost();
-						if(proxyHostName==null) {
-							break;
-						}
-						int portNumber = proxy.getPort();
-						if(portNumber==-1) {
-							portNumber = 80;
-						}
-						httpClient.getHostConfiguration().setProxy(proxyHostName, portNumber);
-						if(proxy.isRequiresAuthentication()) {
-						    String userName = proxy.getUserId();
-						    if(userName!=null) {
-							    String password = proxy.getPassword();
-							    httpClient.getState().setProxyCredentials(new AuthScope(null, AuthScope.ANY_PORT, null, AuthScope.ANY_SCHEME), new UsernamePasswordCredentials(userName, password));
-						    }
-						}
-						break; // Use HTTP proxy only.
-					}
-				}
-			}
-		}
-
-	    httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(30000);
-
-	    return httpClient;
-	}
-
-	private static IProxyService getProxyService() {
-		if(proxyService==null) {
-			BundleContext bundleContext = CommonPlugin.getInstance().getBundle().getBundleContext();
-			ServiceReference serviceReference = bundleContext.getServiceReference(IProxyService.class.getName());
-			proxyService = (IProxyService)bundleContext.getService(serviceReference);
-		}
-		return proxyService;
-	}
-}
\ No newline at end of file

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.osgi.framework.Bundle;
-
-/**
- * @author eskimo
- * 
- */
-public class ResourcesUtils {
-
-	public static IProject importProject(Bundle bundle, String templLocation,
-			IProgressMonitor monitor) throws IOException, CoreException,
-			InvocationTargetException, InterruptedException {
-
-		String tplPrjLcStr;
-		tplPrjLcStr = FileLocator.resolve(bundle.getEntry(templLocation))
-				.getFile();
-
-		return importProject(tplPrjLcStr, monitor);
-	}
-
-	public static IProject importProject(String location,
-			IProgressMonitor monitor) throws CoreException, IOException,
-			InvocationTargetException, InterruptedException {
-		IProject importedPrj = createEclipseProjectDromDescriptor(location,
-				monitor);
-		ImportOperation op = new ImportOperation(importedPrj.getFullPath(),
-				new File(location), FileSystemStructureProvider.INSTANCE,
-				new IOverwriteQuery() {
-					public String queryOverwrite(String pathString) {
-						return IOverwriteQuery.ALL;
-					}
-				}, Arrays.asList(new File(location).listFiles()));
-
-		op.setCreateContainerStructure(false);
-		op.run(monitor);
-		return importedPrj;
-	}
-
-	public static IProject importExistingProject(IProject project, String location, String name) throws CoreException {
-		return importExistingProject(project, location, name, new NullProgressMonitor(), true);
-	}
-
-	public static IProject importExistingProject(IProject project, String location, String name, IProgressMonitor monitor, boolean refreshWorkspace) throws CoreException {
-		IPath path = new Path(location).append(".project"); //$NON-NLS-1$
-		IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription(path);
-		description.setName(name);
-		project.create(description, monitor);
-		project.open(IResource.NONE, monitor);
-		if(refreshWorkspace) {
-			ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-		}
-		return project;
-	}
-
-	public static IProject createEclipseProject(String projectName,
-			IProgressMonitor monitor) throws CoreException {
-
-		IProject newProjectHandle = ResourcesPlugin.getWorkspace().getRoot()
-				.getProject(projectName);
-
-		IWorkspace workspace = ResourcesPlugin.getWorkspace();
-		final IProjectDescription description = workspace
-				.newProjectDescription(projectName);
-		newProjectHandle.create(description, new NullProgressMonitor());
-		newProjectHandle.open(monitor);
-		return newProjectHandle;
-	}
-
-	public static IProject createEclipseProjectDromDescriptor(
-			String templateLocation, IProgressMonitor monitor)
-			throws CoreException, IOException {
-
-		IPath tplPrjDescr = new Path(templateLocation)
-				.append(IProjectDescription.DESCRIPTION_FILE_NAME);
-		IProjectDescription descr = ResourcesPlugin.getWorkspace()
-				.loadProjectDescription(tplPrjDescr);
-		descr.setLocation(null);
-		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
-				descr.getName());
-		project.create(descr, monitor);
-		project.open(IResource.BACKGROUND_REFRESH, monitor);
-
-		return project;
-	}
-}

Copied: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author eskimo
+ * 
+ */
+public class ResourcesUtils {
+
+	public static IProject importProject(Bundle bundle, String templLocation,
+			IProgressMonitor monitor) throws IOException, CoreException,
+			InvocationTargetException, InterruptedException {
+
+		String tplPrjLcStr;
+		tplPrjLcStr = FileLocator.resolve(bundle.getEntry(templLocation))
+				.getFile();
+
+		return importProject(tplPrjLcStr, monitor);
+	}
+
+	public static IProject importProject(String location,
+			IProgressMonitor monitor) throws CoreException, IOException,
+			InvocationTargetException, InterruptedException {
+		IProject importedPrj = createEclipseProjectDromDescriptor(location,
+				monitor);
+		ImportOperation op = new ImportOperation(importedPrj.getFullPath(),
+				new File(location), FileSystemStructureProvider.INSTANCE,
+				new IOverwriteQuery() {
+					public String queryOverwrite(String pathString) {
+						return IOverwriteQuery.ALL;
+					}
+				}, Arrays.asList(new File(location).listFiles()));
+
+		op.setCreateContainerStructure(false);
+		op.run(monitor);
+		return importedPrj;
+	}
+
+	public static IProject importExistingProject(IProject project, String location, String name) throws CoreException {
+		return importExistingProject(project, location, name, new NullProgressMonitor(), true);
+	}
+
+	public static IProject importExistingProject(IProject project, String location, String name, IProgressMonitor monitor, boolean refreshWorkspace) throws CoreException {
+		IPath path = new Path(location).append(".project"); //$NON-NLS-1$
+		IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription(path);
+		description.setName(name);
+		project.create(description, monitor);
+		project.open(IResource.NONE, monitor);
+		if(refreshWorkspace) {
+			ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+		}
+		return project;
+	}
+
+	public static IProject createEclipseProject(String projectName,
+			IProgressMonitor monitor) throws CoreException {
+
+		IProject newProjectHandle = ResourcesPlugin.getWorkspace().getRoot()
+				.getProject(projectName);
+
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+		final IProjectDescription description = workspace
+				.newProjectDescription(projectName);
+		newProjectHandle.create(description, new NullProgressMonitor());
+		newProjectHandle.open(monitor);
+		return newProjectHandle;
+	}
+
+	public static IProject createEclipseProjectDromDescriptor(
+			String templateLocation, IProgressMonitor monitor)
+			throws CoreException, IOException {
+
+		IPath tplPrjDescr = new Path(templateLocation)
+				.append(IProjectDescription.DESCRIPTION_FILE_NAME);
+		IProjectDescription descr = ResourcesPlugin.getWorkspace()
+				.loadProjectDescription(tplPrjDescr);
+		descr.setLocation(null);
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+				descr.getName());
+		project.create(descr, monitor);
+		project.open(IResource.BACKGROUND_REFRESH, monitor);
+
+		return project;
+	}
+}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/StringUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/StringUtil.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/StringUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,40 +0,0 @@
-/******************************************************************************* 
- * Copyright (c) 2011 Red Hat, Inc. 
- * Distributed under license by Red Hat, Inc. All rights reserved. 
- * This program is made available under the terms of the 
- * Eclipse Public License v1.0 which accompanies this distribution, 
- * and is available at http://www.eclipse.org/legal/epl-v10.html 
- * 
- * Contributors: 
- * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
-
-package org.jboss.tools.common.util;
-
-/**
- * Miscellaneous String utility functions
- * 
- * @author Victor V. Rubezhny
- */
-public class StringUtil {
-/**
-	 * Cuts of the starting and ending quotes from a given text value
-	 * 
-	 * @param Quoted text value
-	 * @return Non-quoted text value 
-	 */
-	public static String trimQuotes(String value) {
-		if(value == null)
-			return null;
-
-		if(value.startsWith("'") || value.startsWith("\"")) {  //$NON-NLS-1$ //$NON-NLS-2$
-			value = value.substring(1);
-		} 
-		
-		if(value.endsWith("'") || value.endsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
-			value = value.substring(0, value.length() - 1);
-		}
-		return value;
-	}
-
-}

Deleted: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -1,227 +0,0 @@
-/*******************************************************************************
-  * Copyright (c) 2011 - 2012 Red Hat, Inc.
-  * Distributed under license by Red Hat, Inc. All rights reserved.
-  * This program is made available under the terms of the
-  * Eclipse Public License v1.0 which accompanies this distribution,
-  * and is available at http://www.eclipse.org/legal/epl-v10.html
-  *
-  * Contributor:
-  *     Red Hat, Inc. - initial API and implementation
-  ******************************************************************************/
-package org.jboss.tools.common.util;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IImportDeclaration;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.CommonPlugin;
-
-public class TypeResolutionCache {	
-	private static TypeResolutionCache instance = new TypeResolutionCache();
-
-	public static TypeResolutionCache getInstance() {
-		return instance;
-	}
-
-	static class Resolved {
-		IType type;
-		Map<String, String> types = new Hashtable<String, String>();
-		List<String> classImports = new ArrayList<String>();
-		List<String> packageImports = new ArrayList<String>();
-		Resolved(IType type) {
-			this.type = type;
-			readImports();
-		}
-		
-		void setType(IType type) {
-			this.type = type;
-			types.clear();
-
-			readImports();
-		}
-	
-		void readImports() {
-			ICompilationUnit unit = type.getCompilationUnit();
-			if(unit == null) return;
-			IImportDeclaration[] ds = null;
-			try {
-				ds = unit.getImports();
-			} catch (JavaModelException e) {
-				CommonPlugin.getDefault().logError(e);
-				ds = new IImportDeclaration[0];
-			}
-			IResource r = unit.getResource();
-			
-			if(r instanceof IFile && r.exists()) {
-				List<String> newClassImports = new ArrayList<String>();
-				List<String> newPackageImports = new ArrayList<String>();
-				//add local package
-				newPackageImports.add(type.getPackageFragment().getElementName() + "."); //$NON-NLS-1$
-				for (IImportDeclaration d: ds) {
-					String q = d.getElementName();
-					if(q.endsWith(".*")) { //$NON-NLS-1$
-						newPackageImports.add( q = q.substring(0, q.length() - 1));
-					} else {
-						newClassImports.add(q);
-					}
-				}
-				classImports = newClassImports;
-				packageImports = newPackageImports;
-			}
-		}
-		
-		public String resolveInImports(String typeName) {
-			if(typeName.indexOf(".") >= 0) { //$NON-NLS-1$
-				try {
-					IType q = EclipseJavaUtil.findType(type.getJavaProject(), typeName);
-					if(q != null) {
-						types.put(typeName, typeName);
-						return typeName;
-					}
-				} catch (JavaModelException e) {
-					CommonPlugin.getDefault().logError(e);
-				}
-				//too difficult
-				return null; 
-			}
-			for (String imp: classImports) {
-				if(imp.endsWith("." + typeName)) { //$NON-NLS-1$
-					types.put(typeName, imp);
-					return imp;
-				}
-			}
-			for (String imp: packageImports) {
-				String result = imp + typeName;
-				try {
-					IType q = EclipseJavaUtil.findType(type.getJavaProject(), result);
-					if(q != null) {
-						types.put(typeName, result);
-						return result;
-					}
-				} catch (JavaModelException e) {
-					CommonPlugin.getDefault().logError(e);
-				}
-			}
-			String pr = "java.lang." + typeName; //$NON-NLS-1$
-			if(primitive.contains(pr)) {
-				types.put(typeName, pr);
-				return pr;
-			}
-
-			if(type.getTypeParameter(typeName).exists()) {
-				types.put(typeName, typeName);
-				return typeName;
-			}
-			return null;
-		}
-	}
-
-	static Set<String> primitive = new HashSet<String>();
-	static {
-		primitive.add("void"); //$NON-NLS-1$
-		primitive.add("int"); //$NON-NLS-1$
-		primitive.add("char"); //$NON-NLS-1$
-		primitive.add("boolean"); //$NON-NLS-1$
-		primitive.add("long"); //$NON-NLS-1$
-		primitive.add("short"); //$NON-NLS-1$
-		primitive.add("double"); //$NON-NLS-1$
-		primitive.add("float"); //$NON-NLS-1$
-		primitive.add("java.lang.Object"); //$NON-NLS-1$
-		primitive.add("java.lang.Number"); //$NON-NLS-1$
-		primitive.add("java.lang.Integer"); //$NON-NLS-1$
-		primitive.add("java.lang.Character"); //$NON-NLS-1$
-		primitive.add("java.lang.Boolean"); //$NON-NLS-1$
-		primitive.add("java.lang.Long"); //$NON-NLS-1$
-		primitive.add("java.lang.Short"); //$NON-NLS-1$
-		primitive.add("java.lang.Double"); //$NON-NLS-1$
-		primitive.add("java.lang.Float"); //$NON-NLS-1$
-		primitive.add("java.lang.String"); //$NON-NLS-1$
-		primitive.add("java.lang.StringBuffer"); //$NON-NLS-1$
-		primitive.add("java.lang.Class"); //$NON-NLS-1$
-		primitive.add("java.lang.Deprecated"); //$NON-NLS-1$
-		primitive.add("java.lang.SuppressWarnings"); //$NON-NLS-1$
-		primitive.add("java.lang.Throwable"); //$NON-NLS-1$
-		primitive.add("java.lang.Exception"); //$NON-NLS-1$
-		primitive.add("java.lang.RuntimeException"); //$NON-NLS-1$
-		primitive.add("java.lang.Override"); //$NON-NLS-1$
-	}
-	static String NULL = ";;;"; //$NON-NLS-1$
-	Map<String,Resolved> resolved = new Hashtable<String, Resolved>();
-
-	private TypeResolutionCache() {}
-	
-	public String resolveType(IType type, String typeName) {
-		if(type == null) return null;
-		if(type.isBinary() || typeName == null || primitive.contains(typeName)) return typeName;
-
-		String n = getKey(type);
-		Resolved r = resolved.get(n);
-		if(r == null) {
-			r = new Resolved(type);
-			resolved.put(n, r);
-		} else if(r.type != type) {
-			r.setType(type);
-		}
-		
-		String result = r.types.get(typeName);		
-		if(result != null) {
-			return (result == NULL) ? null : result;
-		}
-
-		result = r.resolveInImports(typeName);
-		if(result != null) {
-			return result;
-		}
-		
-		result = __resolveType(type, typeName);
-		
-//		System.out.println(typeName + "---" + result);
-		
-		r.types.put(typeName, result == null ? NULL : result);
-		return result;
-
-	}
-	
-	public void clean() {
-		resolved = new Hashtable<String, Resolved>();
-	}
-
-	private String __resolveType(IType type, String typeName) {
-		try	{
-			String resolvedArray[][] = type.resolveType(typeName);
-//			resolvedArray == null for primitive types
-			if(resolvedArray == null) return typeName;
-			typeName = ""; //$NON-NLS-1$
-			for (int i = 0; i < resolvedArray[0].length; i++) 
-				typeName += (!"".equals(typeName) ? "." : "") + resolvedArray[0][i];  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			return typeName;
-		} catch (JavaModelException e) {
-			CommonPlugin.getPluginLog().logError(e);
-		} catch (IllegalArgumentException e) {
-			CommonPlugin.getPluginLog().logError(e);
-		}
-		return null;
-	}
-	
-	private String getKey(IType type) {
-		String n = type.getFullyQualifiedName();
-		IJavaProject jp = type.getJavaProject();
-		if(jp == null) return n;
-		IProject p = jp.getProject();
-		if(p == null || !p.isAccessible()) return n;
-		return p.getName() + ":" + n; //$NON-NLS-1$
-	}
-
-}

Added: trunk/common/plugins/org.jboss.tools.common.core/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/.classpath	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/.classpath	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>


Property changes on: trunk/common/plugins/org.jboss.tools.common.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.core/.project
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/.project	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/.project	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.common.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+	</natures>
+</projectDescription>


Property changes on: trunk/common/plugins/org.jboss.tools.common.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/META-INF/MANIFEST.MF	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,43 @@
+Manifest-Version: 1.0
+Bundle-Name: %Bundle-Name.0
+Bundle-ClassPath: .
+Bundle-Activator: org.jboss.tools.common.core.CommonCorePlugin
+Bundle-Vendor: %providerName
+Bundle-SymbolicName: org.jboss.tools.common.core;singleton:=true
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.common.core,
+ org.jboss.tools.common.databinding,
+ org.jboss.tools.common.java,
+ org.jboss.tools.common.java.impl,
+ org.jboss.tools.common.jobs,
+ org.jboss.tools.common.log,
+ org.jboss.tools.common.preferences,
+ org.jboss.tools.common.reporting,
+ org.jboss.tools.common.text,
+ org.jboss.tools.common.util,
+ org.jboss.tools.common.web,
+ org.jboss.tools.common.xml,
+ org.jboss.tools.common.zip
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.wst.xml.core;bundle-version="1.1.600";visibility:=reexport,
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
+ org.eclipse.jem.util;bundle-version="2.1.2",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.eclipse.jface;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.wst.common.uriresolver;bundle-version="1.1.401";visibility:=reexport,
+ org.eclipse.core.net;bundle-version="1.2.100",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
+ org.apache.commons.httpclient;bundle-version="3.1.0",
+ org.eclipse.jpt.common.core;bundle-version="1.0.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
+ org.eclipse.jdt.core.manipulation;bundle-version="1.5.0",
+ org.eclipse.core.filebuffers;bundle-version="3.5.200"
+Bundle-Version: 3.4.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-ManifestVersion: 2
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Added: trunk/common/plugins/org.jboss.tools.common.core/about.html
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/about.html	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/about.html	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>&copy;2007 - 2012 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the 
+Content is being redistributed by another party ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the Redistributor's license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+  <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file

Added: trunk/common/plugins/org.jboss.tools.common.core/build.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/build.properties	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/build.properties	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,7 @@
+source.. = src
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               plugin.properties,\
+               about.html
+source.. = src

Added: trunk/common/plugins/org.jboss.tools.common.core/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/plugin.properties	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/plugin.properties	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,7 @@
+providerName=JBoss by Red Hat
+
+reportParameterName=reportDescription
+reportingUrl=http://box.exadel.com/goto/bugreport.jsp
+reportingJobName=Bug reporting
+errorReportingMessage=Can't submit report
+Bundle-Name.0 = JBoss Tools Common Core

Added: trunk/common/plugins/org.jboss.tools.common.core/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/plugin.xml	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/plugin.xml	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+</plugin>
\ No newline at end of file


Property changes on: trunk/common/plugins/org.jboss.tools.common.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.core/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/pom.xml	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/pom.xml	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion> 
+	<parent>
+		<groupId>org.jboss.tools.common</groupId>
+		<artifactId>plugins</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.common.plugins</groupId>
+	<artifactId>org.jboss.tools.common.core</artifactId> 
+	
+	<packaging>eclipse-plugin</packaging>
+</project>


Property changes on: trunk/common/plugins/org.jboss.tools.common.core/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/core/CommonCorePlugin.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,117 @@
+package org.jboss.tools.common.core;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.log.BasePlugin;
+import org.jboss.tools.common.log.IPluginLog;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+public class CommonCorePlugin extends BasePlugin {
+	public static final String PLUGIN_ID = "org.jboss.tools.common"; //$NON-NLS-1$
+	protected static CommonCorePlugin instance;
+	private static String environment;
+
+	public CommonCorePlugin() {
+		super();
+		instance = this;
+	}
+
+	public static CommonCorePlugin getInstance() {
+	    return instance;
+	}
+
+    public void start(BundleContext context) throws Exception {
+        super.start(context);
+	}
+	/**
+	 * Gets message from plugin.properties
+	 * @param key
+	 * @return
+	 */
+	public static String getMessage(String key)	{
+		return Platform.getResourceString(instance.getBundle(), key);
+	}
+
+	/**
+	 * @return Studio environment.
+	 */
+	public static String getEnvironment() {
+		if(environment == null) {
+			String osName = System.getProperty("os.name"); //$NON-NLS-1$
+			String javaVersion = System.getProperty("java.version"); //$NON-NLS-1$
+			String studioName = "unknown"; //$NON-NLS-1$
+			String studioVersion = "unknown"; //$NON-NLS-1$
+			String eclipseVersion = "unknown"; //$NON-NLS-1$
+			String eclipseBuildId = "unknown"; //$NON-NLS-1$
+
+			Bundle studio = Platform.getBundle("org.jboss.tools.common"); //$NON-NLS-1$
+			if(studio!=null) {
+				Dictionary studioDic = studio.getHeaders();
+				studioName = (String)studioDic.get("Bundle-Name"); //$NON-NLS-1$
+				studioVersion = (String)studioDic.get("Bundle-Version"); //$NON-NLS-1$
+			}
+
+			Bundle eclipse = Platform.getBundle("org.eclipse.platform"); //$NON-NLS-1$
+			if(eclipse!=null) {
+				Dictionary eclipseDic = eclipse.getHeaders();
+				eclipseVersion = (String)eclipseDic.get("Bundle-Version"); //$NON-NLS-1$
+				FileInputStream fis = null;
+				try {
+					String path = FileLocator.resolve(eclipse.getEntry("/")).getPath(); //$NON-NLS-1$
+					if(path!=null) {
+						File aboutMappings = new File(path, "about.mappings"); //$NON-NLS-1$
+						if(aboutMappings.exists()) {
+							Properties properties = new Properties();
+							fis = new FileInputStream(aboutMappings);
+							properties.load(fis);
+							String buildId = properties.getProperty("0"); //$NON-NLS-1$
+							if(buildId!=null && buildId.length()>0) {
+								eclipseBuildId = buildId;
+							}
+						}
+					}
+				} catch (IOException e) {
+					getPluginLog().logError("Error in getting environment info: " + e.getMessage()); //$NON-NLS-1$
+				} finally {
+					if(fis!=null) {
+						try {
+							fis.close();
+						} catch (IOException e) {
+							// ignore
+						}
+					}
+				}
+			}
+			StringBuffer result = new StringBuffer(studioName).append(" ").append(studioVersion). //$NON-NLS-1$
+				append(", Eclipse ").append(eclipseVersion).append(" "). //$NON-NLS-1$ //$NON-NLS-2$
+				append(eclipseBuildId).append(", Java ").append(javaVersion). //$NON-NLS-1$
+				append(", ").append(osName); //$NON-NLS-1$
+			environment = result.toString();
+		}
+		return environment;
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static CommonCorePlugin getDefault() {
+		return instance;
+	}
+
+	/**
+	 * @return IPluginLog object
+	 */
+	public static IPluginLog getPluginLog() {
+		return getDefault();
+	}
+
+}

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedType.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedType.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -23,7 +23,7 @@
 import org.eclipse.jdt.core.ITypeParameter;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 
 /**
  * 
@@ -224,7 +224,7 @@
 				}
 			}
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		this.inheritedTypes = inheritedTypes;
 		inheritanceIsBuilt = true;

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/ParametedTypeFactory.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/ParametedTypeFactory.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -21,7 +21,7 @@
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.Signature;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.jboss.tools.common.util.EclipseJavaUtil;
 
 public class ParametedTypeFactory { 
@@ -48,7 +48,7 @@
 			try {
 				r = type.getNameRange();
 			} catch (CoreException e) {
-				CommonPlugin.getDefault().logError(e);
+				CommonCorePlugin.getDefault().logError(e);
 			}
 			if(r != null) {
 				parametedType = new TypeDeclaration(parametedType, type.getResource(), r.getOffset(), r.getLength());
@@ -61,7 +61,7 @@
 		try {
 			ps = type.getTypeParameterSignatures();
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		if(ps != null && ps.length > 0) {
 			for (int i = 0; i < ps.length; i++) {
@@ -69,7 +69,7 @@
 					ParametedType p = getParametedTypeForParameter(type, ps[i], null);
 					if(p != null) parametedType.addParameter(p);
 				} catch (JavaModelException e) {
-					CommonPlugin.getDefault().logError(e);
+					CommonCorePlugin.getDefault().logError(e);
 				}
 			}
 		}
@@ -137,7 +137,7 @@
 					ParametedType st = getParametedTypeForParameter(context, ps[i], result);
 					if(st != null) {
 						if(st.getSignature().indexOf(Signature.C_COLON) >= 0) {
-							CommonPlugin.getDefault().logWarning("Wrong signature=" + st.getSignature());
+							CommonCorePlugin.getDefault().logWarning("Wrong signature=" + st.getSignature());
 						}
 						return st;
 					}
@@ -163,7 +163,7 @@
 				try {
 					paramSignatures = Signature.getTypeArguments(typeSignature);
 				} catch (IllegalArgumentException e) {
-					CommonPlugin.getDefault().logError(e);
+					CommonCorePlugin.getDefault().logError(e);
 				}
 				if(paramSignatures != null) for (String paramSignature: paramSignatures) {
 					ParametedType param = getParametedType(context, basetype, paramSignature);

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/AnnotationDeclaration.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -24,7 +24,7 @@
 import org.eclipse.jdt.core.IMember;
 import org.eclipse.jdt.core.IMemberValuePair;
 import org.eclipse.jdt.core.IType;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.jboss.tools.common.java.IAnnotationDeclaration;
 import org.jboss.tools.common.java.IAnnotationType;
 import org.jboss.tools.common.java.IJavaAnnotation;
@@ -159,7 +159,7 @@
 				}
 				
 			} catch (CoreException e) {
-				CommonPlugin.getDefault().logError(e);
+				CommonCorePlugin.getDefault().logError(e);
 			}
 		}
 		

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/java/impl/JavaAnnotation.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/java/impl/JavaAnnotation.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -18,7 +18,7 @@
 import org.eclipse.jdt.core.ISourceRange;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.jboss.tools.common.java.IJavaAnnotation;
 import org.jboss.tools.common.util.EclipseJavaUtil;
 
@@ -35,7 +35,7 @@
 			annotationTypeName = EclipseJavaUtil.resolveType(declaringType, name);
 			type = EclipseJavaUtil.findType(annotation.getJavaProject(), annotationTypeName);
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 	}
 
@@ -58,7 +58,7 @@
 				return range.getLength();
 			}
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		return 0;
 	}
@@ -70,7 +70,7 @@
 				return range.getOffset();
 			}
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		return 0;
 	}
@@ -94,7 +94,7 @@
 		try {
 			return annotation.getMemberValuePairs();
 		} catch (JavaModelException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		return new IMemberValuePair[0];
 	}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/BasePlugin.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BasePlugin.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/BasePlugin.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/BasePlugin.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.log;
+
+import org.eclipse.core.runtime.Plugin;
+
+/**
+ * Provides an easy way to log status of events.
+ * 
+ * NOTE: It is useful to make the static method getPluginLog()
+ * which provides the interface IPluginLog for using it in your code
+ * in future
+ *  
+ * @author Sergey Vasilyev
+ *
+ */
+
+public class BasePlugin extends Plugin implements IPluginLog {
+	public void logError(String message, Throwable t) {
+		LogHelper.logError(this, message, t);
+	}
+
+	public void logError(String message) {
+		LogHelper.logError(this, message);
+	}
+	
+	public void logError(Throwable t) {
+		LogHelper.logError(this, t);
+	}
+
+	public void logWarning(String message, Throwable t) {
+		LogHelper.logWarning(this, message, t);
+	}
+	
+	public void logWarning(String message) {
+		LogHelper.logWarning(this, message);
+	}
+	
+	public void logWarning(Throwable t) {
+		LogHelper.logWarning(this, t);
+	}
+
+	public void logInfo(String message, Throwable t) {
+		LogHelper.logInfo(this, message, t);
+	}
+	
+	public void logInfo(String message) {
+		LogHelper.logInfo(this, message);
+	}
+}
\ No newline at end of file

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/ILoggingAdapter.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/ILoggingAdapter.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/ILoggingAdapter.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/ILoggingAdapter.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.log;
+
+/**
+ * @author Andre Dietisheim
+ */
+public interface ILoggingAdapter {
+
+  public void error(String errorMessage);
+
+  public void debug(String message);
+
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/IPluginLog.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/IPluginLog.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/IPluginLog.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/IPluginLog.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.log;
+
+public interface IPluginLog {
+	public void logError(String message, Throwable t);
+	public void logError(String message);
+	public void logError(Throwable t);
+
+	public void logWarning(String message, Throwable t);	
+	public void logWarning(String message);	
+	public void logWarning(Throwable t);
+	
+	public void logInfo(String message, Throwable t);	
+	public void logInfo(String message);
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/LogHelper.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/LogHelper.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/LogHelper.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/LogHelper.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.log;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.Bundle;
+
+public class LogHelper {
+	public static void logError(Plugin plugin, Throwable t) {
+		logError(plugin, null, t);
+	}
+
+	public static void logError(Plugin plugin, String message) {
+		logError(plugin, message, null);
+	}
+	
+	public static void logError(Plugin plugin, String message, Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.ERROR, 
+				plugin.getBundle().getSymbolicName(), message, t);
+		logStatus(plugin, status); 
+	}
+	
+	public static void logError(String pluginId, Throwable t) {
+		logError(pluginId, null, t);
+	}
+
+	public static void logError(String pluginId, String message) {
+		logError(pluginId, message, null);
+	}
+	
+	public static void logError(String pluginId, String message, Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.ERROR, pluginId,
+				message, t);
+		logStatus(pluginId, status);
+	}
+	
+	public static void logWarning(Plugin plugin, Throwable t) {
+		logWarning(plugin, null, t);
+	}
+	
+	public static void logWarning(Plugin plugin, String message) {
+		logWarning(plugin, message, null);
+	}
+	
+	
+	public static void logWarning(Plugin plugin, String message, Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.WARNING, 
+				plugin.getBundle().getSymbolicName(), message, t);
+		logStatus(plugin, status); 
+	}
+	
+	public static void logWarning(String pluginId, Throwable t) {
+		logWarning(pluginId, null, t);
+	}
+	
+	public static void logWarning(String pluginId, String message) {
+		logWarning(pluginId, message, null);
+	}
+	
+	
+	public static void logWarning(String pluginId, String message,
+								Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.WARNING, pluginId,
+				message, t);
+		logStatus(pluginId, status);
+	}
+
+	public static void logInfo(Plugin plugin, String message,
+								Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.INFO, 
+				plugin.getBundle().getSymbolicName(), message, t);
+		logStatus(plugin, status); 
+	}
+	
+	
+	public static void logInfo(Plugin plugin, String message) {
+		IStatus status = StatusFactory.getInstance(IStatus.INFO, 
+				plugin.getBundle().getSymbolicName(), message);
+		logStatus(plugin, status); 
+	}
+
+	public static void logInfo(String pluginId, String message,
+								Throwable t) {
+		IStatus status = StatusFactory.getInstance(IStatus.INFO, pluginId,
+				message, t);
+		logStatus(pluginId, status);
+	}
+	
+	public static void logInfo(String pluginId, String message) {
+		IStatus status = StatusFactory.getInstance(IStatus.INFO, pluginId,
+				message);
+		logStatus(pluginId, status);
+	}
+
+	public static void log(int severity, String pluginId, int code,
+							String message, Throwable t) {
+		IStatus status = StatusFactory.getInstance(severity, pluginId, code,
+				message, t);
+		logStatus(pluginId, status);
+	}
+	
+	public static void logStatus(Plugin plugin, IStatus status) {
+		plugin.getLog().log(status);
+	}
+
+	public static void logStatus(String pluginId, IStatus status) {
+		Bundle bundle = Platform.getBundle(pluginId);
+		logStatus(bundle, status);
+	}
+	
+	public static void logStatus(Bundle bundle, IStatus status) {
+		ILog log = Platform.getLog(bundle);
+		log.log(status);
+	}
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/PluginLogger.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/PluginLogger.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/PluginLogger.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/PluginLogger.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.log;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * A logging adapter that logs to a given plugin.
+ * 
+ * @author Andre Dietisheim
+ */
+public class PluginLogger implements ILoggingAdapter {
+
+	private Plugin plugin;
+
+	public PluginLogger(Plugin plugin) {
+		this.plugin = plugin;
+	}
+
+	public void error(String message) {
+		log(IStatus.ERROR, message);
+	}
+
+	public void debug(String message) {
+		log(IStatus.INFO, message);
+	}
+
+	private void log(int severity, String message) {
+		if (!isTracingEnabled()) {
+			return;
+		}
+
+		if (plugin != null) {
+			IStatus status = new Status(severity, plugin.getBundle().getSymbolicName(), message);
+			plugin.getLog().log(status);
+		}
+	}
+
+	protected Plugin getPlugin() {
+		return plugin;
+	}
+	
+	protected boolean isTracingEnabled() {
+		// defaults to always log
+		return true;
+	}
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/StatusFactory.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/StatusFactory.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/StatusFactory.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/log/StatusFactory.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.log;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+
+public class StatusFactory {
+	public final static int UNDEFINED_ERROR = 0;
+	public final static String UNSPECIFIED_MESSAGE = null;
+	public final static String EMPTY_MESSAGE = ""; //$NON-NLS-1$
+
+	public static IStatus getInstance(int severity, String pluginId,
+									int code, String message, Throwable t) {
+		return new Status(severity, pluginId, code, checkMessage(message, t), t);
+	}
+
+	public static IStatus getInstance(int severity, String pluginId,
+			String message, Throwable t) {
+		return getInstance(severity, pluginId, UNDEFINED_ERROR, message, t);
+	}
+
+	public static IStatus getInstance(int severity, String pluginId,
+			String message) {
+		return getInstance(severity, pluginId, UNDEFINED_ERROR, message, null);
+	}
+
+	public static IStatus getInstance(int severity, String pluginId,
+			Throwable t) {
+		return getInstance(severity, pluginId, UNDEFINED_ERROR, EMPTY_MESSAGE, t);
+	}
+
+	public static IStatus getInstance(int severity, String pluginId,
+			int code, Throwable t) {
+		return getInstance(severity, pluginId, code, EMPTY_MESSAGE, t);
+	}
+
+	public static IStatus getInstance(int severity, String pluginId,
+			int code, String message) {
+		return getInstance(severity, pluginId, code, message, null);
+	}
+
+	/**
+	 * Returns a multi status with the given severity, plugin id, error code,
+	 * message, cause and child status instances.
+	 * 
+	 * @param severity
+	 * @param pluginId
+	 * @param message
+	 * @param t
+	 * @param status
+	 * @return a multi status
+	 */
+	public static IStatus getInstance(int severity, String pluginId, String message, Throwable t, IStatus... status) {
+		return new MultiStatus(pluginId, UNDEFINED_ERROR, status, message, t);
+	}
+
+	private static String checkMessage(String message, Throwable t) {
+		if (message == UNSPECIFIED_MESSAGE) {
+			if (t != null && t.getMessage() != null) {
+				return t.getMessage();
+			}
+			return EMPTY_MESSAGE;
+		}
+		return message;
+	}
+}

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/preferences/SeverityPreferences.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/preferences/SeverityPreferences.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -18,7 +18,7 @@
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jdt.core.JavaCore;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 
 /**
  * Constants for names of seam preferences.
@@ -46,9 +46,9 @@
 public abstract class SeverityPreferences {
 
 	public static final String ENABLE_BLOCK_PREFERENCE_NAME = "enableBlock"; //$NON-NLS-1$
-	public static final String MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME = CommonPlugin.PLUGIN_ID + ".validator.problem.markersBlock"; //$NON-NLS-1$
+	public static final String MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME = CommonCorePlugin.PLUGIN_ID + ".validator.problem.markersBlock"; //$NON-NLS-1$
 	public static final int DEFAULT_MAX_NUMBER_OF_MARKERS_PER_FILE = 20;
-	public static final String WRONG_BUILDER_ORDER_PREFERENCE_NAME = CommonPlugin.PLUGIN_ID + ".validator.problem.wrongBuilderOrder"; //$NON-NLS-1$
+	public static final String WRONG_BUILDER_ORDER_PREFERENCE_NAME = CommonCorePlugin.PLUGIN_ID + ".validator.problem.wrongBuilderOrder"; //$NON-NLS-1$
 
 	public static final String ERROR = "error"; //$NON-NLS-1$
 	public static final String WARNING = "warning"; //$NON-NLS-1$

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/ProblemBuffer.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/ProblemBuffer.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -12,14 +12,14 @@
 
 import java.io.File;
 
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.util.FileUtils;
+import org.osgi.framework.Bundle;
 //import org.eclipse.core.internal.runtime.PlatformLogWriter;
 //import org.eclipse.core.runtime.ILogListener;
 //import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
 //import org.eclipse.core.runtime.adaptor.EclipseLog;
 //import org.eclipse.osgi.framework.log.FrameworkLog;
-import org.jboss.tools.common.util.FileUtil;
-import org.osgi.framework.Bundle;
 
 /**
  * This class is intended only to be called by Report Problem Framework.
@@ -68,12 +68,12 @@
 	 */	
 	public String getContent() {
 		File f = getLogFile();
-		return (!f.isFile()) ? "" : FileUtil.readFile(f); //$NON-NLS-1$
+		return (!f.isFile()) ? "" : FileUtils.readFile(f); //$NON-NLS-1$
 	}
 	
 	public String getEclipseLogContent() {
 		File f = Platform.getLogFileLocation().toFile();
-		return (f.isFile()) ? FileUtil.readFile(f) : ""; //$NON-NLS-1$
+		return (f.isFile()) ? FileUtils.readFile(f) : ""; //$NON-NLS-1$
 	}
 	
 	public void clean() {

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/Submit.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/reporting/Submit.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -18,7 +18,7 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.jboss.tools.common.util.HttpUtil;
 
 /**
@@ -27,11 +27,11 @@
  */
 public class Submit {
 
-	public static String REPORT_DESRIPTION_PARAMETER_NAME = CommonPlugin.getMessage("%reportParameterName"); //$NON-NLS-1$
+	public static String REPORT_DESRIPTION_PARAMETER_NAME = CommonCorePlugin.getMessage("%reportParameterName"); //$NON-NLS-1$
 
-	private static String URL = CommonPlugin.getMessage("%reportingUrl"); //$NON-NLS-1$
-	private static String JOB_NAME = CommonPlugin.getMessage("%reportingJobName"); //$NON-NLS-1$
-	private static String ERROR_MESSAGE = CommonPlugin.getMessage("%errorReportingMessage"); //$NON-NLS-1$
+	private static String URL = CommonCorePlugin.getMessage("%reportingUrl"); //$NON-NLS-1$
+	private static String JOB_NAME = CommonCorePlugin.getMessage("%reportingJobName"); //$NON-NLS-1$
+	private static String ERROR_MESSAGE = CommonCorePlugin.getMessage("%errorReportingMessage"); //$NON-NLS-1$
 
 	private static Submit INSTANCE = new Submit();
 
@@ -63,7 +63,7 @@
 					if(exceptionMessage!=null && exceptionMessage.trim().length()>0) {
 						message = message + ".\r\n" + e.getClass().getName() + ": " + exceptionMessage; //$NON-NLS-1$ //$NON-NLS-2$
 					}
-					Status status = new Status(IStatus.WARNING, CommonPlugin.PLUGIN_ID, IStatus.WARNING, message, e);
+					Status status = new Status(IStatus.WARNING, CommonCorePlugin.PLUGIN_ID, IStatus.WARNING, message, e);
 					return status;
 				}
 				if(cleanBuffer) {

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/BeanUtil.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/BeanUtil.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/BeanUtil.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/BeanUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+  * Copyright (c) 2010 Red Hat, Inc.
+  * Distributed under license by Red Hat, Inc. All rights reserved.
+  * This program is made available under the terms of the
+  * Eclipse Public License v1.0 which accompanies this distribution,
+  * and is available at http://www.eclipse.org/legal/epl-v10.html
+  *
+  * Contributors:
+  *     Red Hat, Inc. - initial API and implementation
+  ******************************************************************************/
+package org.jboss.tools.common.util;
+
+import org.eclipse.jdt.core.IMethod;
+
+/**
+ * 
+ * @author V. Kabanovich
+ *
+ */
+public class BeanUtil {
+	public static final String GET = "get"; //$NON-NLS-1$
+	public static final String SET = "set"; //$NON-NLS-1$
+	public static final String IS = "is"; //$NON-NLS-1$
+
+	public static boolean isGetter(String methodName, int numberOfParameters) {
+		return (((methodName.startsWith(GET) && !methodName.equals(GET))
+					|| (methodName.startsWith(IS) && !methodName.equals(IS)))
+				&& numberOfParameters == 0);
+	}
+
+	public static boolean isSetter(String methodName, int numberOfParameters) {
+		return (((methodName.startsWith(SET) && !methodName.equals(SET)))
+				&& numberOfParameters == 1);
+	}
+
+	public static boolean isGetter(IMethod method) {
+		return method != null && isGetter(method.getElementName(), method.getNumberOfParameters())
+			&& checkPropertyReturnType(method);
+	}
+
+	
+	public static boolean checkPropertyReturnType(String typeName, String methodName) {
+		if(typeName == null || typeName.equals("void")) { //$NON-NLS-1$
+			return false;
+		}
+		if(methodName.startsWith(BeanUtil.IS)) {
+			if(!"boolean".equals(typeName) && !"java.lang.Boolean".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
+				return false;
+			}			
+		}
+		return true;
+	}
+
+	private static boolean checkPropertyReturnType(IMethod method) {
+		return method != null && checkPropertyReturnType(EclipseJavaUtil.getMemberTypeAsString(method), method.getElementName());
+	}
+
+	public static boolean isSetter(IMethod method) {
+		return method != null && isSetter(method.getElementName(), method.getNumberOfParameters());
+	}
+
+	public static String getPropertyName(String methodName) {
+		if(isGetter(methodName, 0) || isSetter(methodName, 1)) {
+			StringBuffer name = new StringBuffer(methodName);
+			if(methodName.startsWith(IS)) {
+				name.delete(0, 2);
+			} else {
+				name.delete(0, 3);
+			}
+			if(name.length() < 2 || !Character.isUpperCase(name.charAt(1))) {
+				name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+			}
+			return name.toString();
+		}
+		return null;
+	}
+
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/EclipseJavaUtil.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/EclipseJavaUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IAnnotatable;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.jboss.tools.common.core.CommonCorePlugin;
+
+public class EclipseJavaUtil {
+
+	public static String getMemberTypeAsString(IMember member) {
+		if(member instanceof IField) return getMemberTypeAsString((IField)member);
+		if(member instanceof IMethod) return getMemberTypeAsString((IMethod)member);
+		return null;
+	}
+
+	public static String getMemberTypeAsString(IField f) {
+		if(f == null) return null;
+		try	{
+			String typeName = new String(Signature.toCharArray(f.getTypeSignature().toCharArray()));
+			return resolveType(f.getDeclaringType(), typeName);
+		} catch (JavaModelException e) {
+			CommonCorePlugin.getPluginLog().logError(e);
+		}
+		return null;
+	}
+
+	public static String getMemberTypeAsString(IMethod m) {
+		if(m == null) return null;
+		try	{
+			return resolveTypeAsString(m.getDeclaringType(), m.getReturnType());
+		} catch (JavaModelException e) {
+			CommonCorePlugin.getPluginLog().logError(e);
+		}
+		return null;
+	}
+
+	public static String resolveTypeAsString(IType type, String typeName) {
+		if(type == null || typeName == null) return null;
+		typeName = new String(Signature.toCharArray(typeName.toCharArray()));
+		int i = typeName.indexOf(Signature.C_GENERIC_START);
+		if(i > 0) typeName = typeName.substring(0, i);
+		return resolveType(type, typeName);
+	}
+
+	public static String resolveType(IType type, String typeName) {
+		return TypeResolutionCache.getInstance().resolveType(type, typeName);
+	}
+	
+	public static IType findType(IJavaProject javaProject, String qualifiedName) throws JavaModelException {
+		if(qualifiedName == null || qualifiedName.length() == 0) return null;
+		IType type = javaProject.findType(qualifiedName);
+		if(type != null) return type;
+		int dot = qualifiedName.lastIndexOf('.');
+		String packageName = (dot < 0) ? "" : qualifiedName.substring(0, dot); //$NON-NLS-1$
+		String shortName = qualifiedName.substring(dot + 1);
+		IPackageFragmentRoot[] rs = javaProject.getPackageFragmentRoots();
+		for (int i = 0; i < rs.length; i++) {
+			IPackageFragment f = rs[i].getPackageFragment(packageName);
+			if(f == null || !f.exists()) continue;
+			ICompilationUnit[] us = f.getCompilationUnits();
+			for (int j = 0; j < us.length; j++) {
+				IType t = us[j].getType(shortName);
+				if(t != null && t.exists()) return t;
+			}
+		}
+		return null;
+	}
+	
+	public static List<IType> getSupperTypes(IType type) throws JavaModelException {
+		ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
+		IType[] superTypes = typeHierarchy == null ? null : typeHierarchy.getAllSupertypes(type);
+		if(superTypes == null) {
+			return Collections.emptyList();
+		}
+		List<IType> suppers = new ArrayList<IType>();
+		for (int i = 0; i < superTypes.length; i++) {
+			suppers.add(superTypes[i]);
+		}
+		return suppers;
+	}
+	
+	public static IAnnotation findAnnotation(IType sourceType, IAnnotatable member, String qulifiedAnnotationName) throws JavaModelException{
+		IAnnotation[] annotations = member.getAnnotations();
+		String simpleAnnotationTypeName = qulifiedAnnotationName;
+		int lastDot = qulifiedAnnotationName.lastIndexOf('.');
+		if(lastDot>-1) {
+			simpleAnnotationTypeName = simpleAnnotationTypeName.substring(lastDot + 1);
+		}
+		for (IAnnotation annotation : annotations) {
+			if(qulifiedAnnotationName.equals(annotation.getElementName())) {
+				return annotation;
+			}
+			if(simpleAnnotationTypeName.equals(annotation.getElementName())) {
+				String fullAnnotationclassName = EclipseJavaUtil.resolveType(sourceType, simpleAnnotationTypeName);
+				if(fullAnnotationclassName!=null) {
+					IType annotationType = sourceType.getJavaProject().findType(fullAnnotationclassName);
+					if(annotationType!=null && annotationType.getFullyQualifiedName().equals(qulifiedAnnotationName)) {
+						return annotation;
+					}
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Finds field declared in the given type or its super types.
+	 * 
+	 * @param type
+	 * @param name
+	 * @return
+	 * @throws CoreException
+	 */
+	public static IField findField(IType type, String name) throws CoreException {
+		return findField(type, name, new HashSet<IType>());
+	}
+	private static IField findField(IType type, String name, Set<IType> processed) throws CoreException {
+		if(!type.exists() || processed.contains(type)) {
+			return null;
+		}
+		processed.add(type);
+		if(type.getField(name).exists()) {
+			return type.getField(name);
+		}
+		IField f = findField(type, type.getSuperclassName(), name, processed);
+		String[] is = type.getSuperInterfaceNames();
+		for (int i = 0; f == null && i < is.length; i++) {
+			f = findField(type, is[i], name, processed);
+		}
+		if(f == null) {
+			IType d = type.getDeclaringType();
+			if(d != null && d != type && d.exists()) {
+				f = findField(d, name);
+			}
+		}
+		
+		return f;
+	}
+	private static IField findField(IType context, String typeName, String fieldName, Set<IType> processed) throws CoreException {
+		typeName = resolveType(context, typeName);
+		if(typeName != null) {
+			IType s = findType(context.getJavaProject(), typeName);
+			return (s != null) ? findField(s, fieldName, processed) : null;
+		}
+		return null;
+	}
+
+	/**
+	 * Returns true if the given annotation has the given full name
+	 * @param annotation
+	 * @param fullName
+	 * @return
+	 * @throws JavaModelException
+	 */
+	public static boolean checkAnnotationByFulltName(IAnnotation annotation, String fullName) throws JavaModelException {
+		if(annotation.getElementName().equals(fullName)) {
+			return true;
+		}
+		boolean result = true;
+		IType sourceType = null;
+		IJavaElement parent = annotation.getParent();
+		if(parent instanceof IMember) {
+			if(parent instanceof IType) {
+				sourceType = (IType)parent;
+			} else {
+				sourceType = ((IMember)parent).getDeclaringType();
+			}
+			String fullAnnotationName = EclipseJavaUtil.resolveType(sourceType, annotation.getElementName());
+			if(fullAnnotationName!=null) {
+				IType annotationType = sourceType.getJavaProject().findType(fullAnnotationName);
+				result = annotationType!=null && annotationType.getFullyQualifiedName().equals(fullName);
+			} else {
+				result = false;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Returns annotation by the short name declared for the given java member and its parents.
+	 * Returns null if no annotation found.
+	 * @param member
+	 * @param name
+	 * @param checkParents
+	 * @return
+	 * @throws JavaModelException
+	 */
+	public static Set<IAnnotation> findAnnotationsByShortName(IJavaElement element, String name, boolean checkParents) throws JavaModelException {
+		return findAnnotationsByShortName(null, element, name, checkParents);
+	}
+
+	private static Set<IAnnotation> findAnnotationsByShortName(Set<IAnnotation> result, IJavaElement element, String name, boolean checkParents) throws JavaModelException {
+		if(element instanceof IAnnotatable) {
+			IAnnotation[] annotations = ((IAnnotatable)element).getAnnotations();
+			for (IAnnotation annotation : annotations) {
+				String aName = annotation.getElementName();
+				int i = aName.lastIndexOf('.');
+				if(i>-1) {
+					aName = aName.substring(i+1);
+				}
+				if(aName.equals(name)) {
+					if(result==null) {
+						result = new HashSet<IAnnotation>();
+					}
+					result.add(annotation);
+					break;
+				}
+			}
+		}
+		if(checkParents) {
+			IJavaElement parent = element.getParent();
+			if(parent instanceof IAnnotatable) {
+				return findAnnotationsByShortName(result, parent, name, true);
+			}
+		}
+		return result;
+	}
+}
\ No newline at end of file

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/FileUtils.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,726 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.util;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.common.core.CommonCorePlugin;
+
+public class FileUtils {
+
+    public FileUtils() {}
+
+    public static String getEncoding(IFile f) {
+    	String encoding = null;
+    	if(f != null && f.exists() && f.isSynchronized(0)) try {
+    		encoding = f.getCharset();
+    	} catch (CoreException e) {
+    		CommonCorePlugin.getPluginLog().logError(e);
+    	}
+    	return encoding != null ? encoding : "8859_1"; //$NON-NLS-1$
+    }
+
+    public static String readFile(File f) {
+        if(!f.isFile()) return ""; //$NON-NLS-1$
+    	ReadBytes bs = readBytes(f);
+    	if(bs == null) return ""; //$NON-NLS-1$
+        String encoding = getEncoding(bs.bs);
+        if(encoding == null) return new String(bs.bs, 0, bs.length);
+        try {
+        	return new String(bs.bs, 0, bs.length, encoding);
+        } catch (UnsupportedEncodingException e) {
+        	return new String(bs.bs, 0, bs.length);
+        }
+    }
+
+    public static String readFileWithEncodingCheck(File f, String defaultEncoding) {
+        if(!f.isFile()) return ""; //$NON-NLS-1$
+    	ReadBytes bs = readBytes(f);
+    	if(bs == null) return ""; //$NON-NLS-1$
+        String encoding = getEncoding(bs.bs);
+        if(encoding == null) encoding = validateEncoding(defaultEncoding, null);
+        if(encoding == null) return new String(bs.bs, 0, bs.length);
+        try {
+        	return new String(bs.bs, 0, bs.length, encoding);
+        } catch (UnsupportedEncodingException e) {
+        	return new String(bs.bs, 0, bs.length);
+        }
+    }
+
+    public static ReadBytes readBytes(File f) {
+        if(!f.isFile()) return null;
+        BufferedInputStream br = null;
+        try {
+            FileInputStream fr = new FileInputStream(f);
+            br = new BufferedInputStream(fr);
+            int l = (int)f.length();
+            byte[] bs = new byte[l];
+            l = br.read(bs, 0, l);
+            br.close();
+            fr.close();
+            return new ReadBytes(bs, l);
+        } catch (IOException e) {
+        	return null;
+        } finally {
+        	if(br!=null) {
+        		try {
+					br.close();
+				} catch (IOException e) {
+					//ignore
+				}
+        	}
+        }
+    }
+    
+    static class ReadBytes {
+    	byte[] bs;
+    	int length;
+    	
+    	ReadBytes(byte[] bs, int l) {
+    		this.bs = bs;
+    		length = l;
+    	}
+    }
+
+    public static String readFile(File f, String encoding) {
+    	ReadBytes bs = readBytes(f);
+    	if(bs == null) return null;
+        try {
+            return new String(bs.bs, 0, bs.length, encoding);
+        } catch (UnsupportedEncodingException e) {
+        	return null;
+        }
+    }
+
+    public static boolean isTextFile(File f, int length) {
+        if(!f.isFile()) return false;
+        BufferedReader br = null;
+        try {
+            FileReader fr = new FileReader(f);
+            br = new BufferedReader(fr);
+            int l = (int)f.length();
+            if(l > length) l = length;
+            char[] cs = new char[l];
+            br.read(cs, 0, l);
+            br.close();
+            fr.close();
+            return isText(new String(cs));
+        } catch (IOException e) {
+            return false;
+        } finally {
+        	if(br!=null) {
+        		try {
+					br.close();
+				} catch (IOException e) {
+					// ignore
+				}
+        	}
+        }
+    }
+
+    public static boolean isText(String body) {
+        if(body == null) return false;
+        int l = body.length();
+        for (int i = 0; i < l; i++) {
+            char c = body.charAt(i);
+            if(((int)c) < 32 && c != '\n' && c != '\r' && c != 't') return false;
+        }
+        return true;
+    }
+
+    // FIXME Size of string buffer should be set to size of file by default 
+    // to avoid StringBuffer extension on each append
+    public static String readStream(InputStream is) {
+        StringBuffer sb = new StringBuffer(""); //$NON-NLS-1$
+        try {
+            byte[] b = new byte[4096];
+            while(true) {
+                int l = is.read(b, 0, b.length);
+                if(l < 0) break;
+                sb.append(new String(b, 0, l));
+            }
+        } catch (IOException e) {
+        	CommonCorePlugin.getPluginLog().logError(e);
+        } finally {
+            try {
+				is.close();
+			} catch (IOException e) {
+				// Ignore
+			}
+        }
+        return sb.toString();
+    }
+    
+    public static String readStream(IFile file) throws CoreException {
+		String content = null;
+		InputStream in = null;
+		try {
+			String charset = file.getCharset();
+			if(charset != null) {
+				charset = validateEncoding(charset, null);
+			}
+			in = file.getContents();
+			content = (charset == null) ? readStream(in) : readStream(in, charset);
+		} finally {
+			if(in!=null) {
+				try {
+					in.close();
+				} catch (IOException e) {
+					CommonCorePlugin.getPluginLog().logError(e);
+				}
+			}
+		}
+		return content;
+    }
+
+    public static String readStream(InputStream is, String charset) {
+        StringBuffer sb = new StringBuffer(""); //$NON-NLS-1$
+        try {
+            byte[] b = new byte[4096];
+            while(true) {
+                int l = is.read(b, 0, b.length);
+                if(l < 0) break;
+                sb.append(new String(b, 0, l, charset));
+            }
+        } catch (IOException e) {
+        	CommonCorePlugin.getPluginLog().logError(e);
+        } finally {
+            try {
+				is.close();
+			} catch (IOException e) {
+				// Ignore
+			}
+        }
+
+        return sb.toString();
+    }
+
+    public static void copyContent(IFile from, IFile to, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException {
+		InputStream is = null;
+		try {
+			is = from.getContents();
+			to.setContents(is, force, keepHistory, monitor);
+		} finally {
+			if(is!=null) {
+				try {
+					is.close();
+				} catch (IOException e) {
+					CommonCorePlugin.getPluginLog().logError(e);
+				}
+			}
+		}
+    }
+
+    public static boolean writeFile(File f, String value) {
+    	return writeFileWithEncodingCheck(f, value, null);
+    }
+
+    public static boolean writeFileWithEncodingCheck(File f, String value, String defaultEncoding) {
+    	if(value == null) return false;
+    	String encoding = getEncoding(value);
+    	if(encoding == null) encoding = validateEncoding(defaultEncoding, null);
+    	if(value.startsWith("<?xml")) { //$NON-NLS-1$
+    		String s = validateEncoding(encoding, "UTF-8"); //$NON-NLS-1$
+    		if(encoding == null) {
+    			encoding = s;
+    		} else if(s == null || !s.equals(encoding)) {
+    			return false;
+    		}
+    	}
+    	if(encoding == null) return writeFileDefault(f, value);
+    	return writeFile(f, value, encoding);
+    }
+
+    public static boolean writeFileDefault(File f, String value) {
+        try {
+            try {
+                if(f.isFile() && !isSameFile(f)) f.delete();
+                if(!f.exists()) f.createNewFile();
+            } catch (IOException e) {
+            	CommonCorePlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
+            } catch (SecurityException e) {
+            	CommonCorePlugin.getPluginLog().logError("Problem writing to file " + f, e); //$NON-NLS-1$
+            }
+            PrintWriter pw = new PrintWriter(new FileWriter(f));
+            pw.print(value);
+            pw.flush();
+            pw.close();
+            return true;
+        } catch (IOException e) {
+            return false;
+        }
+    }
+
+
+    public static boolean copyFile(File source, File dest, boolean mkdirs) {
+        return copyFile(source, dest, mkdirs, true);
+    }
+
+    public static boolean copyFile(File source, File dest) {
+        return copyFile(source, dest, false, true);
+    }
+
+    public static boolean copyFile(File source, File dest, boolean mkdirs, boolean overwrite) {
+        if (mkdirs) dest.getParentFile().mkdirs();
+        if(!source.isFile()) return false;
+        if(dest.isFile() && !isSameFile(dest)) dest.delete();
+        if(dest.isFile() && !overwrite) return false;
+        if(!dest.exists())
+			try {
+				dest.createNewFile();
+			} catch (IOException e1) {
+				CommonCorePlugin.getPluginLog().logError(e1);
+			}
+        InputStream is = null;
+        OutputStream os = null;
+        try {
+            is = new BufferedInputStream(new FileInputStream(source), 16 * 1024);
+            os = new BufferedOutputStream(new FileOutputStream(dest), 16 * 1024);
+            copyStream(is, os);
+            return true;
+        } catch (IOException e) {
+        	CommonCorePlugin.getPluginLog().logError(e);
+            return false;
+        } finally {
+            try {
+                if (is != null) is.close();
+            } catch (IOException e) {
+            	CommonCorePlugin.getPluginLog().logError(e);
+            }
+            try {
+                if (os != null) os.close();
+            } catch (IOException e) {
+            	CommonCorePlugin.getPluginLog().logError(e);
+            }
+        }
+    }
+
+    public static boolean updateFile(File source, File dest, boolean mkdirs) {
+        if(!source.isFile()) return false;
+        if(dest.isFile() && (dest.lastModified()<source.lastModified())) {
+            dest.delete();
+        }
+        return copyFile(source, dest, mkdirs);
+    }
+
+    public static void copyStream(InputStream is, OutputStream os) throws IOException {
+        byte[] buffer = new byte[1<<14];
+        while (true) {
+            int r = is.read(buffer);
+            if (r > 0) {
+                os.write(buffer, 0, r);
+            } else if (r == -1) break;
+        }
+        os.flush();
+    }
+
+	public static void clear(File f) {
+		if (f.isDirectory()) {
+			File[] fs = f.listFiles();
+			for (int i = 0; i < fs.length; i++) {
+				remove(fs[i]);
+			}
+		}
+	}
+
+	public static void remove(File f) {
+		if (f.isFile()) {
+			f.delete();
+		} else if (f.isDirectory()) {
+			File[] fs = f.listFiles();
+			for (int i = 0; i < fs.length; i++) {
+				remove(fs[i]);
+			}
+			f.delete();
+		}
+	}
+
+    public static boolean isSameFile(File f) {
+        if(!f.exists()) return false;
+        String fn = f.getName();
+        try {
+           String cn = f.getCanonicalFile().getName();
+           return fn.equals(cn);
+        } catch (IOException e) {
+            return false;
+        } 
+    }
+
+    public static void copyDir(File from, File to) {
+        copyDir(from, to, false);
+    }
+
+    public static void copyDir(File from, File to, boolean mkdirs) {
+        copyDir(from, to, mkdirs, true);
+    }
+
+    public static void copyDir(File from, File to, boolean mkdirs, boolean includeSubdirs) {
+        copyDir(from, to, includeSubdirs, mkdirs, false);
+    }
+
+    public static void copyDir(File from, boolean includeSubdirs, File to) {
+        copyDir(from, to, includeSubdirs, false, false);
+    }
+
+    public static void copyDir(File from, File to, boolean includeSubdirs, boolean mkdirs, boolean overwriteOnlyOlderFiles) {
+    	copyDir(from, to, includeSubdirs, mkdirs, overwriteOnlyOlderFiles, null);
+    }
+
+    public static void copyDir(File from, File to, boolean includeSubdirs, boolean mkdirs, boolean overwriteOnlyOlderFiles, FileFilter filter) {
+        if(filter != null && !filter.accept(from)) return;
+        if (mkdirs) to.mkdirs();
+        if(from == null || !from.isDirectory() || !to.isDirectory()) return;
+        File[] fs = from.listFiles();
+        if(fs == null) return;
+        for (int i = 0; i < fs.length; i++) {
+            String n = fs[i].getName();
+            File c = new File(to, n);
+            if (fs[i].isDirectory() && !includeSubdirs) continue;
+        	if(filter != null && !filter.accept(new File(from, n))) continue;
+
+            if(fs[i].isDirectory()) {
+                c.mkdirs();
+                copyDir(fs[i], c, includeSubdirs, mkdirs, overwriteOnlyOlderFiles, filter);
+            } else if (overwriteOnlyOlderFiles && fs[i].isFile() && c.isFile()) {
+                copyFile(fs[i], c, false, c.lastModified() < fs[i].lastModified());
+            } else {
+                copyFile(fs[i], c);
+            }
+        }
+    }
+
+    public static void unjar(File dest, String jar) throws IOException {
+        dest.mkdirs();
+        JarFile jf = new JarFile(jar);
+        try {
+            Enumeration es = jf.entries();
+            while(es.hasMoreElements()) {
+                JarEntry je = (JarEntry)es.nextElement();
+                String n = je.getName();
+                File f = new File(dest, n);
+                if (je.isDirectory()) {
+                    f.mkdirs();
+                } else {
+                    if (f.exists()) {
+                        f.delete();
+                    } else {
+                        f.getParentFile().mkdirs();
+                    }
+                    InputStream is = jf.getInputStream(je);
+                    FileOutputStream os = new FileOutputStream(f);
+                    try {
+                        copyStream(is, os);
+                    } finally {
+                        os.close();
+                    }
+                }
+                long time = je.getTime();
+                if (time != -1) f.setLastModified(time);
+            }
+        } finally {
+            jf.close();
+        }
+    }
+
+    public static void unjar(File dest, InputStream is) throws IOException {
+        dest.mkdirs();
+        JarInputStream jis = new JarInputStream(is);
+        try {
+            while(true) {
+                JarEntry je = jis.getNextJarEntry();
+                if (je == null) break;
+                String n = je.getName();
+                File f = new File(dest, n);
+                if (je.isDirectory()) {
+                    f.mkdirs();
+                } else {
+                    if (f.exists()) {
+                        f.delete();
+                    } else {
+                        f.getParentFile().mkdirs();
+                    }
+                    FileOutputStream os = new FileOutputStream(f);
+                    try {
+                        copyStream(jis, os);
+                    } finally {
+                        os.close();
+                    }
+                }
+                long time = je.getTime();
+                if (time != -1) f.setLastModified(time);
+            }
+        } finally {
+            jis.close();
+        }
+    }
+
+    public static void jar(File[] fs, String path) throws IOException {
+        jar(fs, path, null);
+    }
+
+    public static void jar(File[] fs, String path, Manifest mf) throws IOException  {
+        File f = new File(path);
+        FileOutputStream fos = new FileOutputStream(f);
+        JarOutputStream jos = mf == null ? new JarOutputStream(fos) : new JarOutputStream(fos, mf);
+        try {
+            for (int i = 0; i < fs.length; i++) add(fs[i].getParentFile(), fs[i], jos);
+        } finally {
+            jos.close();
+            fos.close();
+        }
+    }
+
+    public static void add(File root, File f, JarOutputStream jos) throws IOException {
+        int l = root.getAbsolutePath().length();
+        String en = f.getAbsolutePath().substring(l + 1).replace('\\', '/');
+        add(f, en, jos);
+    }
+
+    public static void add(File f, String name, JarOutputStream jos) throws IOException {
+        String en = name;
+        if(f.isDirectory()) en += "/"; //$NON-NLS-1$
+        JarEntry entry = (en.endsWith("/")) ? null : new JarEntry(en); //$NON-NLS-1$
+        if(f.isDirectory()) {
+            if("/".equals(en)) en = ""; //$NON-NLS-1$ //$NON-NLS-2$
+            File[] fs = f.listFiles();
+            if(fs != null) for (int i = 0; i < fs.length; i++)
+              add(fs[i], en + fs[i].getName(), jos);
+        } else {
+            try {
+                jos.putNextEntry(entry);
+            } catch (IOException e) {
+                return;
+            }
+            FileInputStream is = new FileInputStream(f);
+            byte[] b = new byte[1024];
+            int q = 0;
+            while((q = is.available()) > 0) {
+                if(q > 1024) q = 1024;
+                q = is.read(b, 0, q);
+                jos.write(b, 0, q);
+            }
+            is.close();
+        }
+        if(entry != null) jos.closeEntry();
+    }
+
+    public static void copy(InputStream f, OutputStream t) throws IOException {
+    	try {
+    		byte[] b = new byte[1024];
+    		int q = 0;
+    		while((q = f.read(b, 0, b.length)) > 0) t.write(b, 0, q);
+    	} finally {
+    		f.close();    
+    		t.close();
+    	}
+    }
+
+    public static void unzip(File dest, String jar) throws IOException {
+        dest.mkdirs();
+        ZipFile zf = new ZipFile(jar);
+        try {
+            Enumeration es = zf.entries();
+            while(es.hasMoreElements()) {
+                ZipEntry je = (ZipEntry)es.nextElement();
+                String n = je.getName();
+                File f = new File(dest, n);
+                if (je.isDirectory()) {
+                    f.mkdirs();
+                } else {
+                    if (f.exists()) {
+                        f.delete();
+                    } else {
+                        f.getParentFile().mkdirs();
+                    }
+                    InputStream is = zf.getInputStream(je);
+                    FileOutputStream os = new FileOutputStream(f);
+                    try {
+                        copyStream(is, os);
+                    } finally {
+                        os.close();
+                    }
+                }
+                long time = je.getTime();
+                if (time != -1) f.setLastModified(time);
+            }
+        } finally {
+            zf.close();
+        }
+    }
+
+    public static String fileURLToFilePath(String url) {
+        if(url == null) return null;
+        String resultUrl = url.replace('\\', '/');
+///        if(!url.startsWith("file:/")) return url;
+		if(!resultUrl.startsWith("file:")) return resultUrl; //$NON-NLS-1$
+        int iLast = resultUrl.lastIndexOf(':'), iFirst = resultUrl.indexOf(':');
+        return (iLast == iFirst) ? resultUrl.substring(5) : resultUrl.substring(iLast - 1);
+    }
+
+    //// Relative path
+
+	public static String getRelativePath(String rootpath, String path) {
+		String[] r = tokenizePath(rootpath);
+		String[] p = tokenizePath(path);
+		if(r.length == 0 || p.length == 0 || !r[0].equalsIgnoreCase(p[0])) return null;
+		int i = 0;
+		while(i < r.length && i < p.length && r[i].equalsIgnoreCase(p[i])) ++i;
+		StringBuffer sb = new StringBuffer();
+		for (int k = i; k < r.length; k++) sb.append("/.."); //$NON-NLS-1$
+		for (int k = i; k < p.length; k++) sb.append("/").append(p[k]); //$NON-NLS-1$
+		return sb.toString();
+	}
+
+	private static String[] tokenizePath(String path) {
+		String tokenizedPath = path.replace('\\', '/');
+		StringTokenizer st = new StringTokenizer(tokenizedPath, "/"); //$NON-NLS-1$
+		ArrayList l = new ArrayList();
+		while(st.hasMoreTokens()) {
+			String t = st.nextToken();
+			if(t.isEmpty() || ".".equals(t)) continue; //$NON-NLS-1$
+			if("..".equals(t)) { //$NON-NLS-1$
+				if(!l.isEmpty()) l.remove(l.size() - 1);
+				continue;
+			}
+			l.add(t);
+		}
+		return (String[])l.toArray(new String[l.size()]);
+	}
+
+    public static boolean writeFile(File f, String value, String encoding) {
+        try {
+            try {
+                if(f.isFile() && !isSameFile(f)) f.delete();
+                if(!f.exists()) {
+                	f.getParentFile().mkdirs();
+                	f.createNewFile();
+                }
+            } catch (IOException e) {
+            	CommonCorePlugin.getPluginLog().logError(e);
+            }
+            FileOutputStream fs = new FileOutputStream(f);
+            OutputStreamWriter osw = new OutputStreamWriter(fs, encoding);
+            PrintWriter pw = new PrintWriter(osw);
+            pw.print(value);
+            pw.flush();
+            pw.close();
+            return true;
+        } catch (FileNotFoundException e) {
+			//ignore
+            return writeFileDefault(f, value);
+        } catch (UnsupportedEncodingException e) {
+			//ignore
+            return writeFileDefault(f, value);        	
+        }
+    }
+    
+    
+    public static String getEncoding(String s) {
+    	if(s == null) return null;
+    	if(s.startsWith("<?xml")) { //$NON-NLS-1$
+    		int i = s.indexOf("encoding="); //$NON-NLS-1$
+    		if(i < 0) return null;
+    		i += "encoding=".length() + 1; //$NON-NLS-1$
+    		int j = s.indexOf('\"', i);
+    		if(j < 0) return null;
+    		return s.substring(i, j);
+    	}    	
+    	return null;
+    }
+    
+    static Set validEncodings = new HashSet();
+    static Set invalidEncodings = new HashSet();
+    
+    public static String validateEncoding(String encoding, String defaultEncoding) {
+    	if(encoding == null || encoding.equals(defaultEncoding)) return defaultEncoding;
+    	if(validEncodings.contains(encoding)) return encoding;
+    	if(invalidEncodings.contains(encoding)) return defaultEncoding;
+    	try {
+    		if(defaultEncoding != null && defaultEncoding.equals("UTF-16")) { //$NON-NLS-1$
+    			new String(XML_16, 0, XML_16.length, encoding);
+    		} else {
+    			new String(XML_8, 0, XML_8.length, encoding);
+    		}
+    		validEncodings.add(encoding);
+    		return encoding;
+    	} catch (UnsupportedEncodingException e) {
+    		invalidEncodings.add(encoding);
+    		return defaultEncoding;
+    	}
+    }
+    
+    static byte[] XML_8 = {(byte)'<',(byte)'?',(byte)'x',(byte)'m',(byte)'l'};
+    static byte[] XML_16 = {(byte)-2,(byte)-1,(byte)0,(byte)60,(byte)0,(byte)63,(byte)0,(byte)120,(byte)0,(byte)109,(byte)0,(byte)108};
+
+    public static String getEncoding(byte[] bs) {
+    	if(bs.length < 20) return null;
+    	if(startsWith(bs, XML_8)) {
+    		int i = getIndex(bs, (byte)'?', 5);
+    		if(i < 0) return "UTF-8"; //$NON-NLS-1$
+    		String encoding = getEncoding(new String(bs, 0, i));
+    		return validateEncoding(encoding, "UTF-8"); //$NON-NLS-1$
+    	} else if(startsWith(bs, XML_16)) {
+    		int i = getIndex(bs, (byte)'?', XML_16.length);
+    		if(i < 0) return "UTF-16"; //$NON-NLS-1$
+    		try {
+    			String encoding = getEncoding(new String(bs, 0, i, "UTF-16")); //$NON-NLS-1$
+        		return validateEncoding(encoding, "UTF-16"); //$NON-NLS-1$
+    		} catch (UnsupportedEncodingException e) {
+    			return null;
+    		}
+    	}
+    	return null;
+    }
+
+    static boolean startsWith(byte[] bs, byte[] prefix) {
+    	for (int i = 0; i < prefix.length; i++) {
+    		if(bs[i] != prefix[i]) return false;
+    	}
+    	return true;
+    }
+
+    static int getIndex(byte[] bs, byte b, int offset) {
+    	for (int i = offset; i < bs.length; i++) {
+    		if(bs[i] == b) return i;
+    	}
+    	return -1;
+    }
+}
\ No newline at end of file

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/HttpUtil.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/HttpUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.eclipse.core.net.proxy.IProxyData;
+import org.eclipse.core.net.proxy.IProxyService;
+import org.jboss.tools.common.core.CommonCorePlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * HTTP Utilities
+ * @author Alexey Kazakov
+ */
+public class HttpUtil {
+
+	private static IProxyService proxyService;
+
+	/**
+	 * @param url
+	 * @return InputStream of responce to http GET request. Use proxy settings from preferences.
+	 * @throws Exception
+	 */
+	public static InputStream getInputStreamFromUrlByGetMethod(String url) throws IOException {
+		InputStream is = executeGetMethod(url).getResponseBodyAsStream();
+		return is;
+	}
+
+	/**
+	 * @param url
+	 * @return InputStream of responce to http GET request. Use proxy settings from preferences.
+	 * @throws Exception
+	 */
+	public static InputStream getInputStreamFromUrlByGetMethod(String url, IProxyService proxyService) throws IOException {
+		InputStream is = executeGetMethod(url, proxyService).getResponseBodyAsStream();
+		return is;
+	}
+
+	/**
+	 * @param url
+	 * @param proxyService
+	 * @return Status code of responce to http GET request. Use given proxy settings.
+	 * @throws Exception
+	 */
+	public static int getStatusCodeFromUrlByGetMethod(String url, IProxyService proxyService) throws IOException {
+		int code = executeGetMethod(url, proxyService).getStatusCode();
+		return code;
+	}
+
+	/**
+	 * @param url
+	 * @return Status code of responce to http GET request. Use proxy settings from preferences.
+	 * @throws Exception
+	 */
+	public static int getStatusCodeFromUrlByGetMethod(String url) throws IOException {
+		int code = executeGetMethod(url).getStatusCode();
+		return code;
+	}
+
+	/**
+	 * @param url
+	 * @return InputStream of responce to http POST request. Use proxy settings from preferences.
+	 * @throws Exception
+	 */
+	public static InputStream getInputStreamFromUrlByPostMethod(String url) throws IOException {
+		InputStream is = executePostMethod(url).getResponseBodyAsStream();
+		return is;
+	}
+
+	/**
+	 * @param url
+	 * @param proxyService
+	 * @return Status code of responce to http POST request. Use given proxy settings.
+	 * @throws Exception
+	 */
+	public static int getStatusCodeFromUrlByPostMethod(String url, IProxyService proxyService) throws IOException {
+		int code = executePostMethod(url, proxyService).getStatusCode();
+		return code;
+	}
+
+	/**
+	 * @param url
+	 * @return Status code of responce to http POST request. Use proxy settings from preferences.
+	 * @throws Exception
+	 */
+	public static int getStatusCodeFromUrlByPostMethod(String url) throws IOException {
+		int code = executePostMethod(url).getStatusCode();
+		return code;
+	}
+
+	private static GetMethod executeGetMethod(String url) throws IOException {
+		IProxyService proxyService = getProxyService();
+		return executeGetMethod(url, proxyService);
+	}
+
+	private static PostMethod executePostMethod(String url) throws IOException {
+		IProxyService proxyService = getProxyService();
+		return executePostMethod(url, proxyService);
+	}
+
+	/**
+	 * @param url
+	 * @param proxyService
+	 * @return
+	 * @throws Exception
+	 */
+	public static GetMethod executeGetMethod(String url, IProxyService proxyService) throws IOException {
+		GetMethod httpGet = new GetMethod(url);
+		HttpClient httpClient = createHttpClient(url, proxyService);
+		httpClient.executeMethod(httpGet);
+		return httpGet;
+	}
+
+	private static PostMethod executePostMethod(String url, IProxyService proxyService) throws IOException {
+		PostMethod httpPost = new PostMethod(url);
+		HttpClient httpClient = createHttpClient(url, proxyService);
+	    httpClient.executeMethod(httpPost);
+		return httpPost;
+	}
+
+	/**
+	 * @param url
+	 * @return HttpClient with internet proxy settings;
+	 * @throws Exception
+	 */
+	public static HttpClient createHttpClient(String url) throws IOException {
+		return createHttpClient(url, getProxyService());
+	}
+
+	private static HttpClient createHttpClient(String url, IProxyService proxyService) throws IOException {
+		HttpClient httpClient = new HttpClient();
+
+		if(proxyService.isProxiesEnabled()) {
+			IProxyData[] proxyData = proxyService.getProxyData();
+			URL netUrl = new URL(url);
+			String hostName = netUrl.getHost();
+			String[] nonProxiedHosts = proxyService.getNonProxiedHosts();
+			boolean nonProxiedHost = false;
+			for (int i = 0; i < nonProxiedHosts.length; i++) {
+				String nonProxiedHostName = nonProxiedHosts[i];
+				if(nonProxiedHostName.equalsIgnoreCase(hostName)) {
+					nonProxiedHost = true;
+					break;
+				}
+			}
+			if(!nonProxiedHost) {
+				for (int i = 0; i < proxyData.length; i++) {
+					IProxyData proxy = proxyData[i];
+					if(IProxyData.HTTP_PROXY_TYPE.equals(proxy.getType())) {
+						String proxyHostName = proxy.getHost();
+						if(proxyHostName==null) {
+							break;
+						}
+						int portNumber = proxy.getPort();
+						if(portNumber==-1) {
+							portNumber = 80;
+						}
+						httpClient.getHostConfiguration().setProxy(proxyHostName, portNumber);
+						if(proxy.isRequiresAuthentication()) {
+						    String userName = proxy.getUserId();
+						    if(userName!=null) {
+							    String password = proxy.getPassword();
+							    httpClient.getState().setProxyCredentials(new AuthScope(null, AuthScope.ANY_PORT, null, AuthScope.ANY_SCHEME), new UsernamePasswordCredentials(userName, password));
+						    }
+						}
+						break; // Use HTTP proxy only.
+					}
+				}
+			}
+		}
+
+	    httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(30000);
+
+	    return httpClient;
+	}
+
+	private static IProxyService getProxyService() {
+		if(proxyService==null) {
+			BundleContext bundleContext = CommonCorePlugin.getInstance().getBundle().getBundleContext();
+			ServiceReference serviceReference = bundleContext.getServiceReference(IProxyService.class.getName());
+			proxyService = (IProxyService)bundleContext.getService(serviceReference);
+		}
+		return proxyService;
+	}
+}
\ No newline at end of file

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/StringUtil.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,40 @@
+/******************************************************************************* 
+ * Copyright (c) 2011 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is made available under the terms of the 
+ * Eclipse Public License v1.0 which accompanies this distribution, 
+ * and is available at http://www.eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/ 
+
+package org.jboss.tools.common.util;
+
+/**
+ * Miscellaneous String utility functions
+ * 
+ * @author Victor V. Rubezhny
+ */
+public class StringUtil {
+/**
+	 * Cuts of the starting and ending quotes from a given text value
+	 * 
+	 * @param Quoted text value
+	 * @return Non-quoted text value 
+	 */
+	public static String trimQuotes(String value) {
+		if(value == null)
+			return null;
+
+		if(value.startsWith("'") || value.startsWith("\"")) {  //$NON-NLS-1$ //$NON-NLS-2$
+			value = value.substring(1);
+		} 
+		
+		if(value.endsWith("'") || value.endsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
+			value = value.substring(0, value.length() - 1);
+		}
+		return value;
+	}
+
+}

Copied: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java (from rev 43123, trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/TypeResolutionCache.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/TypeResolutionCache.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -0,0 +1,226 @@
+/*******************************************************************************
+  * Copyright (c) 2011 - 2012 Red Hat, Inc.
+  * Distributed under license by Red Hat, Inc. All rights reserved.
+  * This program is made available under the terms of the
+  * Eclipse Public License v1.0 which accompanies this distribution,
+  * and is available at http://www.eclipse.org/legal/epl-v10.html
+  *
+  * Contributor:
+  *     Red Hat, Inc. - initial API and implementation
+  ******************************************************************************/
+package org.jboss.tools.common.util;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IImportDeclaration;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.core.CommonCorePlugin;
+
+public class TypeResolutionCache {	
+	private static TypeResolutionCache instance = new TypeResolutionCache();
+
+	public static TypeResolutionCache getInstance() {
+		return instance;
+	}
+
+	static class Resolved {
+		IType type;
+		Map<String, String> types = new Hashtable<String, String>();
+		List<String> classImports = new ArrayList<String>();
+		List<String> packageImports = new ArrayList<String>();
+		Resolved(IType type) {
+			this.type = type;
+			readImports();
+		}
+		
+		void setType(IType type) {
+			this.type = type;
+			types.clear();
+
+			readImports();
+		}
+	
+		void readImports() {
+			ICompilationUnit unit = type.getCompilationUnit();
+			if(unit == null) return;
+			IImportDeclaration[] ds = null;
+			try {
+				ds = unit.getImports();
+			} catch (JavaModelException e) {
+				CommonCorePlugin.getDefault().logError(e);
+				ds = new IImportDeclaration[0];
+			}
+			IResource r = unit.getResource();
+			
+			if(r instanceof IFile && r.exists()) {
+				List<String> newClassImports = new ArrayList<String>();
+				List<String> newPackageImports = new ArrayList<String>();
+				//add local package
+				newPackageImports.add(type.getPackageFragment().getElementName() + "."); //$NON-NLS-1$
+				for (IImportDeclaration d: ds) {
+					String q = d.getElementName();
+					if(q.endsWith(".*")) { //$NON-NLS-1$
+						newPackageImports.add( q = q.substring(0, q.length() - 1));
+					} else {
+						newClassImports.add(q);
+					}
+				}
+				classImports = newClassImports;
+				packageImports = newPackageImports;
+			}
+		}
+		
+		public String resolveInImports(String typeName) {
+			if(typeName.indexOf(".") >= 0) { //$NON-NLS-1$
+				try {
+					IType q = EclipseJavaUtil.findType(type.getJavaProject(), typeName);
+					if(q != null) {
+						types.put(typeName, typeName);
+						return typeName;
+					}
+				} catch (JavaModelException e) {
+					CommonCorePlugin.getDefault().logError(e);
+				}
+				//too difficult
+				return null; 
+			}
+			for (String imp: classImports) {
+				if(imp.endsWith("." + typeName)) { //$NON-NLS-1$
+					types.put(typeName, imp);
+					return imp;
+				}
+			}
+			for (String imp: packageImports) {
+				String result = imp + typeName;
+				try {
+					IType q = EclipseJavaUtil.findType(type.getJavaProject(), result);
+					if(q != null) {
+						types.put(typeName, result);
+						return result;
+					}
+				} catch (JavaModelException e) {
+					CommonCorePlugin.getDefault().logError(e);
+				}
+			}
+			String pr = "java.lang." + typeName; //$NON-NLS-1$
+			if(primitive.contains(pr)) {
+				types.put(typeName, pr);
+				return pr;
+			}
+
+			if(type.getTypeParameter(typeName).exists()) {
+				types.put(typeName, typeName);
+				return typeName;
+			}
+			return null;
+		}
+	}
+
+	static Set<String> primitive = new HashSet<String>();
+	static {
+		primitive.add("void"); //$NON-NLS-1$
+		primitive.add("int"); //$NON-NLS-1$
+		primitive.add("char"); //$NON-NLS-1$
+		primitive.add("boolean"); //$NON-NLS-1$
+		primitive.add("long"); //$NON-NLS-1$
+		primitive.add("short"); //$NON-NLS-1$
+		primitive.add("double"); //$NON-NLS-1$
+		primitive.add("float"); //$NON-NLS-1$
+		primitive.add("java.lang.Object"); //$NON-NLS-1$
+		primitive.add("java.lang.Number"); //$NON-NLS-1$
+		primitive.add("java.lang.Integer"); //$NON-NLS-1$
+		primitive.add("java.lang.Character"); //$NON-NLS-1$
+		primitive.add("java.lang.Boolean"); //$NON-NLS-1$
+		primitive.add("java.lang.Long"); //$NON-NLS-1$
+		primitive.add("java.lang.Short"); //$NON-NLS-1$
+		primitive.add("java.lang.Double"); //$NON-NLS-1$
+		primitive.add("java.lang.Float"); //$NON-NLS-1$
+		primitive.add("java.lang.String"); //$NON-NLS-1$
+		primitive.add("java.lang.StringBuffer"); //$NON-NLS-1$
+		primitive.add("java.lang.Class"); //$NON-NLS-1$
+		primitive.add("java.lang.Deprecated"); //$NON-NLS-1$
+		primitive.add("java.lang.SuppressWarnings"); //$NON-NLS-1$
+		primitive.add("java.lang.Throwable"); //$NON-NLS-1$
+		primitive.add("java.lang.Exception"); //$NON-NLS-1$
+		primitive.add("java.lang.RuntimeException"); //$NON-NLS-1$
+		primitive.add("java.lang.Override"); //$NON-NLS-1$
+	}
+	static String NULL = ";;;"; //$NON-NLS-1$
+	Map<String,Resolved> resolved = new Hashtable<String, Resolved>();
+
+	private TypeResolutionCache() {}
+	
+	public String resolveType(IType type, String typeName) {
+		if(type == null) return null;
+		if(type.isBinary() || typeName == null || primitive.contains(typeName)) return typeName;
+
+		String n = getKey(type);
+		Resolved r = resolved.get(n);
+		if(r == null) {
+			r = new Resolved(type);
+			resolved.put(n, r);
+		} else if(r.type != type) {
+			r.setType(type);
+		}
+		
+		String result = r.types.get(typeName);		
+		if(result != null) {
+			return (result == NULL) ? null : result;
+		}
+
+		result = r.resolveInImports(typeName);
+		if(result != null) {
+			return result;
+		}
+		
+		result = __resolveType(type, typeName);
+		
+//		System.out.println(typeName + "---" + result);
+		
+		r.types.put(typeName, result == null ? NULL : result);
+		return result;
+
+	}
+	
+	public void clean() {
+		resolved = new Hashtable<String, Resolved>();
+	}
+
+	private String __resolveType(IType type, String typeName) {
+		try	{
+			String resolvedArray[][] = type.resolveType(typeName);
+//			resolvedArray == null for primitive types
+			if(resolvedArray == null) return typeName;
+			typeName = ""; //$NON-NLS-1$
+			for (int i = 0; i < resolvedArray[0].length; i++) 
+				typeName += (!"".equals(typeName) ? "." : "") + resolvedArray[0][i];  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			return typeName;
+		} catch (JavaModelException e) {
+			CommonCorePlugin.getPluginLog().logError(e);
+		} catch (IllegalArgumentException e) {
+			CommonCorePlugin.getPluginLog().logError(e);
+		}
+		return null;
+	}
+	
+	private String getKey(IType type) {
+		String n = type.getFullyQualifiedName();
+		IJavaProject jp = type.getJavaProject();
+		if(jp == null) return n;
+		IProject p = jp.getProject();
+		if(p == null || !p.isAccessible()) return n;
+		return p.getName() + ":" + n; //$NON-NLS-1$
+	}
+
+}
\ No newline at end of file

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/web/WebUtils.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/web/WebUtils.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -30,7 +30,7 @@
 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.ProjectFacetsManager;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 
 public class WebUtils {
 
@@ -87,7 +87,7 @@
 		try {
 			facetedProject = ProjectFacetsManager.create(project);
 		} catch (CoreException e) {
-			CommonPlugin.getDefault().logError(e);
+			CommonCorePlugin.getDefault().logError(e);
 		}
 		if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
 			IVirtualComponent component = ComponentCore.createComponent(project);
@@ -137,9 +137,9 @@
 				// Not available in this WTP version, let's ignore it
 				WTP_3_3_0 = true;
 			} catch (IllegalArgumentException e) {
-				CommonPlugin.getDefault().logError(e);
+				CommonCorePlugin.getDefault().logError(e);
 			} catch (IllegalAccessException e) {
-				CommonPlugin.getDefault().logError(e);
+				CommonCorePlugin.getDefault().logError(e);
 			} catch (InvocationTargetException e) {
 				// Not available in this WTP version, let's ignore it
 				WTP_3_3_0 = true;

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/DtdResolver.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -23,7 +23,7 @@
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.jboss.tools.common.util.HttpUtil;
 import org.osgi.framework.Bundle;
 import org.xml.sax.EntityResolver;
@@ -72,7 +72,7 @@
         if(location == null) {
         	if(systemId != null && !unfound.contains(systemId)) {
         		unfound.add(systemId);
-//            	CommonPlugin.getPluginLog().logInfo("Cannot find locally: "  //$NON-NLS-1$
+//            	CommonCorePlugin.getPluginLog().logInfo("Cannot find locally: "  //$NON-NLS-1$
 //            			+ "Public ID " + publicId //$NON-NLS-1$
 //            			+ " System ID " + systemId); //$NON-NLS-1$
         	}
@@ -87,7 +87,7 @@
 	            	return url.openStream();
 	            }
             } catch(FileNotFoundException e) {
-    			CommonPlugin.getPluginLog().logError(e);
+    			CommonCorePlugin.getPluginLog().logError(e);
             }
         }
 
@@ -109,9 +109,9 @@
             		is = HttpUtil.getInputStreamFromUrlByGetMethod(systemId);
             	}
     		} catch (MalformedURLException e) {
-      			CommonPlugin.getPluginLog().logError(e);
+      			CommonCorePlugin.getPluginLog().logError(e);
             } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError(e);
+            	CommonCorePlugin.getPluginLog().logError(e);
 			}
 		}
         return is;

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/SAXValidator.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -22,16 +22,15 @@
 import org.apache.xerces.util.XMLCatalogResolver;
 import org.apache.xerces.xni.XMLResourceIdentifier;
 import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.Messages;
-import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.common.core.CommonCorePlugin;
+import org.jboss.tools.common.core.Messages;
+import org.jboss.tools.common.util.FileUtils;
 import org.osgi.framework.Bundle;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXNotRecognizedException;
 import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
 
 /**
  * @author eskimo(dgolovin at exadel.com)
@@ -73,9 +72,9 @@
         try {
             parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
         } catch (SAXNotRecognizedException e1) {
-        	CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
+        	CommonCorePlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
         } catch (SAXNotSupportedException e1) {
-        	CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
+        	CommonCorePlugin.getPluginLog().logError( e1.getMessage()+"", e1); //$NON-NLS-1$
 		}
         
         parserInstance.setContentHandler(handler);
@@ -94,7 +93,7 @@
             parser.setFeature(name, value);
         } catch (SAXException e) {
         	// TODO - Move to NLS bundle
-        	CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
+        	CommonCorePlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 
@@ -108,7 +107,7 @@
         try {
             parser.setProperty(name, value);
         } catch (SAXException e) {
-        	CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
+        	CommonCorePlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }    
     
@@ -159,7 +158,7 @@
      */
     String getCatalog() {
 
-    	Bundle b = Platform.getBundle(CommonPlugin.PLUGIN_ID);
+    	Bundle b = Platform.getBundle(CommonCorePlugin.PLUGIN_ID);
     	String location = Platform.getStateLocation(b).toString().replace('\\', '/');
     	if(!location.endsWith("/")) { //$NON-NLS-1$
 			location += "/"; //$NON-NLS-1$
@@ -174,20 +173,20 @@
 			}
         	urlString += "schemas"; //$NON-NLS-1$
     	} catch (IOException e) {
-    		CommonPlugin.getPluginLog().logError(e);
+    		CommonCorePlugin.getPluginLog().logError(e);
     	}
     	File f1 = new File(url.getFile() + "/schemas/catalog.xml"); //$NON-NLS-1$
     	File f2 = new File(location + "schemas/catalog.xml"); //$NON-NLS-1$
     	if(f2.exists()) {
     		return "file:///" + location + "schemas/catalog.xml"; //$NON-NLS-1$ //$NON-NLS-2$
     	}
-    	FileUtil.copyDir(f1.getParentFile(), f2.getParentFile(), true);
-    	String text = FileUtil.readFile(f2);
+    	FileUtils.copyDir(f1.getParentFile(), f2.getParentFile(), true);
+    	String text = FileUtils.readFile(f2);
     	while(text.indexOf("%install%") >= 0) { //$NON-NLS-1$
     		int i = text.indexOf("%install%"); //$NON-NLS-1$
     		text = text.substring(0, i) + urlString + text.substring(i + 9);
     	}
-    	FileUtil.writeFile(f2, text);
+    	FileUtils.writeFile(f2, text);
     	return "file:///" + location + "schemas/catalog.xml"; //$NON-NLS-1$ //$NON-NLS-2$
     }
 } 

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolver.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -10,7 +10,7 @@
 import java.util.Properties;
 
 import org.eclipse.core.runtime.FileLocator;
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -104,7 +104,7 @@
 			source = new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes())); //$NON-NLS-1$
 		}
 		if(source == null) {
-			CommonPlugin.getDefault().logError("WARNING: Cannot resolve entity " + systemId); //$NON-NLS-1$
+			CommonCorePlugin.getDefault().logError("WARNING: Cannot resolve entity " + systemId); //$NON-NLS-1$
 		}
 		// TODO study if we can always return non-null value. 
         return source;

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLEntityResolverImpl.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -19,7 +19,7 @@
 import org.apache.xerces.xni.parser.XMLEntityResolver;
 import org.apache.xerces.xni.parser.XMLInputSource;
 
-import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.core.CommonCorePlugin;
 
 import org.xml.sax.SAXException;
 
@@ -52,7 +52,7 @@
                 result = new XMLInputSource(rid.getPublicId(), systemId, rid.getBaseSystemId(), is, null);
             }
         } catch (SAXException e) {
-        	CommonPlugin.getPluginLog().logError( "Exception publicId=" + publicId + " systemId=" + systemId + " exception=" + e.getClass().getName() + ":" + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+        	CommonCorePlugin.getPluginLog().logError( "Exception publicId=" + publicId + " systemId=" + systemId + " exception=" + e.getClass().getName() + ":" + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
         } 
 
         return result;

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java	2012-08-21 09:59:44 UTC (rev 43123)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/xml/XMLUtilities.java	2012-08-25 06:08:31 UTC (rev 43232)
@@ -30,8 +30,8 @@
 import org.apache.xml.serialize.Method;
 import org.apache.xml.serialize.OutputFormat;
 import org.apache.xml.serialize.XMLSerializer;
-import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.Messages;
+import org.jboss.tools.common.core.CommonCorePlugin;
+import org.jboss.tools.common.core.Messages;
 import org.w3c.dom.Comment;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.DOMImplementation;
@@ -136,7 +136,7 @@
 			d.setErrorHandler(new ErrorHandlerImpl());
 			return d;
 		} catch (ParserConfigurationException e) {
-			CommonPlugin.getPluginLog().logError(e);
+			CommonCorePlugin.getPluginLog().logError(e);
 		}
 		return null;
 	}
@@ -196,18 +196,18 @@
         	org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(fr);
         	return getElement(inSource, resolver);
         } catch (FileNotFoundException e) {
-        	CommonPlugin.getPluginLog().logError(e);
+        	CommonCorePlugin.getPluginLog().logError(e);
 		} catch (IOException e) {
-        	CommonPlugin.getPluginLog().logError(e);
+        	CommonCorePlugin.getPluginLog().logError(e);
 		} catch (SAXException e) {
-        	CommonPlugin.getPluginLog().logError(e);
+        	CommonCorePlugin.getPluginLog().logError(e);
 		} finally {
             try {
                 if (fr != null) {
 					fr.close();
 				}
             } catch (IOException e) {
-            	CommonPlugin.getPluginLog().logError(e);
+            	CommonCorePlugin.getPluginLog().logError(e);
             }
         }
 		return null;

Modified: trunk/common/plugins/pom.xml
===================================================================
--- trunk/common/plugins/pom.xml	2012-08-25 00:27:50 UTC (rev 43231)
+++ trunk/common/plugins/pom.xml	2012-08-25 06:08:31 UTC (rev 43232)
@@ -12,6 +12,7 @@
 	</parent>
 	<packaging>pom</packaging>
 	<modules>
+                <module>org.jboss.tools.common.core</module>
 		<module>org.jboss.tools.common</module>
 		<module>org.jboss.tools.common.el.core</module>
 		<module>org.jboss.tools.common.el.ui</module>



More information about the jbosstools-commits mailing list