mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ADF-5234: [BE] Viewer - the Mimetype property should be changed when a new type of file is uploaded (#696)
* Added Apple Icons mimetype * Added MimetypeMapContentTest for Apple Icons
This commit is contained in:
@@ -192,6 +192,8 @@ public class MimetypeMap implements MimetypeService
|
|||||||
|
|
||||||
public static final String MIMETYPE_IMAGE_DWT = "image/x-dwt";
|
public static final String MIMETYPE_IMAGE_DWT = "image/x-dwt";
|
||||||
|
|
||||||
|
public static final String MIMETYPE_IMAGE_ICNS = "image/icns";
|
||||||
|
|
||||||
public static final String MIMETYPE_APPLICATION_EPS = "application/eps";
|
public static final String MIMETYPE_APPLICATION_EPS = "application/eps";
|
||||||
|
|
||||||
public static final String MIMETYPE_APPLICATION_PS = "application/postscript";
|
public static final String MIMETYPE_APPLICATION_PS = "application/postscript";
|
||||||
|
@@ -611,6 +611,10 @@
|
|||||||
<mimetype mimetype="application/vnd.apple.numbers" display="Apple iWork Numbers">
|
<mimetype mimetype="application/vnd.apple.numbers" display="Apple iWork Numbers">
|
||||||
<extension>numbers</extension>
|
<extension>numbers</extension>
|
||||||
</mimetype>
|
</mimetype>
|
||||||
|
<!-- Apple ICNS files -->
|
||||||
|
<mimetype mimetype="image/icns" display="Apple Icon">
|
||||||
|
<extension>icns</extension>
|
||||||
|
</mimetype>
|
||||||
|
|
||||||
<!-- Markdown -->
|
<!-- Markdown -->
|
||||||
<mimetype mimetype="text/x-markdown" display="Markdown">
|
<mimetype mimetype="text/x-markdown" display="Markdown">
|
||||||
|
@@ -94,6 +94,7 @@ public class MimetypeMapTest extends TestCase
|
|||||||
// other text forms
|
// other text forms
|
||||||
assertEquals("text/csv", mimetypesByExtension.get("csv"));
|
assertEquals("text/csv", mimetypesByExtension.get("csv"));
|
||||||
assertEquals("text/html", mimetypesByExtension.get("html"));
|
assertEquals("text/html", mimetypesByExtension.get("html"));
|
||||||
|
assertEquals("image/icns", mimetypesByExtension.get("icns"));
|
||||||
|
|
||||||
// JPEG
|
// JPEG
|
||||||
assertEquals("jpg", extensionsByMimetype.get("image/jpeg"));
|
assertEquals("jpg", extensionsByMimetype.get("image/jpeg"));
|
||||||
|
@@ -72,6 +72,14 @@ public class MimetypeMapContentTest extends TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testGuessAppleIconsMimetype() throws Exception
|
||||||
|
{
|
||||||
|
assertEquals(
|
||||||
|
"image/icns",
|
||||||
|
mimetypeService.guessMimetype("something.icns", openQuickTestFile("quick.icns"))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public void testGuessMimetypeForFile() throws Exception
|
public void testGuessMimetypeForFile() throws Exception
|
||||||
{
|
{
|
||||||
// Correct ones
|
// Correct ones
|
||||||
|
BIN
repository/src/test/resources/quick/quick.icns
Normal file
BIN
repository/src/test/resources/quick/quick.icns
Normal file
Binary file not shown.
Reference in New Issue
Block a user