19 package org.sleuthkit.datamodel;
21 import java.util.ResourceBundle;
22 import java.util.ArrayList;
23 import java.util.List;
32 private long startSector;
33 private long lengthInSectors;
36 private volatile long volumeHandle = 0;
37 private static ResourceBundle bundle = ResourceBundle.getBundle(
"org.sleuthkit.datamodel.Bundle");
50 protected Volume(
SleuthkitCase db,
long obj_id,
long addr,
long startSector,
long lengthInSectors,
long flags, String desc) {
51 super(db, obj_id,
"vol" + Long.toString(addr));
53 this.startSector = startSector;
54 this.lengthInSectors = lengthInSectors;
56 if (!desc.equals(
"")) {
59 this.desc = bundle.getString(
"Volume.desc.text");
68 throw new TskCoreException(bundle.getString(
"Volume.read.exception.msg1.text"));
70 VolumeSystem parentVs = (VolumeSystem) myParent;
78 if (volumeHandle == 0) {
104 return lengthInSectors * 512;
109 String uniquePath =
"";
111 if (!name.isEmpty()) {
112 uniquePath =
"/vol_" + name;
116 if (myParent != null) {
150 return lengthInSectors;
194 if (flag.getVsFlag() == vsFlag) {
195 result = flag.toString();
213 if (flag.toString().equals(vsFlag)) {
214 result = flag.getVsFlag();
238 if ((vsFlag & allocFlag) == allocFlag) {
239 result = bundle.getString(
"Volume.vsFlagToString.allocated");
241 if ((vsFlag & unallocFlag) == unallocFlag) {
242 result = bundle.getString(
"Volume.vsFlagToString.unallocated");
251 return v.
visit(
this);
255 public <T> T accept(ContentVisitor<T> v) {
256 return v.visit(
this);
277 List<FileSystem> fileSystems =
new ArrayList<FileSystem>();
278 for (
Content child : children) {
280 fileSystems.add((FileSystem) child);
289 return super.toString(preserveState) +
"Volume [\t" +
"addr " + addr +
"\t" +
"desc " + desc +
"\t" +
"flags " + flags +
"\t" +
"length " + lengthInSectors +
"\t" +
"start " + startSector +
"]\t";
TSK_VS_PART_FLAG_ALL
Show all sectors in the walk.
synchronized Content getParent()
static long valueToVsFlag(String vsFlag)
TSK_VS_PART_FLAG_ALLOC
Sectors are allocated to a volume in the volume system.
int read(byte[] buf, long offset, long len)
List< FileSystem > getFileSystems()
TSK_VS_TYPE_APFS
APFS pool NON-NLS.
synchronized long getVolumeSystemHandle()
String toString(boolean preserveState)
TSK_VS_PART_FLAG_META
Sectors contain volume system metadata and could also be ALLOC or UNALLOC.
Volume(SleuthkitCase db, long obj_id, long addr, long startSector, long lengthInSectors, long flags, String desc)
static int readVsPart(long volHandle, byte[] readBuffer, long offset, long len)
List< Long > getChildrenIds()
String getFlagsAsString()
static String vsFlagToValue(long vsFlag)
List< Content > getChildren()
SleuthkitCase getSleuthkitCase()
static long openVsPart(long vsHandle, long volId)
TSK_VS_PART_FLAG_UNALLOC
Sectors are not allocated to a volume.
synchronized String getUniquePath()
TSK_VS_TYPE_ENUM getType()
static String vsFlagToString(long vsFlag)