Package net.sourceforge.jnlp.util
Class WindowsDesktopEntry
- java.lang.Object
-
- net.sourceforge.jnlp.util.WindowsDesktopEntry
-
- All Implemented Interfaces:
GenericDesktopEntry
public class WindowsDesktopEntry extends java.lang.Object implements GenericDesktopEntry
Based on https://github.com/DmitriiShamrikov/mslinks
-
-
Field Summary
Fields Modifier and Type Field Description private JNLPFilefileprivate LazyLoaded<java.lang.String>iconLocationprivate static LoggerLOG
-
Constructor Summary
Constructors Constructor Description WindowsDesktopEntry(JNLPFile file)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDesktopShortcuts(AccessWarningPaneComplexReturn.ShortcutResult menu, AccessWarningPaneComplexReturn.ShortcutResult desktop)voidcreateShortcutOnWindowsDesktop()voidcreateWindowsMenu()private static java.lang.StringdesktopPath()java.io.FilegetDesktopIconFile()private java.lang.StringgetDesktopLnkPath()java.io.FilegetGeneratedJnlpFileName()private java.lang.StringgetJavaWsBin()java.io.FilegetLinuxMenuIconFile()private java.lang.StringgetShortcutFileName()private java.lang.StringgetShortcutName()private voidmanageShortcutList(java.lang.String path)private booleanneedToAddNewShortcutEntry(java.lang.String path, java.util.List<java.lang.String> lines)private java.lang.Stringquoted(java.net.URL url)private java.util.List<java.lang.String>readAllLines(java.io.File shortcutFile)voidrefreshExistingShortcuts(boolean desktop, boolean menu)private java.lang.Stringsanitize(java.lang.String fileName)
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
file
private final JNLPFile file
-
iconLocation
private final LazyLoaded<java.lang.String> iconLocation
-
-
Constructor Detail
-
WindowsDesktopEntry
public WindowsDesktopEntry(JNLPFile file)
-
-
Method Detail
-
getShortcutFileName
private java.lang.String getShortcutFileName()
-
getShortcutName
private java.lang.String getShortcutName()
-
sanitize
private java.lang.String sanitize(java.lang.String fileName)
-
getDesktopLnkPath
private java.lang.String getDesktopLnkPath()
-
getDesktopIconFile
public java.io.File getDesktopIconFile()
- Specified by:
getDesktopIconFilein interfaceGenericDesktopEntry
-
createShortcutOnWindowsDesktop
public void createShortcutOnWindowsDesktop() throws java.io.IOException- Specified by:
createShortcutOnWindowsDesktopin interfaceGenericDesktopEntry- Throws:
java.io.IOException
-
getJavaWsBin
private java.lang.String getJavaWsBin() throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
createWindowsMenu
public void createWindowsMenu() throws java.io.IOException- Specified by:
createWindowsMenuin interfaceGenericDesktopEntry- Throws:
java.io.IOException
-
manageShortcutList
private void manageShortcutList(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
readAllLines
private java.util.List<java.lang.String> readAllLines(java.io.File shortcutFile) throws java.io.IOException- Throws:
java.io.IOException
-
needToAddNewShortcutEntry
private boolean needToAddNewShortcutEntry(java.lang.String path, java.util.List<java.lang.String> lines)
-
createDesktopShortcuts
public void createDesktopShortcuts(AccessWarningPaneComplexReturn.ShortcutResult menu, AccessWarningPaneComplexReturn.ShortcutResult desktop)
- Specified by:
createDesktopShortcutsin interfaceGenericDesktopEntry
-
refreshExistingShortcuts
public void refreshExistingShortcuts(boolean desktop, boolean menu)- Specified by:
refreshExistingShortcutsin interfaceGenericDesktopEntry
-
getGeneratedJnlpFileName
public java.io.File getGeneratedJnlpFileName()
- Specified by:
getGeneratedJnlpFileNamein interfaceGenericDesktopEntry
-
getLinuxMenuIconFile
public java.io.File getLinuxMenuIconFile()
- Specified by:
getLinuxMenuIconFilein interfaceGenericDesktopEntry
-
quoted
private java.lang.String quoted(java.net.URL url)
-
desktopPath
private static java.lang.String desktopPath()
-
-