Examples of ConflictException


Examples of br.com.caelum.restfulie.http.error.ConflictException

      throw new ProxyAuthenticationRequiredException("Http error " + code
          + " when executing request");
    }

    if (code == 409) {
      throw new ConflictException("Http error " + code
          + " when executing request");
    }

    if (code == 410) {
      throw new GoneException("Http error " + code
View Full Code Here

Examples of cern.entwined.exception.ConflictException

        }

        // Checking for conflicts
        if (this.globallyAccessed) {
            if (!globalState.sourceMap.equals(this.sourceMap)) {
                throw new ConflictException("All the items of this map have been accessed "
                        + "this prohibits commit in the case of concurrent changes");
            }
        }
        for (K key : this.accessed) {
            checkConsistency(globalState.sourceMap, key);
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

            } else {
                log.warn("not found or not CollectionResource: " + r);
            }
            if( target == null ) {
                log.warn( "No PutableResource with that path: " + sFolder );
                throw new ConflictException( target );
            }
            try {
                if( command.equals( "GetFolders" ) ) {
                    processGetFoldersCommand( false );
                } else if( command.equals( "GetFoldersAndFiles" ) ) {
                    processGetFoldersCommand( true );
                } else if( command.equals( "CreateFolder" ) ) {
                    processCreateFolderCommand();
                } else if( command.equals( "FileUpload" ) ) {
                    processUploadFolderCommand();
                } else {
                    log.warn( "Unknown command: " + command );
                    throw new ConflictException( target );
                }
            } finally {
                writer.flush();
            }
        }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

            if( r instanceof PutableResource ) {
                target = (PutableResource) r;
            }
            if( target == null ) {
                log.warn( "No putable folder with that path: " + sFolder );
                throw new ConflictException( target );
            }

            String name = f.getName(); //utilFile().sanitiseName(f.getName());
            log.debug( "processFileUpload: " + name );
            boolean isFirst = true;
            while( target.child( name ) != null ) {
                name = FileUtils.incrementFileName( name, isFirst );
                newName = name;
                isFirst = false;
            }

            PutableResource putable;
            if( target instanceof PutableResource) {
                putable = (PutableResource) target;
            } else {
                log.warn("The collection is not putable: " + r.getName() + " - " + r.getClass().getCanonicalName());
                throw new ConflictException( r );
            }

            long size = f.getSize();
            try {
                Resource newRes = putable.createNew( name, f.getInputStream(), size, null );
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

                    log.trace("file exists, and overwrite parameters is set, so allow overwrite: " + initialName);
                    return initialName;
                } else {
                    if (!autoname) {
                        log.warn("Conflict: Can't create resource with name " + initialName + " because it already exists. To rename automatically use request parameter: " + PARAM_AUTONAME + ", or to overwrite use " + PARAM_OVERWRITE);
                        throw new ConflictException(this);
                    } else {
                        log.trace("file exists and autoname is set, so will find acceptable name");
                    }
                }
            }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

        } else {
            if (i < 100) {
                return findAcceptableName(baseName, ext, i + 1);
            } else {
                log.warn("Too many files with similar names: " + candidateName);
                throw new ConflictException(this);
            }
        }
    }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

                    if (rChild instanceof DeletableResource) {
                        DeletableResource rChildDel = (DeletableResource) rChild;
                        delete(rChildDel);
                    } else {
                        log.warn( "Couldnt delete child resource: " + rChild.getName() + " of type; " + rChild.getClass().getName() + " because it does not implement: " + DeletableResource.class.getCanonicalName());
                        throw new ConflictException( rChild );
                    }
                }
            }
            r.delete();
           
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

        XmldbURI destCollection = ((MiltonCollection) rDest).getXmldbUri();
        try {
            existDocument.resourceCopyMove(destCollection, newName, Mode.MOVE);

        } catch (EXistException ex) {
            throw new ConflictException(this);
        }
    }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

            LOG.debug(ex.getMessage());
            throw new NotAuthorizedException(this);

        } catch (CollectionExistsException | EXistException ex) {
            LOG.debug(ex.getMessage());
            throw new ConflictException(this);

        }

        return collection;
    }
View Full Code Here

Examples of com.bradmcevoy.http.exceptions.ConflictException

            resource = new MiltonDocument(host, resourceURI, brokerPool, subject);

        } catch (PermissionDeniedException | CollectionDoesNotExistException | IOException e) {
            LOG.debug(e.getMessage());
            throw new ConflictException(this);

        }
        return resource;
    }
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.