Package ghidra.formats.gfilesystem
Class FSRLRoot
- java.lang.Object
-
- ghidra.formats.gfilesystem.FSRL
-
- ghidra.formats.gfilesystem.FSRLRoot
-
public class FSRLRoot extends FSRL
A type ofFSRLthat 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 voidappendToStringBuilder(java.lang.StringBuilder sb, boolean recurse, boolean includeParams, boolean includeFSRoot)FSRLgetContainer()Returns the parent containerfile FSRL, or null if this FSRLRoot specifies a root-level filesystem.FSRLRootgetFS()Returns theFSRLRootobject that represents the entirefilesystemfor this FSRL.java.lang.StringgetName()Always returns null for a FSRLRoot.java.lang.StringgetPath()Always returns null for a FSRLRoot.java.lang.StringgetProtocol()Returns the "protocol" portion of this FSRLRoot, for example, in a FSRLRoot of "file://", this method would return "file".booleanhasContainer()Returns true if there is a parent containerfile, or false if this FSRLRoot specifies a root-level filesystem.inthashCode()static FSRLRootmakeRoot(java.lang.String protocol)Creates aFSRLRootwithout a parent container, using the suppliedprotocolstring as its type.static FSRLRootnestedFS(FSRL containerFile, FSRLRoot copyFSRL)Create a copy ofcopyFSRL, but using a differentcontainerFileparent.static FSRLRootnestedFS(FSRL containerFile, java.lang.String fstype)FSRLwithPathMD5(java.lang.String newPath, java.lang.String newMD5)-
Methods inherited from class ghidra.formats.gfilesystem.FSRL
appendPath, equals, fromString, fromString, getMD5, getName, getNestingDepth, isDescendantOf, isEquivalent, isEquivalent, makeNested, split, toPrettyFullpathString, toPrettyString, toString, toStringPart, withMD5, withPath, withPath
-
-
-
-
Method Detail
-
makeRoot
public static FSRLRoot makeRoot(java.lang.String protocol)
Creates aFSRLRootwithout a parent container, using the suppliedprotocolstring as its type.- Parameters:
protocol- string protocol name- Returns:
- new
FSRLRootinstance.
-
nestedFS
public static FSRLRoot nestedFS(FSRL containerFile, FSRLRoot copyFSRL)
Create a copy ofcopyFSRL, but using a differentcontainerFileparent.(ie. re-parents copyFSRL so its parent is containerFile)
-
getFS
public FSRLRoot getFS()
Description copied from class:FSRLReturns theFSRLRootobject that represents the entirefilesystemfor this FSRL.Never returns NULL, and calling getFS() on a
FSRLRootobject 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:
FSRLof 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
FSRLRoothas 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:
appendToStringBuilderin classFSRL
-
-