Set file name hashes
This commit is contained in:
@@ -560,6 +560,7 @@ public class Index implements Closeable
|
|||||||
stream.writeInt(this.revision);
|
stream.writeInt(this.revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.named = true;
|
||||||
stream.writeByte((this.named ? 1 : 0) | (this.usesWhirpool ? 2 : 0));
|
stream.writeByte((this.named ? 1 : 0) | (this.usesWhirpool ? 2 : 0));
|
||||||
if (protocol >= 7)
|
if (protocol >= 7)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class StoreTest
|
|||||||
Index index = store.addIndex(0);
|
Index index = store.addIndex(0);
|
||||||
Archive archive = index.addArchive(0);
|
Archive archive = index.addArchive(0);
|
||||||
File file = archive.addFile(0);
|
File file = archive.addFile(0);
|
||||||
|
file.setNameHash(7);
|
||||||
file.setContents("test".getBytes());
|
file.setContents("test".getBytes());
|
||||||
|
|
||||||
store.save();
|
store.save();
|
||||||
@@ -54,7 +55,7 @@ public class StoreTest
|
|||||||
for (int i = 0; i < NUMBER_OF_FILES; ++i)
|
for (int i = 0; i < NUMBER_OF_FILES; ++i)
|
||||||
{
|
{
|
||||||
File file = archive.addFile(i);
|
File file = archive.addFile(i);
|
||||||
// file.setNameHash(random.nextInt());
|
file.setNameHash(random.nextInt());
|
||||||
byte[] data = new byte[random.nextInt(1024)];
|
byte[] data = new byte[random.nextInt(1024)];
|
||||||
random.nextBytes(data);
|
random.nextBytes(data);
|
||||||
file.setContents(data);
|
file.setContents(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user