summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-04-20 11:47:40 +0100
committerNarayan Kamath <narayan@google.com>2015-04-21 10:29:23 +0000
commitdb4d0bd54407d4f6116e51ba0668869f3f790b40 (patch)
treeb47a7a539ca7095bd60d2c41b97a0fed99baca5e /luni/src/main/java
parent6e117b89a451008286947c566ca3f90a1dc9f35b (diff)
downloadlibcore-db4d0bd54407d4f6116e51ba0668869f3f790b40.zip
libcore-db4d0bd54407d4f6116e51ba0668869f3f790b40.tar.gz
libcore-db4d0bd54407d4f6116e51ba0668869f3f790b40.tar.bz2
Remove support for reading mime types from property files.
This support was untested and unused and of very limited utility, given that this class is initialized in the zygote. It also discourages arbitrary changes to the priority order of mappings. Change-Id: I2a7f91d2956627cd59f948561c37678bc45d118d
Diffstat (limited to 'luni/src/main/java')
-rw-r--r--luni/src/main/java/libcore/net/MimeUtils.java61
1 files changed, 0 insertions, 61 deletions
diff --git a/luni/src/main/java/libcore/net/MimeUtils.java b/luni/src/main/java/libcore/net/MimeUtils.java
index 2e72078..e36b3d1 100644
--- a/luni/src/main/java/libcore/net/MimeUtils.java
+++ b/luni/src/main/java/libcore/net/MimeUtils.java
@@ -16,13 +16,8 @@
package libcore.net;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
/**
* Utilities for dealing with MIME types.
@@ -382,7 +377,6 @@ public final class MimeUtils {
add("video/x-webex", "wrf");
add("x-conference/x-cooltalk", "ice");
add("x-epoc/x-sisx-app", "sisx");
- applyOverrides();
}
private static void add(String mimeType, String extension) {
@@ -399,61 +393,6 @@ public final class MimeUtils {
}
}
- private static InputStream getContentTypesPropertiesStream() {
- // User override?
- String userTable = System.getProperty("content.types.user.table");
- if (userTable != null) {
- File f = new File(userTable);
- if (f.exists()) {
- try {
- return new FileInputStream(f);
- } catch (IOException ignored) {
- }
- }
- }
-
- // Standard location?
- File f = new File(System.getProperty("java.home"), "lib" + File.separator + "content-types.properties");
- if (f.exists()) {
- try {
- return new FileInputStream(f);
- } catch (IOException ignored) {
- }
- }
-
- return null;
- }
-
- /**
- * This isn't what the RI does. The RI doesn't have hard-coded defaults, so supplying your
- * own "content.types.user.table" means you don't get any of the built-ins, and the built-ins
- * come from "$JAVA_HOME/lib/content-types.properties".
- */
- private static void applyOverrides() {
- // Get the appropriate InputStream to read overrides from, if any.
- InputStream stream = getContentTypesPropertiesStream();
- if (stream == null) {
- return;
- }
-
- try {
- try {
- // Read the properties file...
- Properties overrides = new Properties();
- overrides.load(stream);
- // And translate its mapping to ours...
- for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
- String extension = (String) entry.getKey();
- String mimeType = (String) entry.getValue();
- add(mimeType, extension);
- }
- } finally {
- stream.close();
- }
- } catch (IOException ignored) {
- }
- }
-
private MimeUtils() {
}