@Override public void setValue(String value) throws IOException { if (value != null) { checkSize(value.getBytes().length); } attribute.setValue(value); }
@Override public void setContent(File file) throws IOException { checkSize(file.length()); if (file.length() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(file); }
@Override public void setContent(ByteBuf buffer) throws IOException { checkSize(buffer.readableBytes()); if (buffer.readableBytes() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(buffer); }
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (attribute instanceof MemoryAttribute) { checkSize(attribute.length() + buffer.readableBytes()); if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName(), attribute.definedLength()); diskAttribute.setMaxSize(maxSize); if (((MemoryAttribute) attribute).getByteBuf() != null) { diskAttribute.addContent(((MemoryAttribute) attribute) .getByteBuf(), false); } attribute = diskAttribute; } } attribute.addContent(buffer, last); }
@Override public void setValue(String value) throws IOException { if (value != null) { checkSize(value.getBytes().length); } attribute.setValue(value); }
@Override public void setValue(String value) throws IOException { if (value != null) { checkSize(value.getBytes().length); } attribute.setValue(value); }
@Override public void setValue(String value) throws IOException { if (value != null) { checkSize(value.getBytes().length); } attribute.setValue(value); }
@Override public void setValue(String value) throws IOException { if (value != null) { checkSize(value.getBytes().length); } attribute.setValue(value); }
@Override public void setContent(ByteBuf buffer) throws IOException { checkSize(buffer.readableBytes()); if (buffer.readableBytes() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(buffer); }
@Override public void setContent(ByteBuf buffer) throws IOException { checkSize(buffer.readableBytes()); if (buffer.readableBytes() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(buffer); }
@Override public void setContent(File file) throws IOException { checkSize(file.length()); if (file.length() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(file); }
@Override public void setContent(File file) throws IOException { checkSize(file.length()); if (file.length() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(file); }
@Override public void setContent(ByteBuf buffer) throws IOException { checkSize(buffer.readableBytes()); if (buffer.readableBytes() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(buffer); }
@Override public void setContent(ByteBuf buffer) throws IOException { checkSize(buffer.readableBytes()); if (buffer.readableBytes() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(buffer); }
@Override public void setContent(File file) throws IOException { checkSize(file.length()); if (file.length() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(file); }
@Override public void setContent(File file) throws IOException { checkSize(file.length()); if (file.length() > limitSize) { if (attribute instanceof MemoryAttribute) { // change to Disk attribute = new DiskAttribute(attribute.getName(), attribute.definedLength()); attribute.setMaxSize(maxSize); } } attribute.setContent(file); }
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (attribute instanceof MemoryAttribute) { checkSize(attribute.length() + buffer.readableBytes()); if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName(), attribute.definedLength()); diskAttribute.setMaxSize(maxSize); if (((MemoryAttribute) attribute).getByteBuf() != null) { diskAttribute.addContent(((MemoryAttribute) attribute) .getByteBuf(), false); } attribute = diskAttribute; } } attribute.addContent(buffer, last); }
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (attribute instanceof MemoryAttribute) { checkSize(attribute.length() + buffer.readableBytes()); if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName(), attribute.definedLength()); diskAttribute.setMaxSize(maxSize); if (((MemoryAttribute) attribute).getByteBuf() != null) { diskAttribute.addContent(((MemoryAttribute) attribute) .getByteBuf(), false); } attribute = diskAttribute; } } attribute.addContent(buffer, last); }
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (attribute instanceof MemoryAttribute) { checkSize(attribute.length() + buffer.readableBytes()); if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName(), attribute.definedLength()); diskAttribute.setMaxSize(maxSize); if (((MemoryAttribute) attribute).getByteBuf() != null) { diskAttribute.addContent(((MemoryAttribute) attribute) .getByteBuf(), false); } attribute = diskAttribute; } } attribute.addContent(buffer, last); }
@Override public void addContent(ByteBuf buffer, boolean last) throws IOException { if (attribute instanceof MemoryAttribute) { checkSize(attribute.length() + buffer.readableBytes()); if (attribute.length() + buffer.readableBytes() > limitSize) { DiskAttribute diskAttribute = new DiskAttribute(attribute .getName(), attribute.definedLength()); diskAttribute.setMaxSize(maxSize); if (((MemoryAttribute) attribute).getByteBuf() != null) { diskAttribute.addContent(((MemoryAttribute) attribute) .getByteBuf(), false); } attribute = diskAttribute; } } attribute.addContent(buffer, last); }