Examples of DuplicateNameException


Examples of slash.navigation.rest.exception.DuplicateNameException

        String result = request.executeAsString();
        if (request.isUnAuthorized())
            throw new UnAuthorizedException("Cannot add user " + userName, getUsersUrl());
        if (request.isForbidden())
            throw new DuplicateNameException("Cannot add user " + userName, getUsersUrl());
        if (!request.isSuccessful())
            throw new IOException("POST on " + getUsersUrl() + " with payload " + userName + "," + firstName + "," + lastName + "," + email + " not successful: " + result);
        return request.getLocation();
    }
View Full Code Here

Examples of slash.navigation.rest.exception.DuplicateNameException

        if (request.isUnAuthorized())
            throw new UnAuthorizedException("Cannot add category " + name, categoryUrl);
        if (request.isNotFound())
            throw new NotFoundException("Cannot add category " + name, categoryUrl);
        if (request.isForbidden())
            throw new DuplicateNameException("Cannot add category " + name, categoryUrl);
        if (!request.isSuccessful())
            throw new IOException("POST on " + categoryUrl + " with payload " + name + " not successful: " + result);
        return request.getLocation();
    }
View Full Code Here

Examples of slash.navigation.rest.exception.DuplicateNameException

        Post request = prepareAddFile(file);
        String result = request.executeAsString();
        if (request.isUnAuthorized())
            throw new UnAuthorizedException("Cannot add file " + file.getAbsolutePath(), getFilesUrl());
        if (request.isForbidden())
            throw new DuplicateNameException("Cannot add file " + file.getAbsolutePath(), getFilesUrl());
        if (!request.isSuccessful())
            throw new IOException("POST on " + getFilesUrl() + " with file " + file.getAbsolutePath() + " not successful: " + result);
        return request.getLocation();
    }
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.