Author: toad
Date: 2006-12-14 18:14:03 +0000 (Thu, 14 Dec 2006)
New Revision: 11395
Added:
trunk/freenet/src/freenet/support/api/PluginFetchResult.java
Modified:
trunk/freenet/src/freenet/plugin/api/ProvidesSimpleKeyFetch.java
Log:
Use PluginFetchResult instead of Bucket.
Modified: trunk/freenet/src/freenet/plugin/api/ProvidesSimpleKeyFetch.java
===================================================================
--- trunk/freenet/src/freenet/plugin/api/ProvidesSimpleKeyFetch.java
2006-12-14 18:09:45 UTC (rev 11394)
+++ trunk/freenet/src/freenet/plugin/api/ProvidesSimpleKeyFetch.java
2006-12-14 18:14:03 UTC (rev 11395)
@@ -5,6 +5,7 @@
import freenet.support.api.Bucket;
import freenet.support.api.PluginFetchException;
+import freenet.support.api.PluginFetchResult;
import freenet.support.api.PluginFreenetURI;
/**
@@ -13,6 +14,6 @@
*/
public interface ProvidesSimpleKeyFetch {
- public Bucket fetch(PluginFreenetURI uri) throws PluginFetchException;
+ public PluginFetchResult fetch(PluginFreenetURI uri) throws
PluginFetchException;
}
Added: trunk/freenet/src/freenet/support/api/PluginFetchResult.java
===================================================================
--- trunk/freenet/src/freenet/support/api/PluginFetchResult.java
(rev 0)
+++ trunk/freenet/src/freenet/support/api/PluginFetchResult.java
2006-12-14 18:14:03 UTC (rev 11395)
@@ -0,0 +1,19 @@
+package freenet.support.api;
+
+import java.io.InputStream;
+
+public interface PluginFetchResult {
+
+ /** MIME type of fetched data */
+ public String getMIMEType();
+
+ /** Get an InputStream for the data */
+ public InputStream getInputStream();
+
+ /** Get the size of the data */
+ public long size();
+
+ /** Finished with the data, can free it */
+ public void free();
+
+}