com.jalios.jcms.webdav
Class Win32Link

java.lang.Object
  extended by com.jalios.jcms.webdav.Win32Link

public class Win32Link
extends 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
static interface Win32Link.ItemID
          Items ids, similar to the MS Shell API's struct SHITEMID
 class Win32Link.MyComputerId
          The Root item of a local Machine "My Computer"
 class Win32Link.URLFileId
          A File in a webfolder
 class Win32Link.URLFolderId
          A Folder (path) of a webfolder
 class Win32Link.WebFoldersId
          The Root of "WebFolders"
 
Field Summary
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 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
Win32Link()
           
 
Method Summary
 void addItemId(Win32Link.ItemID item)
          Add another ItemId to the trail of ItemIds
 byte[] getBytes()
          Build and return the bytes that would appear in the *.lnk file
 String getCommandlineArgs()
          Returns the commandlineArgs.
 long getCreateTime()
          Returns the createTime.
 String getDescription()
          Returns the description.
 int getFileAttibutes()
          Returns the fileAttibutes.
 int getFileLength()
          Returns the fileLength.
 int getHotKey()
          Returns the hotKey.
 String getIconFile()
          Returns the iconFile.
 int getIconNumber()
          Returns the iconNumber.
 long getLastAccessTime()
          Returns the lastAccessTime.
 long getModifiedTime()
          Returns the modifiedTime.
 String getRelativePath()
          Returns the relativePath.
 int getShowWindow()
          Returns the showWindow.
 boolean getUnicode()
          Are the internal string Multi-byte unicode? (UTF-16)
 String getWorkingDirectory()
          Returns the workingDirectory.
 void load(File file)
           
 void load(String fileName)
           
 void save(File file)
          Write out a *.lnk file
 void save(String fileName)
           
 void setCommandlineArgs(String commandlineArgs)
          Sets the commandlineArgs.
 void setCreateTime(long createTime)
          Sets the createTime.
 void setDescription(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(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(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(String displayName, String URL, String baseURL)
           
 void setWebfolder(String displayName, String URL, String baseURL)
           
 void setWorkingDirectory(String workingDirectory)
          Sets the workingDirectory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final 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
Constructor Detail

Win32Link

public Win32Link()
Method Detail

setWebfolder

public void setWebfolder(String displayName,
                         String URL,
                         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(String displayName,
                       String URL,
                       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(String fileName)
          throws IOException
Throws:
IOException

load

public void load(File file)
          throws IOException
Throws:
IOException

save

public void save(String fileName)
          throws IOException
Throws:
IOException

save

public void save(File file)
          throws IOException
Write out a *.lnk file

Parameters:
file -
Throws:
IOException

getBytes

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

Returns:
byte[] the buffer

getCommandlineArgs

public String getCommandlineArgs()
Returns the commandlineArgs.

Returns:
String

getCreateTime

public long getCreateTime()
Returns the createTime.

Returns:
long

getDescription

public 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 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 String getRelativePath()
Returns the relativePath.

Returns:
String

getShowWindow

public int getShowWindow()
Returns the showWindow.

Returns:
int

getWorkingDirectory

public String getWorkingDirectory()
Returns the workingDirectory.

Returns:
String

setCommandlineArgs

public void setCommandlineArgs(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(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(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(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(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 -


Copyright © 2001-2010 Jalios SA. All Rights Reserved.