Package org.dspace.xoai.exceptions

Examples of org.dspace.xoai.exceptions.InvalidSetSpecException


    @Override
    public String toSetSpec(Community community) throws InvalidSetSpecException {
        String handle = community.getHandle();
        String[] split = handle.split("/");
        if (split.length != 2) throw new InvalidSetSpecException("Invalid handle "+handle);

        return format(getSetSpecFormat(Community.class), split[0], split[1]);
    }
View Full Code Here


    @Override
    public String toSetSpec(Collection collection) throws InvalidSetSpecException {
        String handle = collection.getHandle();
        String[] split = handle.split("/");
        if (split.length != 2) throw new InvalidSetSpecException("Invalid handle "+handle);

        return String.format(getSetSpecFormat(Community.class), split[0], split[1]);
    }
View Full Code Here

        if (setSpec.matches(communityPattern))
            pattern = communityPattern;
        else if (setSpec.matches(collectionPattern))
            pattern = collectionPattern;
        else
            throw new InvalidSetSpecException("Unknown set spec");


        Matcher matcher = Pattern.compile(pattern).matcher(setSpec);
        String handle_prefix = matcher.group(1);
        String local_id = matcher.group(2);

        try {
            return handleResolver.resolve(handle_prefix + "/" + local_id);
        } catch (HandleResolverException e) {
            throw new InvalidSetSpecException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.dspace.xoai.exceptions.InvalidSetSpecException

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.