Examples of DefectAsset


Examples of org.apache.wink.example.qadefect.resources.DefectAsset

        throws Exception {

        // the media type of the defect is not sent because it is not known,
        // so we need to guess it
        body = body.trim();
        DefectAsset asset = new DefectAsset();
        if (body.startsWith("<defect")) {
            // read the incoming entity as xml
            DefectBean defect =
                ProviderUtils.readFromString(providers,
                                             body,
                                             DefectBean.class,
                                             MediaType.APPLICATION_XML_TYPE);
            asset.setDefect(defect);
        } else if (body.startsWith("<entry")) {
            // read the incoming entity as an atom entry
            SyndEntry entry =
                ProviderUtils.readFromString(providers,
                                             body,
                                             SyndEntry.class,
                                             MediaType.APPLICATION_ATOM_XML_TYPE);
            asset.setSyndEntry(entry, providers);
        } else {
            logger.error("WebDAV defect update can only handle xml or atom entry");
            throw new WebApplicationException(Response.Status.UNSUPPORTED_MEDIA_TYPE);
        }

        asset.getDefect().setId(defectId);

        try {
            // update the defect
            return super.updateDefect(asset, linkProcessor, defectId);
        } catch (WebApplicationException e) {
View Full Code Here

Examples of org.apache.wink.example.qadefect.resources.DefectAsset

        throws Exception {

        // the media type of the defect is not sent because it is not known,
        // so we need to guess it
        body = body.trim();
        DefectAsset asset = new DefectAsset();
        if (body.startsWith("<defect")) {
            // read the incoming entity as xml
            DefectBean defect =
                ProviderUtils.readFromString(providers,
                                             body,
                                             DefectBean.class,
                                             MediaType.APPLICATION_XML_TYPE);
            asset.setDefect(defect);
        } else if (body.startsWith("<entry")) {
            // read the incoming entity as an atom entry
            SyndEntry entry =
                ProviderUtils.readFromString(providers,
                                             body,
                                             SyndEntry.class,
                                             MediaType.APPLICATION_ATOM_XML_TYPE);
            asset.setSyndEntry(entry, providers);
        } else {
            logger.error("WebDAV defect update can only handle xml or atom entry");
            throw new WebApplicationException(Response.Status.UNSUPPORTED_MEDIA_TYPE);
        }

        asset.getDefect().setId(defectId);

        try {
            // update the defect
            return super.updateDefect(asset, linkProcessor, defectId);
        } catch (WebApplicationException e) {
View Full Code Here

Examples of org.apache.wink.example.qadefect.resources.DefectAsset

        throws Exception {

        // the media type of the defect is not sent because it is not known,
        // so we need to guess it
        body = body.trim();
        DefectAsset asset = new DefectAsset();
        if (body.startsWith("<defect")) {
            // read the incoming entity as xml
            DefectBean defect =
                ProviderUtils.readFromString(providers,
                                             body,
                                             DefectBean.class,
                                             MediaType.APPLICATION_XML_TYPE);
            asset.setDefect(defect);
        } else if (body.startsWith("<entry")) {
            // read the incoming entity as an atom entry
            SyndEntry entry =
                ProviderUtils.readFromString(providers,
                                             body,
                                             SyndEntry.class,
                                             MediaType.APPLICATION_ATOM_XML_TYPE);
            asset.setSyndEntry(entry, providers);
        } else {
            logger.error("WebDAV defect update can only handle xml or atom entry");
            throw new WebApplicationException(Response.Status.UNSUPPORTED_MEDIA_TYPE);
        }

        asset.getDefect().setId(defectId);

        try {
            // update the defect
            return super.updateDefect(asset, linkProcessor, defectId);
        } catch (WebApplicationException 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.