Examples of MimeTypeIdentifier


Examples of org.semanticdesktop.aperture.mime.identifier.MimeTypeIdentifier

        /*
            MimeTypes identifier = TikaConfig.getDefaultConfig().getMimeRepository();
            MimeTypeDetectors mimeType = identifier.getMimeType(path.getLastSegment().getName().getLocalName(), stream);
            return mimeType == null ? null : mimeType.getName();
        */
        MimeTypeIdentifier identifier = new MagicMimeTypeIdentifier();
        // Read as many bytes of the file as desired by the MIME-type identifier
        int minimumArrayLength = identifier.getMinArrayLength();
        byte[] bytes = IOUtil.readBytes(content, minimumArrayLength);
        // let the MimeTypeIdentifier determine the MIME-type of this file
        return identifier.identify(bytes, name, null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.