Package com.twelvemonkeys.io
Class Win32Lnk
- java.lang.Object
-
- java.io.File
-
- com.twelvemonkeys.io.Win32Lnk
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
final class Win32Lnk extends java.io.FileAFileimplementation that resolves the Windows.lnkfiles as symbolic links.This class is based on example code from Swing Hacks, By Joshua Marinacci, Chris Adamson (O'Reilly, ISBN: 0-596-00907-0), Hack 30.
- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/Win32Lnk.java#2 $
-
-
Field Summary
Fields Modifier and Type Field Description private static intFLAG_ADDITIONAL_INFOprivate static intFLAG_COMMAND_LINE_ARGSprivate static intFLAG_DESC_STRINGprivate static intFLAG_FILE_LOC_INFOprivate static intFLAG_ICON_FILENAMEprivate static intFLAG_ITEM_ID_LISTprivate static intFLAG_REL_PATH_STRINGprivate static intFLAG_WORKING_DIRECTORYprivate static byte[]LNK_GUIDprivate static byte[]LNK_MAGICprivate java.io.Filetarget
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead()booleancanWrite()booleanexists()java.io.FilegetCanonicalFile()java.lang.StringgetCanonicalPath()java.io.FilegetTarget()Converts two bytes into a short.booleanisDirectory()booleanisFile()booleanisHidden()longlastModified()longlength()java.lang.String[]list()java.lang.String[]list(java.io.FilenameFilter filter)java.io.File[]listFiles()java.io.File[]listFiles(java.io.FileFilter filter)java.io.File[]listFiles(java.io.FilenameFilter filter)(package private) static java.io.Fileparse(java.io.File pPath)Parses a.lnkfile to find the real file.booleansetLastModified(long time)booleansetReadOnly()java.lang.StringtoString()-
Methods inherited from class java.io.File
canExecute, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getAbsolutePath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setReadable, setReadable, setWritable, setWritable, toPath, toURI, toURL
-
-
-
-
Field Detail
-
LNK_MAGIC
private static final byte[] LNK_MAGIC
-
LNK_GUID
private static final byte[] LNK_GUID
-
target
private final java.io.File target
-
FLAG_ITEM_ID_LIST
private static final int FLAG_ITEM_ID_LIST
- See Also:
- Constant Field Values
-
FLAG_FILE_LOC_INFO
private static final int FLAG_FILE_LOC_INFO
- See Also:
- Constant Field Values
-
FLAG_DESC_STRING
private static final int FLAG_DESC_STRING
- See Also:
- Constant Field Values
-
FLAG_REL_PATH_STRING
private static final int FLAG_REL_PATH_STRING
- See Also:
- Constant Field Values
-
FLAG_WORKING_DIRECTORY
private static final int FLAG_WORKING_DIRECTORY
- See Also:
- Constant Field Values
-
FLAG_COMMAND_LINE_ARGS
private static final int FLAG_COMMAND_LINE_ARGS
- See Also:
- Constant Field Values
-
FLAG_ICON_FILENAME
private static final int FLAG_ICON_FILENAME
- See Also:
- Constant Field Values
-
FLAG_ADDITIONAL_INFO
private static final int FLAG_ADDITIONAL_INFO
- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
static java.io.File parse(java.io.File pPath) throws java.io.IOExceptionParses a.lnkfile to find the real file.- Parameters:
pPath- the path to the.lnkfile- Returns:
- a new file object that
- Throws:
java.io.IOException- if the.lnkcannot be parsed
-
getTarget
public java.io.File getTarget()
Converts two bytes into a short.NOTE: this is little endian because it's for an Intel only OS
- Returns:
- the bytes as a short.
-
isDirectory
public boolean isDirectory()
- Overrides:
isDirectoryin classjava.io.File
-
canRead
public boolean canRead()
- Overrides:
canReadin classjava.io.File
-
canWrite
public boolean canWrite()
- Overrides:
canWritein classjava.io.File
-
exists
public boolean exists()
- Overrides:
existsin classjava.io.File
-
getCanonicalFile
public java.io.File getCanonicalFile() throws java.io.IOException- Overrides:
getCanonicalFilein classjava.io.File- Throws:
java.io.IOException
-
getCanonicalPath
public java.lang.String getCanonicalPath() throws java.io.IOException- Overrides:
getCanonicalPathin classjava.io.File- Throws:
java.io.IOException
-
isFile
public boolean isFile()
- Overrides:
isFilein classjava.io.File
-
isHidden
public boolean isHidden()
- Overrides:
isHiddenin classjava.io.File
-
lastModified
public long lastModified()
- Overrides:
lastModifiedin classjava.io.File
-
length
public long length()
- Overrides:
lengthin classjava.io.File
-
list
public java.lang.String[] list()
- Overrides:
listin classjava.io.File
-
list
public java.lang.String[] list(java.io.FilenameFilter filter)
- Overrides:
listin classjava.io.File
-
listFiles
public java.io.File[] listFiles()
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FileFilter filter)
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FilenameFilter filter)
- Overrides:
listFilesin classjava.io.File
-
setLastModified
public boolean setLastModified(long time)
- Overrides:
setLastModifiedin classjava.io.File
-
setReadOnly
public boolean setReadOnly()
- Overrides:
setReadOnlyin classjava.io.File
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.io.File
-
-