Revert "Bug 476404 - Delete Platform API as announced for Eclipse 4.2. "
This reverts commit 20d75252bd80ad698bcec1c64ad7eb247b05ca63.
I know people should have get rid of calling those APIs but releasing this change without first making sure that at least our SDK still works is not good.
Change-Id: I42530456ef99f40cc87c7224632616df5116c872
diff --git a/bundles/org.eclipse.core.runtime/.settings/.api_filters b/bundles/org.eclipse.core.runtime/.settings/.api_filters
deleted file mode 100644
index e6b35f6..0000000
--- a/bundles/org.eclipse.core.runtime/.settings/.api_filters
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.core.runtime" version="2">
- <resource path="META-INF/MANIFEST.MF">
- <filter id="923795461">
- <message_arguments>
- <message_argument value="3.11.0"/>
- <message_argument value="3.11.0"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/core/runtime/Platform.java" type="org.eclipse.core.runtime.Platform">
- <filter id="338792546">
- <message_arguments>
- <message_argument value="org.eclipse.core.runtime.Platform"/>
- <message_argument value="addAuthorizationInfo(URL, String, String, Map<String,String>)"/>
- </message_arguments>
- </filter>
- <filter id="338792546">
- <message_arguments>
- <message_argument value="org.eclipse.core.runtime.Platform"/>
- <message_argument value="addProtectionSpace(URL, String)"/>
- </message_arguments>
- </filter>
- <filter id="338792546">
- <message_arguments>
- <message_argument value="org.eclipse.core.runtime.Platform"/>
- <message_argument value="flushAuthorizationInfo(URL, String, String)"/>
- </message_arguments>
- </filter>
- <filter id="338792546">
- <message_arguments>
- <message_argument value="org.eclipse.core.runtime.Platform"/>
- <message_argument value="getAuthorizationInfo(URL, String, String)"/>
- </message_arguments>
- </filter>
- <filter id="338792546">
- <message_arguments>
- <message_argument value="org.eclipse.core.runtime.Platform"/>
- <message_argument value="getProtectionSpace(URL)"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
index dc14faf..cbf6481 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
@@ -445,6 +445,43 @@
}
/**
+ * Adds the given authorization information to the key ring. The
+ * information is relevant for the specified protection space and the
+ * given authorization scheme. The protection space is defined by the
+ * combination of the given server URL and realm. The authorization
+ * scheme determines what the authorization information contains and how
+ * it should be used. The authorization information is a <code>Map</code>
+ * of <code>String</code> to <code>String</code> and typically
+ * contains information such as user names and passwords.
+ *
+ * @param serverUrl the URL identifying the server for this authorization
+ * information. For example, "http://www.example.com/".
+ * @param realm the subsection of the given server to which this
+ * authorization information applies. For example,
+ * "realm1@example.com" or "" for no realm.
+ * @param authScheme the scheme for which this authorization information
+ * applies. For example, "Basic" or "" for no authorization scheme
+ * @param info a <code>Map</code> containing authorization information
+ * such as user names and passwords (key type : <code>String</code>,
+ * value type : <code>String</code>)
+ * @exception CoreException if there are problems setting the
+ * authorization information. Reasons include:
+ * <ul>
+ * <li>The keyring could not be saved.</li>
+ * </ul>
+ * @deprecated Authorization database is superseded by the Equinox secure storage.
+ * Use <code>org.eclipse.equinox.security.storage.SecurePreferencesFactory</code>
+ * to obtain secure preferences and <code>org.eclipse.equinox.security.storage.ISecurePreferences</code>
+ * for data access and modifications.
+ * Consider using <code>ISecurePreferences#put(String, String, boolean)</code> as a replacement of this method.
+ * This API will be deleted in a future release. See bug 370248 for details.
+ */
+ @Deprecated
+ public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map<String,String> info) throws CoreException {
+ AuthorizationHandler.addAuthorizationInfo(serverUrl, realm, authScheme, info);
+ }
+
+ /**
* Adds the given log listener to the notification list of the platform.
* <p>
* Once registered, a listener starts receiving notification as entries
@@ -461,6 +498,33 @@
}
/**
+ * Adds the specified resource to the protection space specified by the
+ * given realm. All targets at or deeper than the depth of the last
+ * symbolic element in the path of the given resource URL are assumed to
+ * be in the same protection space.
+ *
+ * @param resourceUrl the URL identifying the resources to be added to
+ * the specified protection space. For example,
+ * "http://www.example.com/folder/".
+ * @param realm the name of the protection space. For example,
+ * "realm1@example.com"
+ * @exception CoreException if there are problems setting the
+ * authorization information. Reasons include:
+ * <ul>
+ * <li>The key ring could not be saved.</li>
+ * </ul>
+ * @deprecated Authorization database is superseded by the Equinox secure storage.
+ * Use <code>org.eclipse.equinox.security.storage.SecurePreferencesFactory</code>
+ * to obtain secure preferences and <code>org.eclipse.equinox.security.storage.ISecurePreferences</code>
+ * for data access and modifications.
+ * This API will be deleted in a future release. See bug 370248 for details.
+ */
+ @Deprecated
+ public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
+ AuthorizationHandler.addProtectionSpace(resourceUrl, realm);
+ }
+
+ /**
* Returns a URL that is the local equivalent of the
* supplied URL. This method is expected to be used with the
* plug-in-relative URLs returned by IPluginDescriptor, Bundle.getEntry()
@@ -496,6 +560,37 @@
}
/**
+ * Removes the authorization information for the specified protection
+ * space and given authorization scheme. The protection space is defined
+ * by the given server URL and realm.
+ *
+ * @param serverUrl the URL identifying the server to remove the
+ * authorization information for. For example,
+ * "http://www.example.com/".
+ * @param realm the subsection of the given server to remove the
+ * authorization information for. For example,
+ * "realm1@example.com" or "" for no realm.
+ * @param authScheme the scheme for which the authorization information
+ * to remove applies. For example, "Basic" or "" for no
+ * authorization scheme.
+ * @exception CoreException if there are problems removing the
+ * authorization information. Reasons include:
+ * <ul>
+ * <li>The keyring could not be saved.</li>
+ * </ul>
+ * @deprecated Authorization database is superseded by the Equinox secure storage.
+ * Use <code>org.eclipse.equinox.security.storage.SecurePreferencesFactory</code>
+ * to obtain secure preferences and <code>org.eclipse.equinox.security.storage.ISecurePreferences</code>
+ * for data access and modifications.
+ * Consider using <code>ISecurePreferences#clear()</code> as a replacement of this method.
+ * This API will be deleted in a future release. See bug 370248 for details.
+ */
+ @Deprecated
+ public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
+ AuthorizationHandler.flushAuthorizationInfo(serverUrl, realm, authScheme);
+ }
+
+ /**
* Returns the adapter manager used for extending
* <code>IAdaptable</code> objects.
*
@@ -507,6 +602,34 @@
}
/**
+ * Returns the authorization information for the specified protection
+ * space and given authorization scheme. The protection space is defined
+ * by the given server URL and realm. Returns <code>null</code> if no
+ * such information exists.
+ *
+ * @param serverUrl the URL identifying the server for the authorization
+ * information. For example, "http://www.example.com/".
+ * @param realm the subsection of the given server to which the
+ * authorization information applies. For example,
+ * "realm1@example.com" or "" for no realm.
+ * @param authScheme the scheme for which the authorization information
+ * applies. For example, "Basic" or "" for no authorization scheme
+ * @return the authorization information for the specified protection
+ * space and given authorization scheme, or <code>null</code> if no
+ * such information exists
+ * @deprecated Authorization database is superseded by the Equinox secure storage.
+ * Use <code>org.eclipse.equinox.security.storage.SecurePreferencesFactory</code>
+ * to obtain secure preferences and <code>org.eclipse.equinox.security.storage.ISecurePreferences</code>
+ * for data access and modifications.
+ * Consider using <code>ISecurePreferences#get(String, String)</code> as a replacement of this method.
+ * This API will be deleted in a future release. See bug 370248 for details.
+ */
+ @Deprecated
+ public static Map<String,String> getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
+ return AuthorizationHandler.getAuthorizationInfo(serverUrl, realm, authScheme);
+ }
+
+ /**
* Returns the command line args provided to the Eclipse runtime layer when it was first run.
* The returned value does not include arguments consumed by the lower levels of Eclipse
* (e.g., OSGi or the launcher).
@@ -673,6 +796,25 @@
}
/**
+ * Returns the protection space (realm) for the specified resource, or
+ * <code>null</code> if the realm is unknown.
+ *
+ * @param resourceUrl the URL of the resource whose protection space is
+ * returned. For example, "http://www.example.com/folder/".
+ * @return the protection space (realm) for the specified resource, or
+ * <code>null</code> if the realm is unknown
+ * @deprecated Authorization database is superseded by the Equinox secure storage.
+ * Use <code>org.eclipse.equinox.security.storage.SecurePreferencesFactory</code>
+ * to obtain secure preferences and <code>org.eclipse.equinox.security.storage.ISecurePreferences</code>
+ * for data access and modifications.
+ * This API will be deleted in a future release. See bug 370248 for details.
+ */
+ @Deprecated
+ public static String getProtectionSpace(URL resourceUrl) {
+ return AuthorizationHandler.getProtectionSpace(resourceUrl);
+ }
+
+ /**
* Removes the indicated (identical) log listener from the notification list
* of the platform. If no such listener exists, no action is taken.
*