Class ShellLinkHelper
-
- All Implemented Interfaces:
public final class ShellLinkHelperHelper class to manipulate ShellLink properties in batches for common tasks ShellLink can be used directly without helper for more detailed set up
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumShellLinkHelper.Optionspublic classShellLinkHelper.Companion
-
Field Summary
Fields Modifier and Type Field Description private ShellLinklinkpublic final static ShellLinkHelper.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description ShellLinkHelper(ShellLink link)
-
Method Summary
Modifier and Type Method Description final ShellLinkgetLink()final UnitsetLink(ShellLink value)final ShellLinkHelpersetNetworkTarget(String path)Sets LAN target path final ShellLinkHelpersetNetworkTarget(String path, ShellLinkHelper.Options options)Sets LAN target path final ShellLinkHelpersetLocalTarget(String drive, String absolutePath)Sets target on local computer, e.g. final ShellLinkHelpersetLocalTarget(String drive, String absolutePath, ShellLinkHelper.Options options)Sets target on local computer, e.g. final ShellLinkHelpersetSpecialFolderTarget(GUID root, String path, ShellLinkHelper.Options options)Sets target relative to a special folder defined by a GUID. final ShellLinkHelpersetDesktopRelativeTarget(String path, ShellLinkHelper.Options options)Sets target relative to desktop directory of the user opening the link. final ShellLinkHelpersaveTo(String path)Serializes ShellLinkto specifiedpath.-
-
Constructor Detail
-
ShellLinkHelper
ShellLinkHelper(ShellLink link)
-
-
Method Detail
-
setNetworkTarget
final ShellLinkHelper setNetworkTarget(String path)
Sets LAN target path
- Parameters:
path- is an absolute in the form '\\host\share\path\to\target'
-
setNetworkTarget
final ShellLinkHelper setNetworkTarget(String path, ShellLinkHelper.Options options)
Sets LAN target path
- Parameters:
path- is an absolute in the form '\\host\share\path\to\target'
-
setLocalTarget
final ShellLinkHelper setLocalTarget(String drive, String absolutePath)
Sets target on local computer, e.g. "C:\path\to\target"
- Parameters:
drive- is a letter part of the path, e.g.absolutePath- is a path in the specified drive, e.g.
-
setLocalTarget
final ShellLinkHelper setLocalTarget(String drive, String absolutePath, ShellLinkHelper.Options options)
Sets target on local computer, e.g. "C:\path\to\target"
- Parameters:
drive- is a letter part of the path, e.g.absolutePath- is a path in the specified drive, e.g.
-
setSpecialFolderTarget
final ShellLinkHelper setSpecialFolderTarget(GUID root, String path, ShellLinkHelper.Options options)
Sets target relative to a special folder defined by a GUID. Use Registry class to get an available GUID by name or predefined constants. Note that you can add your own GUIDs available on your system
- Parameters:
root- a GUID defining a special folder, e.g.path- a path relative to the special folder, e.g.
-
setDesktopRelativeTarget
final ShellLinkHelper setDesktopRelativeTarget(String path, ShellLinkHelper.Options options)
Sets target relative to desktop directory of the user opening the link. This method is universal because it works without Registry.CLSID_DESKTOP which is available only on later systems
- Parameters:
path- a path relative to the desktop, e.g.
-
saveTo
final ShellLinkHelper saveTo(String path)
Serializes
ShellLinkto specifiedpath. Sets appropriate relative path and working directory if possible and if they are not already set
-
-
-
-