Package com.jalios.jcms.webdav
Class Win32Link
- java.lang.Object
-
- com.jalios.jcms.webdav.Win32Link
-
public class Win32Link extends java.lang.ObjectA 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWin32Link.ItemIDItems ids, similar to the MS Shell API's struct SHITEMIDclassWin32Link.MyComputerIdThe Root item of a local Machine "My Computer"classWin32Link.URLFileIdA File in a webfolderclassWin32Link.URLFolderIdA Folder (path) of a webfolderclassWin32Link.WebFoldersIdThe Root of "WebFolders"
-
Field Summary
Fields Modifier and Type Field Description static intFA_ARCHIVEstatic intFA_COMPRESSEDstatic intFA_DIRECTORYstatic intFA_ENCRYPTEDstatic intFA_HIDDENstatic intFA_NORMALstatic intFA_OFFLINEstatic intFA_READ_ONLYstatic intFA_REPARSEstatic intFA_SPARSEstatic intFA_SYSTEMstatic intFA_TEMPORARYstatic java.lang.StringREVISIONstatic intSW_HIDEstatic intSW_MINIMIZEstatic intSW_NORMALstatic intSW_RESTOREstatic intSW_SHOWstatic intSW_SHOWDEFAULTstatic intSW_SHOWMAXIMIZEDstatic intSW_SHOWMINIMIZEDstatic intSW_SHOWMINNOACTIVEstatic intSW_SHOWNAstatic intSW_SHOWNOACTIVATEstatic intVF_LOCALstatic intVF_NETWORK
-
Constructor Summary
Constructors Constructor Description Win32Link()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemId(Win32Link.ItemID item)Add another ItemId to the trail of ItemIdsbyte[]getBytes()Build and return the bytes that would appear in the *.lnk filejava.lang.StringgetCommandlineArgs()Returns the commandlineArgs.longgetCreateTime()Returns the createTime.java.lang.StringgetDescription()Returns the description.intgetFileAttibutes()Returns the fileAttibutes.intgetFileLength()Returns the fileLength.intgetHotKey()Returns the hotKey.java.lang.StringgetIconFile()Returns the iconFile.intgetIconNumber()Returns the iconNumber.longgetLastAccessTime()Returns the lastAccessTime.longgetModifiedTime()Returns the modifiedTime.java.lang.StringgetRelativePath()Returns the relativePath.intgetShowWindow()Returns the showWindow.booleangetUnicode()Are the internal string Multi-byte unicode? (UTF-16)java.lang.StringgetWorkingDirectory()Returns the workingDirectory.voidload(java.io.File file)voidload(java.lang.String fileName)voidsave(java.io.File file)Write out a *.lnk filevoidsave(java.lang.String fileName)voidsetCommandlineArgs(java.lang.String commandlineArgs)Sets the commandlineArgs.voidsetCreateTime(long createTime)Sets the createTime.voidsetDescription(java.lang.String description)Sets the description.voidsetFileAttibutes(int fileAttibutes)Sets the fileAttibutes.voidsetFileLength(int fileLength)Sets the fileLength.voidsetHotKey(int hotKey)Sets the hotKey.voidsetIconFile(java.lang.String iconFile)Sets the iconFile.voidsetIconNumber(int iconNumber)Sets the iconNumber.voidsetLastAccessTime(long lastAccessTime)Sets the lastAccessTime.voidsetModifiedTime(long modifiedTime)Sets the modifiedTime.voidsetRelativePath(java.lang.String relativePath)Sets the relativePath.voidsetShowWindow(int showWindow)Sets the showWindow.voidsetUnicode(boolean unicode)Set internal strings to Multi-byte unicode (UTF-16)voidsetWebfile(java.lang.String displayName, java.lang.String URL, java.lang.String baseURL)voidsetWebfolder(java.lang.String displayName, java.lang.String URL, java.lang.String baseURL)voidsetWorkingDirectory(java.lang.String workingDirectory)Sets the workingDirectory.
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
FA_READ_ONLY
public static final int FA_READ_ONLY
- See Also:
- Constant Field Values
-
FA_HIDDEN
public static final int FA_HIDDEN
- See Also:
- Constant Field Values
-
FA_SYSTEM
public static final int FA_SYSTEM
- See Also:
- Constant Field Values
-
FA_DIRECTORY
public static final int FA_DIRECTORY
- See Also:
- Constant Field Values
-
FA_ARCHIVE
public static final int FA_ARCHIVE
- See Also:
- Constant Field Values
-
FA_ENCRYPTED
public static final int FA_ENCRYPTED
- See Also:
- Constant Field Values
-
FA_NORMAL
public static final int FA_NORMAL
- See Also:
- Constant Field Values
-
FA_TEMPORARY
public static final int FA_TEMPORARY
- See Also:
- Constant Field Values
-
FA_SPARSE
public static final int FA_SPARSE
- See Also:
- Constant Field Values
-
FA_REPARSE
public static final int FA_REPARSE
- See Also:
- Constant Field Values
-
FA_COMPRESSED
public static final int FA_COMPRESSED
- See Also:
- Constant Field Values
-
FA_OFFLINE
public static final int FA_OFFLINE
- See Also:
- Constant Field Values
-
SW_HIDE
public static final int SW_HIDE
- See Also:
- Constant Field Values
-
SW_NORMAL
public static final int SW_NORMAL
- See Also:
- Constant Field Values
-
SW_SHOWMINIMIZED
public static final int SW_SHOWMINIMIZED
- See Also:
- Constant Field Values
-
SW_SHOWMAXIMIZED
public static final int SW_SHOWMAXIMIZED
- See Also:
- Constant Field Values
-
SW_SHOWNOACTIVATE
public static final int SW_SHOWNOACTIVATE
- See Also:
- Constant Field Values
-
SW_SHOW
public static final int SW_SHOW
- See Also:
- Constant Field Values
-
SW_MINIMIZE
public static final int SW_MINIMIZE
- See Also:
- Constant Field Values
-
SW_SHOWMINNOACTIVE
public static final int SW_SHOWMINNOACTIVE
- See Also:
- Constant Field Values
-
SW_SHOWNA
public static final int SW_SHOWNA
- See Also:
- Constant Field Values
-
SW_RESTORE
public static final int SW_RESTORE
- See Also:
- Constant Field Values
-
SW_SHOWDEFAULT
public static final int SW_SHOWDEFAULT
- See Also:
- Constant Field Values
-
VF_LOCAL
public static final int VF_LOCAL
- See Also:
- Constant Field Values
-
VF_NETWORK
public static final int VF_NETWORK
- See Also:
- Constant Field Values
-
-
Method Detail
-
setWebfolder
public void setWebfolder(java.lang.String displayName, java.lang.String URL, java.lang.String baseURL)- Parameters:
displayName- - internal display nameURL- - 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 nameURL- - 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.IOExceptionWrite 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-
-
-