Eclipse Platform Release 3.7

## org.eclipse.update.core
Class ContentReference

    java.lang.Object
      org.eclipse.update.core.ContentReference

Direct Known Subclasses:
  JarContentReference, JarEntryContentReference

Deprecated. The org.eclipse.update component has been replaced by Equinox p2. This API will be deleted in a future release. See bug 311590 for details.

    public class ContentReference

extends Object

Content reference implements a general access wrapper to feature and site content. The reference specifies a "symbolic" path identifier for the content, and the actual reference as a file, or a URL.

This class may be instantiated or subclassed by clients.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
  2.0
See Also:
  `JarContentReference`, `JarEntryContentReference`

Field Summary
`static int` `DEFAULT_EXECUTABLE_PERMISSION` Deprecated. Default executable permission when installing a content reference Will add executable bit if necessary
`static long` `UNKNOWN_SIZE` Deprecated. Unknown size indication

Constructor Summary
`ContentReference(String id, File file)` Deprecated. Create content reference from file.
`ContentReference(String id, URL url)` Deprecated. Create content reference from URL.

Method Summary
`File` `asFile()` Deprecated. Returns the content reference as a file.
`URL` `asURL()` Deprecated. Returns the content reference as a URL.
`ContentReference` `createContentReference(String id, File file)` Deprecated. A factory method to create a content reference of the same type.
`String` `getIdentifier()` Deprecated. Retrieves the "symbolic" path identifier for the reference.
`long` `getInputSize()` Deprecated. Returns the size of the referenced input, if it can be determined.
`InputStream` `getInputStream()` Deprecated. Creates an input stream for the reference.
`long` `getLastModified()` Deprecated. Returns the timestamp when the content was last modified
`int` `getPermission()` Deprecated. Returns the permission for this file.
`boolean` `isLocalReference()` Deprecated. Indicates whether the reference is a local file reference.
`void` `setLastModified(long timestamp)` Deprecated. Sets the timestamp the content was last modified.
`void` `setPermission(int permission)` Deprecated. Sets the permission of this content reference.
`protected void` `setTempLocal(boolean tempLocal)` Deprecated. Sets if a content reference is considered local
`String` `toString()` Deprecated. Return string representation of this reference.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### UNKNOWN_SIZE

    public static final long UNKNOWN_SIZE

  Deprecated.
  Unknown size indication

  Since:
    2.0
  See Also:
    Constant Field Values

### DEFAULT_EXECUTABLE_PERMISSION

    public static final int DEFAULT_EXECUTABLE_PERMISSION

  Deprecated.
  Default executable permission when installing a content reference Will add executable bit if necessary

  Since:
    2.0.1
  See Also:
    Constant Field Values

Constructor Detail

### ContentReference

    public ContentReference(String id,
                            URL url)

  Deprecated.
  Create content reference from URL.

  Parameters:
    `id` - "symbolic" path identifier
    `url` - actual referenced URL
  Since:
    2.0

### ContentReference

    public ContentReference(String id,
                            File file)

  Deprecated.
  Create content reference from file.

  Parameters:
    `id` - "symbolic" path identifier
    `file` - actual referenced file
  Since:
    2.0

Method Detail

### createContentReference

    public ContentReference createContentReference(String id,
                                                   File file)

  Deprecated.
  A factory method to create a content reference of the same type.

  Parameters:
    `id` - "symbolic" path identifier
    `file` - actual referenced file
  Returns:
    content reference of the same type
  Since:
    2.0

### getIdentifier

    public String getIdentifier()

  Deprecated.
  Retrieves the "symbolic" path identifier for the reference.

  Returns:
    "symbolic" path identifier
  Since:
    2.0

### getInputStream

    public InputStream getInputStream()
                               throws IOException

  Deprecated.
  Creates an input stream for the reference.

  Returns:
    input stream
  Throws:
    `IOException` - unable to create stream
  Since:
    2.0

### getInputSize

    public long getInputSize()
                      throws IOException

  Deprecated.
  Returns the size of the referenced input, if it can be determined.

  Returns:
    input size, or @see #UNKNOWN_SIZE if size cannot be determined.
  Throws:
    `IOException`
  Since:
    2.0

### isLocalReference

    public boolean isLocalReference()

  Deprecated.
  Indicates whether the reference is a local file reference.

  Returns:
    `true` if the reference is local, otherwise `false`
  Since:
    2.0

### asFile

    public File asFile()
                throws IOException

  Deprecated.
  Returns the content reference as a file. Note, that this method does not cause the file to be downloaded if it is not already local.

  Returns:
    reference as file
  Throws:
    `IOException` - reference cannot be returned as file
  Since:
    2.0

### asURL

    public URL asURL()
              throws IOException

  Deprecated.
  Returns the content reference as a URL.

  Returns:
    reference as URL
  Throws:
    `IOException` - reference cannot be returned as URL
  Since:
    2.0

### toString

    public String toString()

  Deprecated.
  Return string representation of this reference.

  Overrides:
    `toString` in class `Object`
  Returns:
    string representation
  Since:
    2.0

### getPermission

    public int getPermission()

  Deprecated.
  Returns the permission for this file.

  Returns:
    the content reference permission
  Since:
    2.0.1
  See Also:
    `DEFAULT_EXECUTABLE_PERMISSION`

### setPermission

    public void setPermission(int permission)

  Deprecated.
  Sets the permission of this content reference.

  Parameters:
    `permission` - The permission to set

### setTempLocal

    protected void setTempLocal(boolean tempLocal)

  Deprecated.
  Sets if a content reference is considered local

  Parameters:
    `tempLocal` - `true` if the file is considered local

### setLastModified

    public void setLastModified(long timestamp)

  Deprecated.
  Sets the timestamp the content was last modified.

  Parameters:
    `timestamp` -
  Since:
    3.0

### getLastModified

    public long getLastModified()

  Deprecated.
  Returns the timestamp when the content was last modified

  Returns:
    the timestamp
  Since:
    3.0

Eclipse Platform Release 3.7

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.