Package com.jalios.jcms.webdav
Class Win32Link
- java.lang.Object
-
- com.jalios.jcms.webdav.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Win32Link.ItemID
Items ids, similar to the MS Shell API's struct SHITEMIDclass
Win32Link.MyComputerId
The Root item of a local Machine "My Computer"class
Win32Link.URLFileId
A File in a webfolderclass
Win32Link.URLFolderId
A Folder (path) of a webfolderclass
Win32Link.WebFoldersId
The Root of "WebFolders"
-
Field Summary
Fields Modifier and Type Field Description static int
FA_ARCHIVE
static int
FA_COMPRESSED
static int
FA_DIRECTORY
static int
FA_ENCRYPTED
static int
FA_HIDDEN
static int
FA_NORMAL
static int
FA_OFFLINE
static int
FA_READ_ONLY
static int
FA_REPARSE
static int
FA_SPARSE
static int
FA_SYSTEM
static int
FA_TEMPORARY
static java.lang.String
REVISION
static int
SW_HIDE
static int
SW_MINIMIZE
static int
SW_NORMAL
static int
SW_RESTORE
static int
SW_SHOW
static int
SW_SHOWDEFAULT
static int
SW_SHOWMAXIMIZED
static int
SW_SHOWMINIMIZED
static int
SW_SHOWMINNOACTIVE
static int
SW_SHOWNA
static int
SW_SHOWNOACTIVATE
static int
VF_LOCAL
static int
VF_NETWORK
-
Constructor Summary
Constructors Constructor Description Win32Link()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItemId(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.String
getCommandlineArgs()
Returns the commandlineArgs.long
getCreateTime()
Returns the createTime.java.lang.String
getDescription()
Returns the description.int
getFileAttibutes()
Returns the fileAttibutes.int
getFileLength()
Returns the fileLength.int
getHotKey()
Returns the hotKey.java.lang.String
getIconFile()
Returns the iconFile.int
getIconNumber()
Returns the iconNumber.long
getLastAccessTime()
Returns the lastAccessTime.long
getModifiedTime()
Returns the modifiedTime.java.lang.String
getRelativePath()
Returns the relativePath.int
getShowWindow()
Returns the showWindow.boolean
getUnicode()
Are the internal string Multi-byte unicode? (UTF-16)java.lang.String
getWorkingDirectory()
Returns the workingDirectory.void
load(java.io.File file)
void
load(java.lang.String fileName)
void
save(java.io.File file)
Write out a *.lnk filevoid
save(java.lang.String fileName)
void
setCommandlineArgs(java.lang.String commandlineArgs)
Sets the commandlineArgs.void
setCreateTime(long createTime)
Sets the createTime.void
setDescription(java.lang.String description)
Sets the description.void
setFileAttibutes(int fileAttibutes)
Sets the fileAttibutes.void
setFileLength(int fileLength)
Sets the fileLength.void
setHotKey(int hotKey)
Sets the hotKey.void
setIconFile(java.lang.String iconFile)
Sets the iconFile.void
setIconNumber(int iconNumber)
Sets the iconNumber.void
setLastAccessTime(long lastAccessTime)
Sets the lastAccessTime.void
setModifiedTime(long modifiedTime)
Sets the modifiedTime.void
setRelativePath(java.lang.String relativePath)
Sets the relativePath.void
setShowWindow(int showWindow)
Sets the showWindow.void
setUnicode(boolean unicode)
Set internal strings to Multi-byte unicode (UTF-16)void
setWebfile(java.lang.String displayName, java.lang.String URL, java.lang.String baseURL)
void
setWebfolder(java.lang.String displayName, java.lang.String URL, java.lang.String baseURL)
void
setWorkingDirectory(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.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
-
-
-