Package ghidra.framework.data

# Class FolderLinkContentHandler

java.lang.Object
ghidra.framework.data.DBContentHandler<T>
ghidra.framework.data.LinkHandler<ghidra.framework.data.NullFolderDomainObject>
ghidra.framework.data.FolderLinkContentHandler

All Implemented Interfaces:
  `ContentHandler<ghidra.framework.data.NullFolderDomainObject>`, `ExtensionPoint`

public class FolderLinkContentHandler extends LinkHandler<ghidra.framework.data.NullFolderDomainObject>
`FolderLinkContentHandler` provide folder-link support. Implementation relies on `AppInfo.getActiveProject()` to provide life-cycle management for related transient-projects opened while following folder-links.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FOLDER_LINK_CONTENT_TYPE`
  `static FolderLinkContentHandler`
  `INSTANCE`

  ### Fields inherited from class ghidra.framework.data.LinkHandler

  `LINK_ICON, URL_METADATA_KEY`

  ### Fields inherited from interface ghidra.framework.data.ContentHandler

  `MISSING_CONTENT, UNKNOWN_CONTENT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FolderLinkContentHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `createFile(FileSystem fs, FileSystem userfs, String path, String name, DomainObject obj, TaskMonitor monitor)`
  Creates a new folder item within a specified file-system.
  `String`
  `getContentType()`
  Returns a unique content-type identifier
  `String`
  `getContentTypeDisplayString()`
  A string that is meant to be presented to the user.
  `String`
  `getDefaultToolName()`
  Returns the name of the default tool/template that should be used to open this content type.
  `Class<ghidra.framework.data.NullFolderDomainObject>`
  `getDomainObjectClass()`
  Returns domain object implementation class supported.
  `Icon`
  `getIcon()`
  Get the base icon for this link-file which does not include the link overlay icon.
  `static LinkedGhidraFolder`
  `getReadOnlyLinkedFolder(DomainFile folderLinkFile)`
  Get linked domain folder

  ### Methods inherited from class ghidra.framework.data.LinkHandler

  `createLink, getChangeSet, getDomainObject, getImmutableObject, getMergeManager, getReadOnlyObject, getURL, isPrivateContentType`

  ### Methods inherited from class ghidra.framework.data.DBContentHandler

  `abortCreate, createFile`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.framework.data.ContentHandler

  `getLinkHandler`

- ## Field Details

  - ### INSTANCE

    public static FolderLinkContentHandler INSTANCE

  - ### FOLDER_LINK_CONTENT_TYPE

    public static final String FOLDER_LINK_CONTENT_TYPE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### FolderLinkContentHandler

    public FolderLinkContentHandler()

- ## Method Details

  - ### createFile

    public long createFile(FileSystem fs, FileSystem userfs, String path, String name, DomainObject obj, TaskMonitor monitor) throws IOException, InvalidNameException, CancelledException
    Description copied from interface: `ContentHandler`
    Creates a new folder item within a specified file-system. If fs is versioned, the resulting item is marked as checked-out within the versioned file-system. The specified domainObj will become associated with the newly created database.
    Parameters:
      `fs` - the file system in which to create the folder item
      `userfs` - file system which contains associated user data
      `path` - the path of the folder item
      `name` - the name of the new folder item
      `obj` - the domain object to store in the newly created folder item
      `monitor` - the monitor that allows the user to cancel
    Returns:
      checkout ID for new item
    Throws:
      `IOException` - if an IO error occurs or an unsupported `domainObject` implementation is specified.
      `InvalidNameException` - if the specified name contains invalid characters
      `CancelledException` - if the user cancels

  - ### getContentType

    public String getContentType()
    Description copied from interface: `ContentHandler`
    Returns a unique content-type identifier
    Returns:
      content type identifier for associated domain object(s).

  - ### getContentTypeDisplayString

    public String getContentTypeDisplayString()
    Description copied from interface: `ContentHandler`
    A string that is meant to be presented to the user.
    Returns:
      user friendly content type for associated domain object(s).

  - ### getDomainObjectClass

    public Class<ghidra.framework.data.NullFolderDomainObject> getDomainObjectClass()
    Description copied from interface: `ContentHandler`
    Returns domain object implementation class supported.
    Returns:
      implementation class for the associated `DomainObjectAdapter` implementation.

  - ### getIcon

    public Icon getIcon()
    Description copied from class: `LinkHandler`
    Get the base icon for this link-file which does not include the link overlay icon.
    Specified by:
      `getIcon` in interface `ContentHandler<ghidra.framework.data.NullFolderDomainObject>`
    Specified by:
      `getIcon` in class `LinkHandler<ghidra.framework.data.NullFolderDomainObject>`
    Returns:
      base icon to be used for a `DomainFile` with the associated content type.

  - ### getDefaultToolName

    public String getDefaultToolName()
    Description copied from interface: `ContentHandler`
    Returns the name of the default tool/template that should be used to open this content type.
    Returns:
      associated default tool name for this content type

  - ### getReadOnlyLinkedFolder

    public static LinkedGhidraFolder getReadOnlyLinkedFolder(DomainFile folderLinkFile) throws IOException
    Get linked domain folder
    Parameters:
      `folderLinkFile` - folder-link file.
    Returns:
      `LinkedGhidraFolder` referenced by specified folder-link file or null if folderLinkFile content type is not "FolderLink".
    Throws:
      `IOException` - if an IO or folder item access error occurs