-
Hello,
In the MagicMimeMimeDetector class it states that you should override the protected static defaultLocations array to add your own mime type files. However, this array is used to populate the private static magicMimeFileLocations list so anything you add will not actually be used. I have had to use my own custom version of this class to get round this but maybe this could this be...
2009-11-02 14:00:07 UTC by iandunlop
-
MimeUtil says that the text file is binary. Using the latest 2.1.2 version.
MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
byte[] fileContents = new byte[] {115, 115, 115};
ByteArrayInputStream fileContentsStream = new ByteArrayInputStream(fileContents);
Collection<MimeType> fileTypes = MimeUtil.getMimeTypes(fileContentsStream);
The...
2009-10-26 21:43:16 UTC by Anton
-
the java documentation associated to the field MimeUtil2.UNKNOWN_MIME_TYPE is wrong, it's a duplication of MimeUtil2.DIRECTORY_MIME_TYPE.
2009-10-13 15:22:34 UTC by nobody
-
Hi Steve,
First, congratulation for this excellent API !
In some case, we need to launch a file with the default application associated with the file extension. So we need to create a file name with the extension which corresponds to the file MIME type.
I suggest to add a new static method in the ExtensionMimeDetector to do that:
public static Collection...
2009-10-03 13:36:16 UTC by julienpasquier
-
The problem is that the stream closing is within if(mimeTypes.isEmpty() || mimeTypes.size() > 1) {} block, thus the stream is not closed if there is exactly one element in mimeTypes.
The stream should not even be opened if it is not deeded, or at least the if statement should be moved within the try block, then the stream closing in the finally block is always executed.
2009-09-19 10:16:33 UTC by nobody
-
Hi how can i know the extention of an array of bytes, is there any possibility?? Thank u!!
2009-09-08 15:39:22 UTC by karkayu20
-
Sorry double post !
2009-09-08 13:07:50 UTC by nobody
-
We're using the library within an application server. When the AS is stopped, a warning is thrown indicating a stream has been finalized or forced closed.
The problem seems to come from the ExtensionMimeDetector during its initialization in the following code :
// Load the default supplied mime types
((Properties...
2009-09-08 10:13:59 UTC by nobody
-
We're using the library within an application server. When the AS is stopped, a warning is thrown indicating a stream has been finalized or forced closed.
The problem seems to come from the ExtensionMimeDetector during its initialization in the following code :
// Load the default supplied mime types
((Properties...
2009-09-08 09:12:33 UTC by nobody
-
Well, this morning I've been doing more tests and have found a way to solve it in a more or less elegant manner.
First of all I wanted to comment that I could have fixed it using soft links on Unix or junctions on Windows, making a link called "lib" under the "WEB-INF" directory of every web application, which pointed to the folder of common libraries which I employ...
2009-08-24 11:22:48 UTC by negora