Package ghidra.formats.gfilesystem
Class FSRLRoot
- java.lang.Object
-
- ghidra.formats.gfilesystem.FSRL
-
- ghidra.formats.gfilesystem.FSRLRoot
-
public class FSRLRoot extends FSRL
A type ofFSRL
that is specific to the filesystem's identity. A FSRL's parent is always a FSRLRoot.A FSRLRoot's parent is always a FSRL (ie. the container the filesystem data is in), or null.
Examples of relationship between FSRL and FSRLRoots:
- FSRLRoot [ file:// ]
"file://" - FSRLRoot [ file:// ] <---- FSRL [ /filename.txt ]
"file:///filename.txt" - FSRLRoot [ file:// ] <---- FSRL [ /filename.txt ] <--- FSRLRoot [ subfs:// ]
"file:///filename.txt|subfs://"
- FSRLRoot [ file:// ]
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendToStringBuilder(java.lang.StringBuilder sb, boolean recurse, boolean includeParams, boolean includeFSRoot)
FSRL
getContainer()
Returns the parent containerfile FSRL, or null if this FSRLRoot specifies a root-level filesystem.FSRLRoot
getFS()
Returns theFSRLRoot
object that represents the entirefilesystem
for this FSRL.java.lang.String
getName()
Always returns null for a FSRLRoot.java.lang.String
getPath()
Always returns null for a FSRLRoot.java.lang.String
getProtocol()
Returns the "protocol" portion of this FSRLRoot, for example, in a FSRLRoot of "file://", this method would return "file".boolean
hasContainer()
Returns true if there is a parent containerfile, or false if this FSRLRoot specifies a root-level filesystem.int
hashCode()
static FSRLRoot
makeRoot(java.lang.String protocol)
Creates aFSRLRoot
without a parent container, using the suppliedprotocol
string as its type.static FSRLRoot
nestedFS(FSRL containerFile, FSRLRoot copyFSRL)
Create a copy ofcopyFSRL
, but using a differentcontainerFile
parent.static FSRLRoot
nestedFS(FSRL containerFile, java.lang.String fstype)
FSRL
withPathMD5(java.lang.String newPath, java.lang.String newMD5)
-
Methods inherited from class ghidra.formats.gfilesystem.FSRL
appendPath, convertRootToContainer, equals, fromString, fromString, getMD5, getName, getNestingDepth, isDescendantOf, isEquivalent, isEquivalent, isMD5Equal, makeNested, split, toPrettyFullpathString, toPrettyString, toString, toStringPart, withMD5, withPath, withPath
-
-
-
-
Method Detail
-
makeRoot
public static FSRLRoot makeRoot(java.lang.String protocol)
Creates aFSRLRoot
without a parent container, using the suppliedprotocol
string as its type.- Parameters:
protocol
- string protocol name- Returns:
- new
FSRLRoot
instance.
-
nestedFS
public static FSRLRoot nestedFS(FSRL containerFile, FSRLRoot copyFSRL)
Create a copy ofcopyFSRL
, but using a differentcontainerFile
parent.(ie. re-parents copyFSRL so its parent is containerFile)
-
getFS
public FSRLRoot getFS()
Description copied from class:FSRL
Returns theFSRLRoot
object that represents the entirefilesystem
for this FSRL.Never returns NULL, and calling getFS() on a
FSRLRoot
object returns itself.
-
getProtocol
public java.lang.String getProtocol()
Returns the "protocol" portion of this FSRLRoot, for example, in a FSRLRoot of "file://", this method would return "file".- Returns:
- string protocol / filesystem type.
-
getContainer
public FSRL getContainer()
Returns the parent containerfile FSRL, or null if this FSRLRoot specifies a root-level filesystem.- Returns:
FSRL
of the container object that this filesystem is nested under.
-
hasContainer
public boolean hasContainer()
Returns true if there is a parent containerfile, or false if this FSRLRoot specifies a root-level filesystem.- Returns:
- boolean true if this
FSRLRoot
has a parent container, or false if not.
-
getPath
public java.lang.String getPath()
Always returns null for a FSRLRoot.
-
getName
public java.lang.String getName()
Always returns null for a FSRLRoot.
-
withPathMD5
public FSRL withPathMD5(java.lang.String newPath, java.lang.String newMD5)
-
appendToStringBuilder
protected void appendToStringBuilder(java.lang.StringBuilder sb, boolean recurse, boolean includeParams, boolean includeFSRoot)
- Overrides:
appendToStringBuilder
in classFSRL
-
-