if (data.length > size) {
data = new byte[size];
System.arraycopy(buffer, 0, data, 0, size);
}
NodeStateBuilder fileBuilder =
store.getBuilder(getDirectory().getChildNode(name));
fileBuilder.setProperty(
"jcr:lastModified",
factory.createValue(System.currentTimeMillis()));
fileBuilder.setProperty(
"jcr:data",
factory.createValue(new ByteArrayInputStream(data)));
directoryBuilder.setNode(name, fileBuilder.getNodeState());
directory = null;
}