Add disabled test to dump cache
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package net.runelite.cache.fs;
|
package net.runelite.cache.fs;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@@ -12,4 +13,36 @@ public class StoreLoadTest
|
|||||||
store.load();
|
store.load();
|
||||||
System.out.println(store);
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user