Author: toad
Date: 2008-07-29 14:42:39 +0000 (Tue, 29 Jul 2008)
New Revision: 21476
Modified:
branches/db4o/freenet/src/freenet/client/FetchResult.java
branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
Log:
Maybe fix bogus MIME type on downloading downloaded stuff from /queue/
Modified: branches/db4o/freenet/src/freenet/client/FetchResult.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FetchResult.java 2008-07-29
13:33:02 UTC (rev 21475)
+++ branches/db4o/freenet/src/freenet/client/FetchResult.java 2008-07-29
14:42:39 UTC (rev 21476)
@@ -5,6 +5,8 @@
import java.io.IOException;
+import com.db4o.ObjectContainer;
+
import freenet.support.api.Bucket;
import freenet.support.io.BucketTools;
@@ -32,8 +34,11 @@
/** Get the MIME type of the fetched data.
* If unknown, returns application/octet-stream. */
- public String getMimeType() {
- return metadata.getMIMEType();
+ public String getMimeType(ObjectContainer container) {
+ if(container != null)
+ container.activate(metadata, 1);
+ String ret = metadata.getMIMEType();
+ return ret;
}
public ClientMetadata getMetadata() {
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java 2008-07-29
13:33:02 UTC (rev 21475)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java 2008-07-29
14:42:39 UTC (rev 21476)
@@ -407,7 +407,7 @@
progressPending = null;
this.foundDataLength = returnBucket.size();
if(!binaryBlob)
- this.foundDataMimeType = result.getMimeType();
+ this.foundDataMimeType =
result.getMimeType(persistenceType == PERSIST_FOREVER ? container : null);
else
this.foundDataMimeType = BinaryBlob.MIME_TYPE;
this.succeeded = true;