Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-09-18 06:10:02 +0000
committerspingel2009-09-18 06:10:02 +0000
commit7d075c85eb682b5a110ca82b7a3762a39552fd4c (patch)
tree43e63045ff38e06bb269d948903c8ef5c1dc45b2 /org.eclipse.mylyn.tasks.core
parent05588e92cce7e001834d0fa6b84213f47d3509b1 (diff)
downloadorg.eclipse.mylyn.tasks-7d075c85eb682b5a110ca82b7a3762a39552fd4c.tar.gz
org.eclipse.mylyn.tasks-7d075c85eb682b5a110ca82b7a3762a39552fd4c.tar.xz
org.eclipse.mylyn.tasks-7d075c85eb682b5a110ca82b7a3762a39552fd4c.zip
NEW - bug 196491: support image/tiff mime-type for attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196491
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java
index c14c22467..e5ef39904 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/FileTaskAttachmentSource.java
@@ -16,9 +16,12 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -56,10 +59,13 @@ public class FileTaskAttachmentSource extends AbstractTaskAttachmentSource {
extensions2Types.put("html", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("htm", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("xhtml", "application/xhtml+xml"); //$NON-NLS-1$//$NON-NLS-2$
+ extensions2Types.put("jpe", "image/jpeg"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("jpg", "image/jpeg"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("jpeg", "image/jpeg"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("gif", "image/gif"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("png", "image/png"); //$NON-NLS-1$ //$NON-NLS-2$
+ extensions2Types.put("tif", "image/tiff"); //$NON-NLS-1$ //$NON-NLS-2$
+ extensions2Types.put("tiff", "image/tiff"); //$NON-NLS-1$ //$NON-NLS-2$
extensions2Types.put("xml", APPLICATION_XML); //$NON-NLS-1$
extensions2Types.put("zip", APPLICATION_OCTET_STREAM); //$NON-NLS-1$
extensions2Types.put("tar", APPLICATION_OCTET_STREAM); //$NON-NLS-1$
@@ -94,6 +100,13 @@ public class FileTaskAttachmentSource extends AbstractTaskAttachmentSource {
return APPLICATION_OCTET_STREAM;
}
+ public static String[] getContentTypes() {
+ Set<String> types = new HashSet<String>(extensions2Types.values());
+ String[] array = types.toArray(new String[0]);
+ Arrays.sort(array);
+ return array;
+ }
+
private String contentType;
private String description;

Back to the top