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 volatile String uniquePath;
38 private static ResourceBundle bundle = ResourceBundle.getBundle(
"org.sleuthkit.datamodel.Bundle");
51 protected Volume(
SleuthkitCase db,
long obj_id,
long addr,
long startSector,
long lengthInSectors,
long flags, String desc) {
52 super(db, obj_id,
"vol" + Long.toString(addr));
54 this.startSector = startSector;
55 this.lengthInSectors = lengthInSectors;
56 this.uniquePath = null;
58 if (!desc.equals(
"")) {
61 this.desc = bundle.getString(
"Volume.desc.text");
70 throw new TskCoreException(bundle.getString(
"Volume.read.exception.msg1.text"));
72 VolumeSystem parentVs = (VolumeSystem) myParent;
80 if (volumeHandle == 0) {
95 @SuppressWarnings(
"deprecation")
107 return lengthInSectors * 512;
114 if(uniquePath == null) {
115 String tempUniquePath =
"";
117 if (!name.isEmpty()) {
118 tempUniquePath =
"/vol_" + name;
122 if (myParent != null) {
127 uniquePath = tempUniquePath;
160 return lengthInSectors;
204 if (flag.getVsFlag() == vsFlag) {
205 result = flag.toString();
223 if (flag.toString().equals(vsFlag)) {
224 result = flag.getVsFlag();
248 if ((vsFlag & allocFlag) == allocFlag) {
249 result = bundle.getString(
"Volume.vsFlagToString.allocated");
251 if ((vsFlag & unallocFlag) == unallocFlag) {
252 result = bundle.getString(
"Volume.vsFlagToString.unallocated");
261 return v.
visit(
this);
265 public <T> T accept(ContentVisitor<T> v) {
266 return v.visit(
this);
287 List<FileSystem> fileSystems =
new ArrayList<FileSystem>();
288 for (
Content child : children) {
290 fileSystems.add((FileSystem) child);
299 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.
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.
TSK_VS_TYPE_ENUM getType()
static String vsFlagToString(long vsFlag)