Package io.crums.client.repo
Class TrailRepo
java.lang.Object
io.crums.client.repo.TrailRepo
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class TrailRepo
extends java.lang.Object
implements java.io.Closeable
A local repo for CrumTrails.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
IDX_FILE
public static final java.lang.String IDX_FILEFixed width index table filename. (Created under dir.)- See Also:
- Constant Field Values
-
BLOB_FILE
public static final java.lang.String BLOB_FILE- See Also:
- Constant Field Values
-
-
Constructor Details
-
TrailRepo
public TrailRepo(java.io.File dir) throws java.io.IOExceptionCreates a read-write instance. If a repo exists under the given dir, it loads it; otherwise a new repo is created.- Parameters:
dir
- the directory in which the files will be managed- Throws:
java.io.IOException
-
TrailRepo
public TrailRepo(java.io.File dir, io.crums.io.Opening opening) throws java.io.IOExceptionCreates a new instance.- Throws:
java.io.IOException
-
-
Method Details
-
fence
public static java.nio.ByteBuffer fence() -
getDir
public final java.io.File getDir()Returns the directory this repo is rooted at. -
putTrail
-
getTrail
-
size
public long size() -
getIds
public java.util.List<java.lang.Long> getIds() -
isEmpty
public boolean isEmpty() -
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-