Re: [sleuthkit-developers] Help Writing a Module - isMimeType() - SortedSet
Brought to you by:
carrier
From: Brian C. <ca...@sl...> - 2018-06-20 23:55:16
|
Are you writing a Jython module? If so, I'm not sure how to create a SortedSet in Jython. Looks like we made an API mistake by forcing it to be a SortedSet instead of a generic Set. If your list of MIME types are different from the ones that Richard mentioned, I'd recommend you call AbstractFile.getMIMEType() and use that value to see if it is in your list of mime types that you care about. On Fri, Jun 15, 2018 at 1:59 PM, Richard Cordovano <rco...@ba... > wrote: > You could call the following ImageUtils to get a SortedSet of image MIME > types: > > public static SortedSet<String> getSupportedImageMimeTypes() > > You could also call this FIleTypeDetector method to see all the values > that can be stored in the field returned by AbstractFile.getMIMEType: > > /** > * Gets a sorted set of the file types that can be detected: the MIME > types > * detected by Tika (without optional parameters), the custom MIME > types > * defined by Autopsy, and any custom MIME types defined by the user. > * > * @return A list of all detectable file types. > * > * @throws FileTypeDetectorInitException If an error occurs while > assembling > * the list of types > */ > public static synchronized SortedSet<String> getDetectedTypes() throws > FileTypeDetectorInitException > > > > On Wed, Jun 13, 2018 at 8:47 PM Edes4ud Kheheb2enud <bee...@gm...> > wrote: > >> Hello, >> >> I'm trying to write a module and I am running in to some problems and was >> wondering if anyone could help. >> >> My module is an ingest module. I would like it to run against any file >> with an image mimetype. I'm using the sample ingest module from the 1st >> tutorial as a model and I'm attempting to use: >> >> if file.isMimeType() >> >> I'm having difficulty with the parameter for isMimeType. It is supposed >> to be a sorted set. I guess I am confused on what a sorted set is and what >> format it should be in. I tried passing strings that were a mimetype but >> everything I tried fails. Has anyone had any success filtering files based >> on mimetype? >> >> Rod >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______ >> _________________________________________ >> sleuthkit-developers mailing list >> sle...@li... >> https://lists.sourceforge.net/lists/listinfo/sleuthkit-developers >> > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > sleuthkit-developers mailing list > sle...@li... > https://lists.sourceforge.net/lists/listinfo/sleuthkit-developers > > |