Package org.syncany.database
Class FileContent
- java.lang.Object
-
- org.syncany.database.FileContent
-
public class FileContent extends java.lang.Object
A file content represents the content of a file. It contains a list of references toChunkEntry
s, and identifies a content by its checksum.A file content is implicitly referenced by one or many
FileVersion
s through the checksum attribute. A file content always contains the full list of chunks it resembles. There are no deltas!Unlike the chunk list in a
MultiChunkEntry
, the order of the chunks is very important, because a file can only be reconstructed if the order of its chunks are followed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileContent.FileChecksum
-
Constructor Summary
Constructors Constructor Description FileContent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChunk(ChunkEntry.ChunkChecksum chunk)
boolean
equals(java.lang.Object obj)
FileContent.FileChecksum
getChecksum()
java.util.List<ChunkEntry.ChunkChecksum>
getChunks()
long
getSize()
int
hashCode()
void
setChecksum(FileContent.FileChecksum checksum)
void
setSize(long contentSize)
java.lang.String
toString()
-
-
-
Constructor Detail
-
FileContent
public FileContent()
-
-
Method Detail
-
addChunk
public void addChunk(ChunkEntry.ChunkChecksum chunk)
-
getChecksum
public FileContent.FileChecksum getChecksum()
-
setChecksum
public void setChecksum(FileContent.FileChecksum checksum)
-
getSize
public long getSize()
-
setSize
public void setSize(long contentSize)
-
getChunks
public java.util.List<ChunkEntry.ChunkChecksum> getChunks()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-