org.eclipse.update.core_3.2.500.v20110330

16:48:44.797 INFO  jd.cli.Main - Decompiling org.eclipse.update.core_3.2.500.v20110330.jar
package org.eclipse.update.configuration;

import java.util.Date;
import org.eclipse.core.runtime.IAdaptable;

/**
 * @deprecated
 */
public abstract interface IActivity
  extends IAdaptable
{
  public static final int ACTION_FEATURE_INSTALL = 1;
  public static final int ACTION_FEATURE_REMOVE = 2;
  public static final int ACTION_SITE_INSTALL = 3;
  public static final int ACTION_SITE_REMOVE = 4;
  public static final int ACTION_UNCONFIGURE = 5;
  public static final int ACTION_CONFIGURE = 6;
  public static final int ACTION_REVERT = 7;
  public static final int ACTION_RECONCILIATION = 8;
  public static final int ACTION_ADD_PRESERVED = 9;
  public static final int STATUS_OK = 0;
  public static final int STATUS_NOK = 1;
  
  public abstract int getAction();
  
  public abstract String getLabel();
  
  public abstract Date getDate();
  
  public abstract int getStatus();
  
  public abstract IInstallConfiguration getInstallConfiguration();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IActivity
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.update.core.IFeature;
import org.eclipse.update.core.IFeatureReference;
import org.eclipse.update.core.ISite;
import org.eclipse.update.core.IVerificationListener;

/**
 * @deprecated
 */
public abstract interface IConfiguredSite
  extends IAdaptable
{
  public abstract ISite getSite();
  
  public abstract IStatus verifyUpdatableStatus();
  
  public abstract boolean isUpdatable();
  
  public abstract IFeatureReference install(IFeature paramIFeature, IVerificationListener paramIVerificationListener, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract IFeatureReference install(IFeature paramIFeature, IFeatureReference[] paramArrayOfIFeatureReference, IVerificationListener paramIVerificationListener, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void remove(IFeature paramIFeature, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract IStatus getBrokenStatus(IFeature paramIFeature);
  
  public abstract boolean isConfigured(IFeature paramIFeature);
  
  public abstract void configure(IFeature paramIFeature)
    throws CoreException;
  
  public abstract boolean unconfigure(IFeature paramIFeature)
    throws CoreException;
  
  public abstract IFeatureReference[] getConfiguredFeatures();
  
  public abstract IFeatureReference[] getFeatureReferences();
  
  public abstract IInstallConfiguration getInstallConfiguration();
  
  public abstract void addConfiguredSiteChangedListener(IConfiguredSiteChangedListener paramIConfiguredSiteChangedListener);
  
  public abstract void removeConfiguredSiteChangedListener(IConfiguredSiteChangedListener paramIConfiguredSiteChangedListener);
  
  public abstract boolean isExtensionSite();
  
  public abstract boolean isProductSite();
  
  /**
   * @deprecated
   */
  public abstract boolean isPrivateSite();
  
  public abstract boolean isNativelyLinked()
    throws CoreException;
  
  public abstract void setEnabled(boolean paramBoolean);
  
  public abstract boolean isEnabled();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IConfiguredSite
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import org.eclipse.update.core.IFeature;

/**
 * @deprecated
 */
public abstract interface IConfiguredSiteChangedListener
{
  public abstract void featureInstalled(IFeature paramIFeature);
  
  public abstract void featureRemoved(IFeature paramIFeature);
  
  public abstract void featureConfigured(IFeature paramIFeature);
  
  public abstract void featureUnconfigured(IFeature paramIFeature);
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IConfiguredSiteChangedListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import java.io.File;
import java.util.Date;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;

/**
 * @deprecated
 */
public abstract interface IInstallConfiguration
  extends IAdaptable
{
  public abstract boolean isCurrent();
  
  public abstract IConfiguredSite[] getConfiguredSites();
  
  public abstract IConfiguredSite createConfiguredSite(File paramFile)
    throws CoreException;
  
  public abstract IConfiguredSite createLinkedConfiguredSite(File paramFile)
    throws CoreException;
  
  public abstract void addConfiguredSite(IConfiguredSite paramIConfiguredSite);
  
  public abstract void removeConfiguredSite(IConfiguredSite paramIConfiguredSite);
  
  public abstract void addInstallConfigurationChangedListener(IInstallConfigurationChangedListener paramIInstallConfigurationChangedListener);
  
  public abstract void removeInstallConfigurationChangedListener(IInstallConfigurationChangedListener paramIInstallConfigurationChangedListener);
  
  public abstract IActivity[] getActivities();
  
  public abstract Date getCreationDate();
  
  public abstract String getLabel();
  
  public abstract void setLabel(String paramString);
  
  public abstract long getTimeline();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IInstallConfiguration
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

/**
 * @deprecated
 */
public abstract interface IInstallConfigurationChangedListener
{
  public abstract void installSiteAdded(IConfiguredSite paramIConfiguredSite);
  
  public abstract void installSiteRemoved(IConfiguredSite paramIConfiguredSite);
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IInstallConfigurationChangedListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

/**
 * @deprecated
 */
public abstract interface IInstallDeltaHandler
{
  public abstract void init(ISessionDelta[] paramArrayOfISessionDelta);
  
  public abstract void open();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IInstallDeltaHandler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.update.core.IFeature;

/**
 * @deprecated
 */
public abstract interface ILocalSite
  extends IAdaptable
{
  public abstract IInstallConfiguration getCurrentConfiguration();
  
  public abstract IInstallConfiguration[] getConfigurationHistory();
  
  public abstract void revertTo(IInstallConfiguration paramIInstallConfiguration, IProgressMonitor paramIProgressMonitor, IProblemHandler paramIProblemHandler)
    throws CoreException;
  
  public abstract IInstallConfiguration cloneCurrentConfiguration()
    throws CoreException;
  
  public abstract void addConfiguration(IInstallConfiguration paramIInstallConfiguration);
  
  public abstract boolean save()
    throws CoreException;
  
  public abstract int getMaximumHistoryCount();
  
  public abstract void setMaximumHistoryCount(int paramInt);
  
  public abstract void addLocalSiteChangedListener(ILocalSiteChangedListener paramILocalSiteChangedListener);
  
  public abstract void removeLocalSiteChangedListener(ILocalSiteChangedListener paramILocalSiteChangedListener);
  
  public abstract IInstallConfiguration addToPreservedConfigurations(IInstallConfiguration paramIInstallConfiguration)
    throws CoreException;
  
  public abstract void removeFromPreservedConfigurations(IInstallConfiguration paramIInstallConfiguration);
  
  public abstract IInstallConfiguration[] getPreservedConfigurations();
  
  public abstract IStatus getFeatureStatus(IFeature paramIFeature)
    throws CoreException;
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.ILocalSite
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

/**
 * @deprecated
 */
public abstract interface ILocalSiteChangedListener
{
  public abstract void currentInstallConfigurationChanged(IInstallConfiguration paramIInstallConfiguration);
  
  public abstract void installConfigurationRemoved(IInstallConfiguration paramIInstallConfiguration);
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.ILocalSiteChangedListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

/**
 * @deprecated
 */
public abstract interface ILocalSystemInfoListener
{
  public abstract void systemInfoChanged(IVolume paramIVolume, int paramInt);
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.ILocalSystemInfoListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

/**
 * @deprecated
 */
public abstract interface IProblemHandler
{
  public abstract boolean reportProblem(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IProblemHandler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import java.util.Date;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.update.core.IFeatureReference;

/**
 * @deprecated
 */
public abstract interface ISessionDelta
  extends IAdaptable
{
  public static final int ENABLE = 1;
  public static final int DISABLE = 2;
  
  public abstract IFeatureReference[] getFeatureReferences();
  
  public abstract Date getDate();
  
  public abstract int getType();
  
  public abstract void process(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void process(IFeatureReference[] paramArrayOfIFeatureReference, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract void delete();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.ISessionDelta
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import java.io.File;
import org.eclipse.core.runtime.IAdaptable;

/**
 * @deprecated
 */
public abstract interface IVolume
  extends IAdaptable
{
  public abstract long getFreeSpace();
  
  public abstract String getLabel();
  
  public abstract int getType();
  
  public abstract File getFile();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.IVolume
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.configuration;

import java.io.File;
import java.util.ArrayList;
import org.eclipse.update.internal.core.UpdateCore;
import org.eclipse.update.internal.core.Volume;

/**
 * @deprecated
 */
public class LocalSystemInfo
{
  public static final long SIZE_UNKNOWN = -1L;
  public static final int VOLUME_UNKNOWN = -1;
  public static final int VOLUME_INVALID_PATH = -2;
  public static final int VOLUME_REMOVABLE = 1;
  public static final int VOLUME_FIXED = 2;
  public static final int VOLUME_REMOTE = 3;
  public static final int VOLUME_CDROM = 4;
  public static final int VOLUME_RAMDISK = 5;
  public static final int VOLUME_FLOPPY_5 = 6;
  public static final int VOLUME_FLOPPY_3 = 7;
  public static final int VOLUME_ADDED = 0;
  public static final int VOLUME_REMOVED = 1;
  public static final int VOLUME_CHANGED = 2;
  private static ArrayList listeners = new ArrayList();
  private static boolean hasNatives = false;
  
  static
  {
    try
    {
      System.loadLibrary("update");
      hasNatives = true;
    }
    catch (UnsatisfiedLinkError localUnsatisfiedLinkError)
    {
      UpdateCore.warn("Unable to load native library 'update'.");
      hasNatives = false;
    }
  }
  
  public static long getFreeSpace(File path)
  {
    if (hasNatives) {
      try
      {
        long bytes = nativeGetFreeSpace(path);
        return bytes != 0L ? bytes / 1024L : 0L;
      }
      catch (UnsatisfiedLinkError localUnsatisfiedLinkError) {}
    }
    return -1L;
  }
  
  public static IVolume[] getVolumes()
  {
    String[] mountPoints = listMountPoints();
    Volume[] vol = new Volume[0];
    if (mountPoints != null)
    {
      vol = new Volume[mountPoints.length];
      for (int i = 0; i < mountPoints.length; i++)
      {
        File root = new File(mountPoints[i]);
        String label = getLabel(root);
        int type = getType(root);
        long size = getFreeSpace(root);
        vol[i] = new Volume(root, label, type, size);
        vol[i].markReadOnly();
      }
    }
    else
    {
      UpdateCore.warn("Unable to find mount points");
      
      File[] roots = File.listRoots();
      if (roots.length == 1)
      {
        File root = roots[0];
        roots = root.listFiles();
      }
      vol = new Volume[roots.length];
      for (int i = 0; i < roots.length; i++)
      {
        vol[i] = new Volume(roots[i], null, -1, -1L);
        vol[i].markReadOnly();
      }
    }
    return vol;
  }
  
  public static void addInfoListener(ILocalSystemInfoListener listener)
  {
    if (!listeners.contains(listener)) {
      listeners.add(listener);
    }
  }
  
  public static void removeInfoListener(ILocalSystemInfoListener listener)
  {
    listeners.remove(listener);
  }
  
  public static void fireSystemInfoChanged(IVolume volume, int changeType)
  {
    for (int i = 0; i < listeners.size(); i++) {
      ((ILocalSystemInfoListener)listeners.get(i)).systemInfoChanged(volume, changeType);
    }
  }
  
  private static String getLabel(File path)
  {
    if (hasNatives) {
      try
      {
        return nativeGetLabel(path);
      }
      catch (UnsatisfiedLinkError localUnsatisfiedLinkError) {}
    }
    return null;
  }
  
  private static int getType(File path)
  {
    if (hasNatives) {
      try
      {
        return nativeGetType(path);
      }
      catch (UnsatisfiedLinkError localUnsatisfiedLinkError) {}
    }
    return -1;
  }
  
  private static String[] listMountPoints()
  {
    if (hasNatives) {
      try
      {
        return nativeListMountPoints();
      }
      catch (UnsatisfiedLinkError localUnsatisfiedLinkError) {}
    }
    return null;
  }
  
  private static native long nativeGetFreeSpace(File paramFile);
  
  private static native String nativeGetLabel(File paramFile);
  
  private static native int nativeGetType(File paramFile);
  
  private static native String[] nativeListMountPoints();
}

/* Location:
 * Qualified Name:     org.eclipse.update.configuration.LocalSystemInfo
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import java.net.URL;
import org.eclipse.update.core.model.ArchiveReferenceModel;

/**
 * @deprecated
 */
public class ArchiveReference
  extends ArchiveReferenceModel
  implements IArchiveReference
{
  public String toString()
  {
    String result = "IArchiveReference: ";
    result = 
      result + (
      getPath() == null ? 
      getURL().toExternalForm() : 
      new StringBuffer(String.valueOf(getPath())).append(" : ").append(getURL().toExternalForm()).toString());
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.ArchiveReference
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.update.core.model.FeatureModel;
import org.eclipse.update.core.model.FeatureModelFactory;
import org.eclipse.update.core.model.ImportModel;
import org.eclipse.update.core.model.IncludedFeatureReferenceModel;
import org.eclipse.update.core.model.InstallHandlerEntryModel;
import org.eclipse.update.core.model.NonPluginEntryModel;
import org.eclipse.update.core.model.PluginEntryModel;
import org.eclipse.update.core.model.URLEntryModel;

/**
 * @deprecated
 */
public abstract class BaseFeatureFactory
  extends FeatureModelFactory
  implements IFeatureFactory
{
  /**
   * @deprecated
   */
  public IFeature createFeature(URL url, ISite site)
    throws CoreException
  {
    return createFeature(url, site, null);
  }
  
  public abstract IFeature createFeature(URL paramURL, ISite paramISite, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public FeatureModel createFeatureModel()
  {
    return new Feature();
  }
  
  public IncludedFeatureReferenceModel createIncludedFeatureReferenceModel()
  {
    return new IncludedFeatureReference();
  }
  
  public InstallHandlerEntryModel createInstallHandlerEntryModel()
  {
    return new InstallHandlerEntry();
  }
  
  public ImportModel createImportModel()
  {
    return new Import();
  }
  
  public PluginEntryModel createPluginEntryModel()
  {
    return new PluginEntry();
  }
  
  public NonPluginEntryModel createNonPluginEntryModel()
  {
    return new NonPluginEntry();
  }
  
  public URLEntryModel createURLEntryModel()
  {
    return new URLEntry();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.BaseFeatureFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import org.eclipse.core.runtime.CoreException;

/**
 * @deprecated
 */
public class BaseInstallHandler
  implements IInstallHandler
{
  protected int type;
  protected IFeature feature;
  protected IInstallHandlerEntry entry;
  protected InstallMonitor monitor;
  protected IPluginEntry[] pluginEntries;
  protected INonPluginEntry[] nonPluginEntries;
  protected boolean initialized = false;
  
  public void initialize(int type, IFeature feature, IInstallHandlerEntry entry, InstallMonitor monitor)
    throws CoreException
  {
    if (initialized) {
      return;
    }
    if (feature == null) {
      throw new IllegalArgumentException();
    }
    this.type = type;
    this.feature = feature;
    this.entry = entry;
    this.monitor = monitor;
    initialized = true;
  }
  
  public void installInitiated()
    throws CoreException
  {}
  
  public void pluginsDownloaded(IPluginEntry[] plugins)
    throws CoreException
  {
    pluginEntries = plugins;
  }
  
  public void nonPluginDataDownloaded(INonPluginEntry[] nonPluginData, IVerificationListener listener)
    throws CoreException
  {
    nonPluginEntries = nonPluginData;
  }
  
  public void completeInstall(IFeatureContentConsumer consumer)
    throws CoreException
  {}
  
  public void installCompleted(boolean success)
    throws CoreException
  {}
  
  public void configureInitiated()
    throws CoreException
  {}
  
  public void completeConfigure()
    throws CoreException
  {}
  
  public void configureCompleted(boolean success)
    throws CoreException
  {}
  
  public void unconfigureInitiated()
    throws CoreException
  {}
  
  public void completeUnconfigure()
    throws CoreException
  {}
  
  public void unconfigureCompleted(boolean success)
    throws CoreException
  {}
  
  public void uninstallInitiated()
    throws CoreException
  {}
  
  public void completeUninstall()
    throws CoreException
  {}
  
  public void uninstallCompleted(boolean success)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.BaseInstallHandler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.osgi.util.NLS;
import org.eclipse.update.core.model.ArchiveReferenceModel;
import org.eclipse.update.core.model.CategoryModel;
import org.eclipse.update.core.model.InvalidSiteTypeException;
import org.eclipse.update.core.model.SiteModel;
import org.eclipse.update.core.model.SiteModelFactory;
import org.eclipse.update.core.model.URLEntryModel;
import org.eclipse.update.internal.core.Messages;
import org.eclipse.update.internal.core.UpdateCore;
import org.eclipse.update.internal.core.UpdateManagerUtils;
import org.eclipse.update.internal.core.connection.ConnectionFactory;
import org.eclipse.update.internal.core.connection.IResponse;

/**
 * @deprecated
 */
public abstract class BaseSiteFactory
  extends SiteModelFactory
  implements ISiteFactory
{
  public abstract ISite createSite(URL paramURL)
    throws CoreException, InvalidSiteTypeException;
  
  protected ResourceBundle getResourceBundle(URL url)
  {
    ResourceBundle bundle = null;
    try
    {
      url = UpdateManagerUtils.asDirectoryURL(url);
      ClassLoader l = new URLClassLoader(new URL[] { url }, null);
      bundle = ResourceBundle.getBundle("site", Locale.getDefault(), l);
    }
    catch (MissingResourceException e)
    {
      UpdateCore.warn(e.getLocalizedMessage() + ":" + url.toExternalForm());
    }
    catch (MalformedURLException localMalformedURLException)
    {
      UpdateCore.warn(NLS.bind(Messages.BaseSiteFactory_CannotRetriveParentDirectory, new String[] { url.toExternalForm() }));
    }
    return bundle;
  }
  
  public SiteModel createSiteMapModel()
  {
    return new Site();
  }
  
  public SiteFeatureReferenceModel createFeatureReferenceModel()
  {
    return new SiteFeatureReference();
  }
  
  public ArchiveReferenceModel createArchiveReferenceModel()
  {
    return new ArchiveReference();
  }
  
  public URLEntryModel createURLEntryModel()
  {
    return new URLEntry();
  }
  
  public CategoryModel createSiteCategoryModel()
  {
    return new Category();
  }
  
  protected InputStream openStream(URL resolvedURL)
    throws IOException
  {
    IResponse response = ConnectionFactory.get(resolvedURL);
    return response.getInputStream();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.BaseSiteFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import org.eclipse.update.core.model.CategoryModel;

/**
 * @deprecated
 */
public class Category
  extends CategoryModel
  implements ICategory
{
  public Category() {}
  
  public Category(String name, String label)
  {
    setName(name);
    setLabel(label);
  }
  
  public IURLEntry getDescription()
  {
    return (IURLEntry)getDescriptionModel();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.Category
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.osgi.util.NLS;
import org.eclipse.update.internal.core.FatalIOException;
import org.eclipse.update.internal.core.Messages;
import org.eclipse.update.internal.core.URLEncoder;
import org.eclipse.update.internal.core.UpdateManagerUtils;
import org.eclipse.update.internal.core.connection.ConnectionFactory;
import org.eclipse.update.internal.core.connection.HttpResponse;
import org.eclipse.update.internal.core.connection.IResponse;

/**
 * @deprecated
 */
public class ContentReference
{
  public static final long UNKNOWN_SIZE = -1L;
  public static final int DEFAULT_EXECUTABLE_PERMISSION = -1;
  private static final String FILE_URL_PROTOCOL = "file";
  private String id;
  private URL url;
  private File file;
  private IResponse response;
  private int permission;
  private long length;
  private boolean tempLocal = false;
  private long lastModified;
  
  public ContentReference(String id, URL url)
  {
    this.id = (id == null ? "" : id);
    this.url = url;
    file = null;
  }
  
  public ContentReference(String id, File file)
  {
    this.id = (id == null ? "" : id);
    this.file = file;
    url = null;
  }
  
  public ContentReference createContentReference(String id, File file)
  {
    return new ContentReference(id, file, true);
  }
  
  private ContentReference(String id, File file, boolean b)
  {
    this(id, file);
    setTempLocal(b);
  }
  
  public String getIdentifier()
  {
    return id;
  }
  
  public InputStream getInputStream()
    throws IOException
  {
    if (file != null) {
      return new FileInputStream(file);
    }
    if (url != null)
    {
      if (response == null)
      {
        URL resolvedURL = URLEncoder.encode(url);
        response = ConnectionFactory.get(resolvedURL);
        UpdateManagerUtils.checkConnectionResult(response, resolvedURL);
      }
      InputStream is = response.getInputStream();
      length = response.getContentLength();
      return is;
    }
    throw new FatalIOException(NLS.bind(Messages.ContentReference_UnableToCreateInputStream, new String[] { toString() }));
  }
  
  InputStream getPartialInputStream(long offset)
    throws IOException
  {
    if ((url != null) && ("http".equals(url.getProtocol())))
    {
      URL resolvedURL = URLEncoder.encode(url);
      response = ConnectionFactory.get(resolvedURL);
      if ((response instanceof HttpResponse)) {
        ((HttpResponse)response).setOffset(offset);
      }
      UpdateManagerUtils.checkConnectionResult(response, resolvedURL);
      InputStream is = response.getInputStream();
      length = (offset + response.getContentLength());
      return is;
    }
    throw new FatalIOException(NLS.bind(Messages.ContentReference_UnableToCreateInputStream, new String[] { toString() }));
  }
  
  public long getInputSize()
    throws IOException
  {
    if (length > 0L) {
      return length;
    }
    if (file != null) {
      return file.length();
    }
    if (url != null)
    {
      if (response == null)
      {
        URL resolvedURL = null;
        try
        {
          resolvedURL = URLEncoder.encode(url);
          response = ConnectionFactory.get(resolvedURL);
        }
        catch (IOException localIOException)
        {
          return -1L;
        }
        UpdateManagerUtils.checkConnectionResult(response, resolvedURL);
      }
      long size = response.getContentLength();
      return size == -1L ? -1L : size;
    }
    return -1L;
  }
  
  public boolean isLocalReference()
  {
    return tempLocal;
  }
  
  public File asFile()
    throws IOException
  {
    if (file != null) {
      return file;
    }
    if ((url != null) && ("file".equals(url.getProtocol())))
    {
      File result = new File(url.getFile());
      if (result.exists()) {
        return result;
      }
      throw new IOException(NLS.bind(Messages.ContentReference_FileDoesNotExist, new String[] { toString() }));
    }
    throw new IOException(NLS.bind(Messages.ContentReference_UnableToReturnReferenceAsFile, new String[] { toString() }));
  }
  
  public URL asURL()
    throws IOException
  {
    if (url != null) {
      return url;
    }
    if (file != null) {
      return file.toURL();
    }
    throw new FatalIOException(NLS.bind(Messages.ContentReference_UnableToReturnReferenceAsURL, new String[] { toString() }));
  }
  
  public String toString()
  {
    if (file != null) {
      return file.getAbsolutePath();
    }
    return url.toExternalForm();
  }
  
  public int getPermission()
  {
    return permission;
  }
  
  public void setPermission(int permission)
  {
    this.permission = permission;
  }
  
  protected void setTempLocal(boolean tempLocal)
  {
    this.tempLocal = tempLocal;
  }
  
  public void setLastModified(long timestamp)
  {
    lastModified = timestamp;
  }
  
  public long getLastModified()
  {
    if (lastModified == 0L) {
      if (file != null)
      {
        lastModified = file.lastModified();
      }
      else if (url != null)
      {
        if (response == null) {
          try
          {
            URL resolvedURL = URLEncoder.encode(url);
            response = ConnectionFactory.get(resolvedURL);
          }
          catch (MalformedURLException localMalformedURLException) {}catch (IOException localIOException) {}
        }
        lastModified = response.getLastModified();
      }
    }
    return lastModified;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.update.core.ContentReference
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.update.core;

import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.eclipse.osgi.util.NLS;
import org.eclipse.update.core.model.FeatureModel;
import org.eclipse.update.core.model.FeatureReferenceModel;
import org.eclipse.update.core.model.ImportModel;
import org.eclipse.update.core.model.InstallAbortedException;
import org.eclipse.update.core.model.NonPluginEntryModel;
import org.eclipse.update.core.model.PluginEntryModel;
import org.eclipse.update.core.model.URLEntryModel;
import org.eclipse.update.internal.core.Messages;
import org.eclipse.update.internal.core.TargetFeature;
import org.eclipse.update.internal.core.UpdateCore;
import org.eclipse.update.internal.core.UpdateManagerUtils;
import org.eclipse.update.internal.core.UpdateSiteIncludedFeatureReference;

/**
 * @deprecated
 */
public class Feature
  extends FeatureModel
  implements IFeature
{
  public static final String FEATURE_FILE = "feature";
  public static final String FEATURE_XML = "feature.xml";
  private ISite site;
  private IFeatureContentProvider featureContentProvider;
  private List includedFeatureReferences;
  private VersionedIdentifier versionId;
  private InstallAbortedException abortedException = null;
  
  public boolean equals(Object object)
  {
    if (!(object instanceof IFeature)) {
      return false;
    }
    IFeature f = (IFeature)object;
    return getVersionedIdentifier().equals(f.getVersionedIdentifier());
  }
  
  public VersionedIdentifier getVersionedIdentifier()
  {
    if (versionId != null) {
      return versionId;
    }
    String id = getFeatureIdentifier();
    String ver = getFeatureVersion();
    if ((id != null) && (ver != null)) {
      try
      {
        versionId = new VersionedIdentifier(id, ver);
        return versionId;
      }
      catch (Exception localException)
      {
        UpdateCore.warn(
          "Unable to create versioned identifier:" + id + ":" + ver);
      }
    }
    versionId = new VersionedIdentifier(getURL().toExternalForm(), null);
    return versionId;
  }
  
  public ISite getSite()
  {
    return site;
  }
  
  public URL getURL()
  {
    IFeatureContentProvider contentProvider = null;
    try
    {
      contentProvider = getFeatureContentProvider();
    }
    catch (CoreException e)
    {
      UpdateCore.warn("No content Provider", e);
    }
    return contentProvider != null ? contentProvider.getURL() : null;
  }
  
  public IURLEntry getUpdateSiteEntry()
  {
    return (IURLEntry)getUpdateSiteEntryModel();
  }
  
  public IURLEntry[] getDiscoverySiteEntries()
  {
    URLEntryModel[] result = getDiscoverySiteEntryModels();
    if (result.length == 0) {
      return new IURLEntry[0];
    }
    return (IURLEntry[])result;
  }
  
  public IInstallHandlerEntry getInstallHandlerEntry()
  {
    return (IInstallHandlerEntry)getInstallHandlerModel();
  }
  
  public IURLEntry getDescription()
  {
    return (IURLEntry)getDescriptionModel();
  }
  
  public IURLEntry getCopyright()
  {
    return (IURLEntry)getCopyrightModel();
  }
  
  public IURLEntry getLicense()
  {
    return (IURLEntry)getLicenseModel();
  }
  
  public URL getImage()
  {
    return getImageURL();
  }
  
  public IImport[] getRawImports()
  {
    ImportModel[] result = getImportModels();
    if (result.length == 0) {
      return new IImport[0];
    }
    return (IImport[])result;
  }
  
  public IFeatureReference install(IFeature targetFeature, IVerificationListener verificationListener, IProgressMonitor progress)
    throws InstallAbortedException, CoreException
  {
    return install(targetFeature, null, verificationListener, progress);
  }
  
  /* Error */
  public IFeatureReference install(IFeature targetFeature, IFeatureReference[] optionalfeatures, IVerificationListener verificationListener, IProgressMonitor progress)
    throws InstallAbortedException, CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: new 343	java/lang/StringBuffer
    //   4: dup
    //   5: ldc 3
    //   7: invokespecial 676	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   10: aload_0
    //   11: invokevirtual 704	org/eclipse/update/core/Feature:getURL	()Ljava/net/URL;
    //   14: invokevirtual 681	java/net/URL:toExternalForm	()Ljava/lang/String;
    //   17: invokevirtual 678	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   20: invokevirtual 675	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   23: invokespecial 702	org/eclipse/update/core/Feature:debug	(Ljava/lang/String;)V
    //   26: invokestatic 766	org/eclipse/update/internal/core/ErrorRecoveryLog:getLog	()Lorg/eclipse/update/internal/core/ErrorRecoveryLog;
    //   29: astore 5
    //   31: aload 4
    //   33: ifnonnull +22 -> 55
    //   36: new 379	org/eclipse/update/core/InstallMonitor
    //   39: dup
    //   40: new 354	org/eclipse/core/runtime/NullProgressMonitor
    //   43: dup
    //   44: invokespecial 691	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   47: invokespecial 751	org/eclipse/update/core/InstallMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   50: astore 6
    //   52: goto +32 -> 84
    //   55: aload 4
    //   57: instanceof 379
    //   60: ifeq +13 -> 73
    //   63: aload 4
    //   65: checkcast 379	org/eclipse/update/core/InstallMonitor
    //   68: astore 6
    //   70: goto +14 -> 84
    //   73: new 379	org/eclipse/update/core/InstallMonitor
    //   76: dup
    //   77: aload 4
    //   79: invokespecial 751	org/eclipse/update/core/InstallMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   82: astore 6
    //   84: new 388	org/eclipse/update/internal/core/InstallHandlerProxy
    //   87: dup
    //   88: iconst_1
    //   89: aload_0
    //   90: aload_0
    //   91: invokevirtual 712	org/eclipse/update/core/Feature:getInstallHandlerEntry	()Lorg/eclipse/update/core/IInstallHandlerEntry;
    //   94: aload 6
    //   96: invokespecial 773	org/eclipse/update/internal/core/InstallHandlerProxy:<init>	(ILorg/eclipse/update/core/IFeature;Lorg/eclipse/update/core/IInstallHandlerEntry;Lorg/eclipse/update/core/InstallMonitor;)V
    //   99: astore 7
    //   101: iconst_0
    //   102: istore 8
    //   104: aconst_null
    //   105: astore 9
    //   107: aload_0
    //   108: aconst_null
    //   109: putfield 657	org/eclipse/update/core/Feature:abortedException	Lorg/eclipse/update/core/model/InstallAbortedException;
    //   112: aload_0
    //   113: invokevirtual 706	org/eclipse/update/core/Feature:getFeatureContentProvider	()Lorg/eclipse/update/core/IFeatureContentProvider;
    //   116: astore 10
    //   118: aload 10
    //   120: invokeinterface 809 1 0
    //   125: astore 11
    //   127: aconst_null
    //   128: astore 12
    //   130: aconst_null
    //   131: astore 13
    //   133: aconst_null
    //   134: astore 14
    //   136: aconst_null
    //   137: checkcast 339	[Lorg/eclipse/update/core/IPluginEntry;
    //   140: astore 15
    //   142: new 346	java/util/ArrayList
    //   145: dup
    //   146: invokespecial 683	java/util/ArrayList:<init>	()V
    //   149: astore 16
    //   151: aload_0
    //   152: invokevirtual 715	org/eclipse/update/core/Feature:getPluginEntries	()[Lorg/eclipse/update/core/IPluginEntry;
    //   155: astore 17
    //   157: aload_1
    //   158: invokeinterface 801 1 0
    //   163: astore 18
    //   165: aload 18
    //   167: ifnonnull +18 -> 185
    //   170: aload_0
    //   171: ldc 5
    //   173: invokespecial 702	org/eclipse/update/core/Feature:debug	(Ljava/lang/String;)V
    //   176: iconst_0
    //   177: anewarray 370	org/eclipse/update/core/IPluginEntry
    //   180: astore 15
    //   182: goto +12 -> 194
    //   185: aload 18
    //   187: invokeinterface 824 1 0
    //   192: astore 15
    //   194: aload 17
    //   196: aload 15
    //   198: invokestatic 784	org/eclipse/update/internal/core/UpdateManagerUtils:diff	([Lorg/eclipse/update/core/IPluginEntry;[Lorg/eclipse/update/core/IPluginEntry;)[Lorg/eclipse/update/core/IPluginEntry;
    //   201: astore 19
    //   203: aload_0
    //   204: invokevirtual 713	org/eclipse/update/core/Feature:getNonPluginEntries	()[Lorg/eclipse/update/core/INonPluginEntry;
    //   207: astore 20
    //   209: aload_0
    //   210: invokevirtual 710	org/eclipse/update/core/Feature:getIncludedFeatureReferences	()[Lorg/eclipse/update/core/IIncludedFeatureReference;
    //   213: astore 21
    //   215: aload_2
    //   216: ifnull +11 -> 227
    //   219: aload 21
    //   221: aload_2
    //   222: invokestatic 783	org/eclipse/update/internal/core/UpdateManagerUtils:optionalChildrenToInstall	([Lorg/eclipse/update/core/IFeatureReference;[Lorg/eclipse/update/core/IFeatureReference;)[Lorg/eclipse/update/core/IFeatureReference;
    //   225: astore 21
    //   227: iconst_2
    //   228: iconst_2
    //   229: aload 19
    //   231: arraylength
    //   232: imul
    //   233: iadd
    //   234: aload 20
    //   236: arraylength
    //   237: iadd
    //   238: iconst_1
    //   239: iadd
    //   240: iconst_5
    //   241: aload 21
    //   243: arraylength
    //   244: imul
    //   245: iadd
    //   246: istore 22
    //   248: aload 6
    //   250: ldc 1
    //   252: iload 22
    //   254: invokevirtual 750	org/eclipse/update/core/InstallMonitor:beginTask	(Ljava/lang/String;I)V
    //   257: aconst_null
    //   258: astore 23
    //   260: aload 5
    //   262: ldc_w 329
    //   265: invokevirtual 765	org/eclipse/update/internal/core/ErrorRecoveryLog:open	(Ljava/lang/String;)V
    //   268: aload 7
    //   270: invokevirtual 767	org/eclipse/update/internal/core/InstallHandlerProxy:installInitiated	()V
    //   273: aload 10
    //   275: aload 6
    //   277: invokeinterface 810 2 0
    //   282: astore 24
    //   284: aload_0
    //   285: aload 11
    //   287: aload 24
    //   289: aload 6
    //   291: aload_3
    //   292: iconst_1
    //   293: invokespecial 735	org/eclipse/update/core/Feature:verifyReferences	(Lorg/eclipse/update/core/IVerifier;[Lorg/eclipse/update/core/ContentReference;Lorg/eclipse/update/core/InstallMonitor;Lorg/eclipse/update/core/IVerificationListener;Z)V
    //   296: aload_0
    //   297: aload 6
    //   299: iconst_1
    //   300: invokespecial 705	org/eclipse/update/core/Feature:monitorWork	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   303: iconst_0
    //   304: istore 25
    //   306: goto +41 -> 347
    //   309: aload 10
    //   311: aload 19
    //   313: iload 25
    //   315: aaload
    //   316: aload 6
    //   318: invokeinterface 815 3 0
    //   323: astore 24
    //   325: aload_0
    //   326: aload 11
    //   328: aload 24
    //   330: aload 6
    //   332: aload_3
    //   333: iconst_0
    //   334: invokespecial 735	org/eclipse/update/core/Feature:verifyReferences	(Lorg/eclipse/update/core/IVerifier;[Lorg/eclipse/update/core/ContentReference;Lorg/eclipse/update/core/InstallMonito
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Further reading...

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

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd