diff --git a/apps/i2psnark/java/src/org/klomp/snark/Storage.java b/apps/i2psnark/java/src/org/klomp/snark/Storage.java index 00117c807..381909807 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/Storage.java +++ b/apps/i2psnark/java/src/org/klomp/snark/Storage.java @@ -76,7 +76,6 @@ public class Storage throws IOException { this.listener = listener; - // Create names, rafs and lengths arrays. getFiles(baseFile); @@ -132,13 +131,14 @@ public class Storage // Creates piece hases for a new storage. public void create() throws IOException { - if (true) { +// if (true) { fast_digestCreate(); - } else { - orig_digestCreate(); - } +// } else { +// orig_digestCreate(); +// } } +/* private void orig_digestCreate() throws IOException { // Calculate piece_hashes MessageDigest digest = null; @@ -174,6 +174,7 @@ public class Storage // Reannounce to force recalculating the info_hash. metainfo = metainfo.reannounce(metainfo.getAnnounce()); } +*/ private void fast_digestCreate() throws IOException { // Calculate piece_hashes @@ -368,7 +369,7 @@ public class Storage int size = files.size(); for (int i = 0; i < size; i++) { - File f = createFileFromNames(base, (List)files.get(i)); + File f = getFileFromNames(base, (List)files.get(i)); if (!f.exists()) throw new IOException("Could not reopen file " + f); if (!f.canWrite()) // see above re: only seeding @@ -415,6 +416,17 @@ public class Storage return f; } + private File getFileFromNames(File base, List names) throws IOException + { + Iterator it = names.iterator(); + while (it.hasNext()) + { + String name = filterName((String)it.next()); + base = new File(base, name); + } + return base; + } + private void checkCreateFiles() throws IOException { // Whether we are resuming or not, diff --git a/history.txt b/history.txt index 24982775f..7e7c14e3e 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,7 @@ -$Id: history.txt,v 1.551 2007-02-15 18:25:04 jrandom Exp $ +$Id: history.txt,v 1.552 2007-02-28 21:22:16 zzz Exp $ + +2007-02-28 zzz + * i2psnark: File reopen cleanup 2007-02-28 zzz * i2psnark: Add peer details to web page diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index ed9883309..bde39ea69 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.487 $ $Date: 2007-02-15 18:25:06 $"; + public final static String ID = "$Revision: 1.488 $ $Date: 2007-02-28 21:22:14 $"; public final static String VERSION = "0.6.1.27"; - public final static long BUILD = 1; + public final static long BUILD = 2; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID);