public OutputStream createOutputStream( long offset ) throws IOException {
log.debug( "createOutputStream: " + offset );
final BufferingOutputStream out = new BufferingOutputStream( 50000 );
if( r instanceof ReplaceableResource ) {
log.debug( "resource is replaceable" );
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) {