Class Win32Link


  • public class Win32Link
    extends java.lang.Object
    A MS Windows Shortcut (*.LNK) file builder, pure Java port. Supports MS WebFolders.
    Version:
    $Revision: 27753 $ 7-7-04 cleaned up some documentation 3-3-03 partial WinNT5 functionality Note: Some Win9x functionality based on Jesse Hager's "The Windows Shortcut File Format" Document Version 1.0
    Author:
    ggongaware _at_ itensil _dot_ com
    • Constructor Detail

      • Win32Link

        public Win32Link()
    • Method Detail

      • setWebfolder

        public void setWebfolder​(java.lang.String displayName,
                                 java.lang.String URL,
                                 java.lang.String baseURL)
        Parameters:
        displayName - - internal display name
        URL - - the folder destination (ex: http://abc.org/pub/docs/)
        baseURL - - the oldest anscestor folder you can recursively browse up to
      • setWebfile

        public void setWebfile​(java.lang.String displayName,
                               java.lang.String URL,
                               java.lang.String baseURL)
        Parameters:
        displayName - - internal display name
        URL - - the file destination (ex: http://abc.org/pub/docs/report.xls)
        baseURL - - the oldest anscestor folder you can recursively browse up to
      • load

        public void load​(java.lang.String fileName)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public void load​(java.io.File file)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save​(java.lang.String fileName)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save​(java.io.File file)
                  throws java.io.IOException
        Write out a *.lnk file
        Parameters:
        file -
        Throws:
        java.io.IOException
      • getBytes

        public byte[] getBytes()
        Build and return the bytes that would appear in the *.lnk file
        Returns:
        byte[] the buffer
      • getCommandlineArgs

        public java.lang.String getCommandlineArgs()
        Returns the commandlineArgs.
        Returns:
        String
      • getCreateTime

        public long getCreateTime()
        Returns the createTime.
        Returns:
        long
      • getDescription

        public java.lang.String getDescription()
        Returns the description.
        Returns:
        String
      • getFileAttibutes

        public int getFileAttibutes()
        Returns the fileAttibutes.
        Returns:
        int
      • getFileLength

        public int getFileLength()
        Returns the fileLength.
        Returns:
        int
      • getHotKey

        public int getHotKey()
        Returns the hotKey.
        Returns:
        int
      • getIconFile

        public java.lang.String getIconFile()
        Returns the iconFile.
        Returns:
        String
      • getIconNumber

        public int getIconNumber()
        Returns the iconNumber.
        Returns:
        int
      • getLastAccessTime

        public long getLastAccessTime()
        Returns the lastAccessTime.
        Returns:
        long
      • getModifiedTime

        public long getModifiedTime()
        Returns the modifiedTime.
        Returns:
        long
      • getRelativePath

        public java.lang.String getRelativePath()
        Returns the relativePath.
        Returns:
        String
      • getShowWindow

        public int getShowWindow()
        Returns the showWindow.
        Returns:
        int
      • getWorkingDirectory

        public java.lang.String getWorkingDirectory()
        Returns the workingDirectory.
        Returns:
        String
      • setCommandlineArgs

        public void setCommandlineArgs​(java.lang.String commandlineArgs)
        Sets the commandlineArgs.
        Parameters:
        commandlineArgs - The commandlineArgs to set
      • setCreateTime

        public void setCreateTime​(long createTime)
        Sets the createTime.
        Parameters:
        createTime - The createTime to set
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description.
        Parameters:
        description - The description to set
      • setFileAttibutes

        public void setFileAttibutes​(int fileAttibutes)
        Sets the fileAttibutes.
        Parameters:
        fileAttibutes - The fileAttibutes to set
      • setFileLength

        public void setFileLength​(int fileLength)
        Sets the fileLength.
        Parameters:
        fileLength - The fileLength to set
      • setHotKey

        public void setHotKey​(int hotKey)
        Sets the hotKey.
        Parameters:
        hotKey - The hotKey to set
      • setIconFile

        public void setIconFile​(java.lang.String iconFile)
        Sets the iconFile.
        Parameters:
        iconFile - The iconFile to set
      • setIconNumber

        public void setIconNumber​(int iconNumber)
        Sets the iconNumber.
        Parameters:
        iconNumber - The iconNumber to set
      • setLastAccessTime

        public void setLastAccessTime​(long lastAccessTime)
        Sets the lastAccessTime.
        Parameters:
        lastAccessTime - The lastAccessTime to set
      • setModifiedTime

        public void setModifiedTime​(long modifiedTime)
        Sets the modifiedTime.
        Parameters:
        modifiedTime - The modifiedTime to set
      • setRelativePath

        public void setRelativePath​(java.lang.String relativePath)
        Sets the relativePath.
        Parameters:
        relativePath - The relativePath to set
      • setShowWindow

        public void setShowWindow​(int showWindow)
        Sets the showWindow.
        Parameters:
        showWindow - The showWindow to set
      • setWorkingDirectory

        public void setWorkingDirectory​(java.lang.String workingDirectory)
        Sets the workingDirectory.
        Parameters:
        workingDirectory - The workingDirectory to set
      • getUnicode

        public boolean getUnicode()
        Are the internal string Multi-byte unicode? (UTF-16)
        Returns:
        boolean for unicode state
      • setUnicode

        public void setUnicode​(boolean unicode)
        Set internal strings to Multi-byte unicode (UTF-16)
        Parameters:
        unicode -
      • addItemId

        public void addItemId​(Win32Link.ItemID item)
        Add another ItemId to the trail of ItemIds
        Parameters:
        item -