Examples of MimeTypeRetrieverException


Examples of com.volantis.map.sti.mime.MimeTypeRetrieverException

    public String retrieveMIMEType(ResourceDescriptor descriptor) throws MimeTypeRetrieverException {
        try {
            String urlString = descriptor.getInputParameters()
                .getParameterValue(ParameterNames.SOURCE_URL);
            if (urlString == null) {
                throw new MimeTypeRetrieverException("no source url provided");
            }

            URL url = new URL(urlString);
       
            Representation representation =
                resourceRetriever.execute(url, null);
           
            return representation.getFileType();
           
        } catch (MalformedURLException e) {
            throw new MimeTypeRetrieverException(e);
        } catch (ResourceRetrieverException e) {
            throw new MimeTypeRetrieverException(e);
        } catch (IOException e) {
            throw new MimeTypeRetrieverException(e);
        } catch (MissingParameterException e) {
            throw new MimeTypeRetrieverException(e);
        }
    }
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.