Package org.fcrepo.server

Examples of org.fcrepo.server.MultiValueMap


            throws AuthzException {
        try {
            logger.debug("Entered enforceExport");
            String target = Constants.ACTION.EXPORT.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            String name = null;
            try {
                name = Constants.OBJECT.FORMAT_URI.uri;
                resourceAttributes.set(name, format);
                name = Constants.OBJECT.CONTEXT.uri;
                resourceAttributes.set(name, exportContext);
                name = Constants.OBJECT.ENCODING.uri;
                resourceAttributes.set(name, exportEncoding);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + name, e);
            }
View Full Code Here


                                        int nNewPids) throws AuthzException {
        try {
            logger.debug("Entered enforceGetNextPid");
            String target = Constants.ACTION.GET_NEXT_PID.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            try {
                String nNewPidsAsString = Integer.toString(nNewPids);
                resourceAttributes.set(Constants.OBJECT.N_PIDS.uri,
                                       nNewPidsAsString);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + Constants.OBJECT.N_PIDS.uri, e);
View Full Code Here

        try {
            logger.debug("Entered enforceRetrieveFile for {}", fileURI);
            String target = Constants.ACTION.RETRIEVE_FILE.uri;
            context.setActionAttributes(null);
            context.setResourceAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            String name = "";
            try {
                name = resourceAttributes.setReturn(Constants.DATASTREAM.FILE_URI.uri, fileURI);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't be set " + name, e);
            }
            context.setResourceAttributes(resourceAttributes);
View Full Code Here

    private MultiValueMap createMap(String key, String value) {
        return createMap(key, new String[]{value});
    }

    private MultiValueMap createMap(String key, String[] value) {
        MultiValueMap map = new MultiValueMap();
        map.set(key, value);
        return map;
    }
View Full Code Here

        map.set(key, value);
        return map;
    }

    private MultiValueMap createMap(String[][] key_value) {
        MultiValueMap map = new MultiValueMap();
        for (String[] pair: key_value){
            map.set(pair[0], pair[1]);
        }
        return map;
    }
View Full Code Here

    private static ByteArrayInputStream buildInputStream(String content) {
        return new ByteArrayInputStream(content.getBytes());
    }

    private static MultiValueMap buildMultiMap(String[][] pairs) {
        MultiValueMap map = new MultiValueMap();
        for (String[] pair : pairs) {
            try {
                map.set(pair[0], pair[1]);
            } catch (Exception e) {
                e.printStackTrace();
                // Just eat the stupid Exception!!
            }
        }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.MultiValueMap

Copyright © 2018 www.massapicom. 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.