Examples of MimeTypeDetectingInputStream


Examples of net.sf.sitstart.svc.internal.impl.stream.processors.MimeTypeDetectingInputStream

    /**
     * @see net.sf.sitstart.svc.internal.AssetProcessor#process(net.sf.sitstart.svc.internal.AssetWithContent)
     */
    public void process(AssetWithContent assetWithContent)
    {
        MimeTypeDetectingInputStream mimeTypeDetectorStream = null;
        Asset                        asset                  = null;
        Date                         start                  = null;
        Date                         end                    = null;
       
        // PRECONDITIONS
        assert assetWithContent != null : "assetWithContent must not be null.";
       
        // Body
        start = new Date();
        asset = assetWithContent.getAsset();
       
        mimeTypeDetectorStream = new MimeTypeDetectingInputStream(mimeTypeDetector,
                                                                  assetWithContent.getInputStream(),
                                                                  null,
                                                                  asset.getURI());
        linkExtractor.extractLinks(asset, mimeTypeDetectorStream);
        asset.setDetectedMimeType(mimeTypeDetectorStream.getDetectedMimeType());
        end = new Date();
       
        asset.setProcessingTimeInMs(end.getTime() - start.getTime());
    }
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.