diff options
author | Tobias Thierer <tobiast@google.com> | 2019-09-27 17:08:49 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2019-09-27 17:25:13 +0100 |
commit | af0cef987da359955023fde97f0f4c7444fd5e76 (patch) | |
tree | 30db49b5b36201af0be76fb31083ea51405a48db /mime/java/android | |
parent | fd9657d0320f291fb96b58d7fd5cc46b59d35128 (diff) |
MimeMapImpl.createDefaultInstance() -> DefaultMimeMapFactory.create().
The class no longer implements MimeMap, so the name MimeMapImpl
no longer made sense.
Test: Treehugger
Bug: 136256059
Change-Id: I2cbc70a7769232b704a9bdfde2def832c1e292b8
Diffstat (limited to 'mime/java/android')
-rw-r--r-- | mime/java/android/content/type/DefaultMimeMapFactory.java (renamed from mime/java/android/content/type/MimeMapImpl.java) | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mime/java/android/content/type/MimeMapImpl.java b/mime/java/android/content/type/DefaultMimeMapFactory.java index 367160367cc0..545fb3cbb5cd 100644 --- a/mime/java/android/content/type/MimeMapImpl.java +++ b/mime/java/android/content/type/DefaultMimeMapFactory.java @@ -26,21 +26,24 @@ import java.util.List; import java.util.regex.Pattern; /** - * Default implementation of {@link MimeMap}, a bidirectional mapping between - * MIME types and file extensions. + * Creates the framework default {@link MimeMap}, a bidirectional mapping + * between MIME types and file extensions. * * This default mapping is loaded from data files that start with some mappings * recognized by IANA plus some custom extensions and overrides. * * @hide */ -public class MimeMapImpl { +public class DefaultMimeMapFactory { + + private DefaultMimeMapFactory() { + } /** - * Creates and returns a new {@link MimeMapImpl} instance that implements. + * Creates and returns a new {@link MimeMap} instance that implements. * Android's default mapping between MIME types and extensions. */ - public static MimeMap createDefaultInstance() { + public static MimeMap create() { return parseFromResources("/mime.types", "/android.mime.types"); } @@ -56,7 +59,7 @@ public class MimeMapImpl { private static void parseTypes(MimeMap.Builder builder, String resource) { try (BufferedReader r = new BufferedReader( - new InputStreamReader(MimeMapImpl.class.getResourceAsStream(resource)))) { + new InputStreamReader(DefaultMimeMapFactory.class.getResourceAsStream(resource)))) { String line; while ((line = r.readLine()) != null) { int commentPos = line.indexOf('#'); |