|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ovanttasks.ovnative.win32.UrlFile
public class UrlFile
UrlFile reads and writes Windows Shortcut files in the .url format. It can be used to create or read url files which are used by Microsoft for Shortcuts and Favorites.
see windows shortcut url urlFile format for details of the urlFile format.*
UrlFile sf = new UrlFile(new File(Win32 .getSpecialDirectory(Win32.SPECIALDIRECTORY_PERSONAL_DESKTOP), "Go to ROXES Technologies.url")); sf.setUrl(new URL("http://www.roxes.com")); sf.setIconFile("C:\\winnt\\explorer.exe"); sf.setIconIndex(1); // create desktop shortcut sf.save(); // dump created shortcut to console System.out.println(sf); // create favorite // save shortcut in internet explorer favorites directory sf.save(new File(Win32 .getSpecialDirectory(Win32.SPECIALDIRECTORY_PERSONAL_FAVORITES), "Go to ROXES Technologies.url"));
Field Summary | |
---|---|
static String |
LINE_BREAK
|
static int |
SHOWCOMMAND_MAXIMIZED
|
static int |
SHOWCOMMAND_MINIMIZED
|
static int |
SHOWCOMMAND_NORMAL
|
static String |
SIGNATURE
|
Constructor Summary | |
---|---|
UrlFile(File urlFile,
boolean load)
Create a new LnkFile instance for a specified location. |
|
UrlFile(String directory,
String name,
boolean load)
Create a new UrlFile instance for a specified location. |
Method Summary | |
---|---|
String |
getHotKey()
|
String |
getIconFile()
|
int |
getIconIndex()
|
String |
getModified()
|
int |
getShowCommand()
|
URL |
getUrl()
|
File |
getUrlFile()
|
String |
getWorkingDirectory()
|
void |
load()
|
void |
save()
|
void |
save(File file)
|
void |
save(String directory,
String name)
|
void |
setHotKey(String hotKey)
|
void |
setIcon(String iconFile,
int iconIndex)
|
void |
setModified(String string)
|
void |
setShowCommand(int i)
|
void |
setUrl(URL url)
|
void |
setWorkingDirectory(String string)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SIGNATURE
public static final String LINE_BREAK
public static final int SHOWCOMMAND_NORMAL
public static final int SHOWCOMMAND_MAXIMIZED
public static final int SHOWCOMMAND_MINIMIZED
Constructor Detail |
---|
public UrlFile(File urlFile, boolean load) throws IOException
LnkFile
instance for a specified location.
If load
is true
the instance of
LnkFile
is initialized with the values from the lnkFile
.
The native library is also loaded.
urlFile
- The lnkFile to useload
- wether or not load the data from existing file.
IOException
public UrlFile(String directory, String name, boolean load) throws IOException
UrlFile
instance for a specified location.
{@link File#File(java.lang.String, java.lang.String)
If load
is true
the instance of
UrlFile
is initialized with the values from the file.
The native library is also loaded.
directory
- The parent pathname stringname
- The child pathnameload
- wether or not load the data from existing file.
IOException
Method Detail |
---|
public void load() throws IOException
IOException
public File getUrlFile()
public String toString()
toString
in class Object
public int getIconIndex()
public String getModified()
public int getShowCommand()
public URL getUrl()
public String getWorkingDirectory()
public void setModified(String string)
string
- modification datepublic void setShowCommand(int i)
i
- the show command to use (see the SHOWCOMMAND_* constants)public void setUrl(URL url)
url
- url to openpublic void setWorkingDirectory(String string)
string
- the working directorypublic void save(String directory, String name) throws IOException
IOException
public void save() throws IOException
IOException
public void save(File file) throws IOException
IOException
public String getHotKey()
public String getIconFile()
public void setHotKey(String hotKey)
public void setIcon(String iconFile, int iconIndex)
iconFile
- the icon urlFile to use (valid urlFile types are exe, dll and ico)iconIndex
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |