Add disabled test to dump cache

This commit is contained in:
Adam
2015-10-17 20:19:37 -04:00
parent 0c022eef3e
commit eee5f72d4e

View File

@@ -1,5 +1,6 @@
package net.runelite.cache.fs;
import java.io.FileOutputStream;
import java.io.IOException;
import org.junit.Test;
@@ -12,4 +13,36 @@ public class StoreLoadTest
store.load();
System.out.println(store);
}
//@Test
public void unpackStore() throws IOException
{
java.io.File base = new java.io.File("d:/rs/07/cache");
try (Store store = new Store(base))
{
store.load();
for (Index i : store.getIndexes())
{
java.io.File ifile = new java.io.File(base, "" + i.getId());
ifile.mkdir();
for (Archive a : i.getArchives())
{
java.io.File afile = new java.io.File(ifile, "" + a.getArchiveId());
afile.mkdir();
for (File f : a.getFiles())
{
java.io.File ffile = new java.io.File(afile, "" + f.getFileId());
try (FileOutputStream fout = new FileOutputStream(ffile))
{
if (f.getContents() != null)
fout.write(f.getContents());
}
}
}
}
}
}
}