Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.ReplaceableResource.replaceContent()


            final ReplaceableResource rr = (ReplaceableResource) r;
            Runnable runnable = new Runnable() {

                public void run() {
                    try {
                        rr.replaceContent(out.getInputStream(), out.getSize());
                    } catch (BadRequestException ex) {
                        throw new RuntimeException(ex);
                    } catch (ConflictException ex) {
                        throw new RuntimeException(ex);
                    } catch (NotAuthorizedException ex) {
View Full Code Here


        log.trace("updateResourceContentActual: " + mergedFile.getAbsolutePath() + ", resource is replaceable");
        FileInputStream fin = null;
        try {
          fin = new FileInputStream(mergedFile);
          ReplaceableResource rr = (ReplaceableResource) r;
          rr.replaceContent(fin, mergedFile.length());
        } finally {
          StreamUtils.close(fin);
        }
      } else {
        log.trace("updateResourceContentActual: " + mergedFile.getAbsolutePath() + ", resource is NOT replaceable, try to replace through parent");
View Full Code Here

                Resource existing = wrapped.child(newName);
                if( existing != null ) {
                    if( existing instanceof ReplaceableResource ) {
                        log.trace("existing resource is replaceable, so replace content");
                        ReplaceableResource rr = (ReplaceableResource) existing;
                        rr.replaceContent(in, null);
                    } else {
                        log.trace("existing resource is not replaceable, will be deleted");
                        if( existing instanceof DeletableResource ) {
                            DeletableResource dr = (DeletableResource) existing;
                            dr.delete();
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.