@Override public void setReadOnly() { proxy.setReadOnly(); }
@Override public void setReadOnly() { bucket.setReadOnly(); }
/** * The parameters match the member variables of {@link FCPPluginMessage}, and thus their JavaDoc * applies. */ public FCPPluginServerMessage(String pluginname, String identifier2, SimpleFieldSet fs, Bucket bucket2, Boolean success, String errorCode, String errorMessage) { bucket = bucket2; if (bucket == null) dataLength = -1; else { bucket.setReadOnly(); dataLength = bucket.size(); } plugname = pluginname; identifier = identifier2; plugparams = fs; this.success = success; this.errorCode = errorCode; this.errorMessage = errorMessage; }
/** * Create an ArchiveStoreElement from a TempStoreElement. * @param key2 The key of the archive the file came from. * @param realName The name of the file in that archive. * @param temp The TempStoreElement currently storing the data. * @param manager The parent ArchiveManager within which this item is stored. */ RealArchiveStoreItem(ArchiveStoreContext ctx, FreenetURI key2, String realName, Bucket bucket) { super(new ArchiveKey(key2, realName), ctx); if(bucket == null) throw new NullPointerException(); mb = new MultiReaderBucket(bucket); this.bucket = mb.getReaderBucket(); if(this.bucket == null) throw new NullPointerException(); this.bucket.setReadOnly(); spaceUsed = this.bucket.size(); }
private void finalizeBucket(boolean mark) throws IOException, BinaryBlobAlreadyClosedException { if (_finalized) throw new BinaryBlobAlreadyClosedException("Already finalized (closing blob - 2)."); if(logMINOR) Logger.minor(this, "Finalizing binary blob "+this, new Exception("debug")); if (!_isSingleBucket) { if (!mark && (_buckets.size()==1)) { return; } Bucket out = _bf.makeBucket(-1); getSnapshot(out, mark); for (int i=0,n=_buckets.size(); i<n;i++) { _buckets.get(i).free(); } if (mark) { out.setReadOnly(); } _buckets.clear(); _buckets.add(0, out); } else if (mark){ DataOutputStream out = new DataOutputStream(getOutputStream()); try { BinaryBlob.writeEndBlob(out); } finally { out.close(); } } if (mark) { _finalized = true; } }