All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.core.SystemInterface
java.lang.Object
|
+----com.sun.wizards.core.SystemInterface
- public class SystemInterface
- extends Object
The SystemInterface class is the interface between the wizard
and the native system. This class is used to get/set file
permissions and attributes as well as read/write to the native
system registry.
-
SystemInterface()
- Creates an instance of the SystemInterface object.
-
attach()
- Attaches the native support to this proxy class.
-
createDesktopFolder(String)
- Creates a desktop folder
-
createDesktopItem(String, String, String, String)
- Creates a desktop item for the specified command.
-
createDesktopItems(Vector)
- Creates many desktop item for the specified commands.
-
detach()
- Detaches the native support from this proxy class.
-
getComponent(String)
- Return an install description of the specified component.
-
getComponent(String, String)
- Return an install description of the specified component.
-
getComponent(String, String, int)
- Return an install description of the specified component.
-
getFileAttributes(File)
- Returns a string representing the file attributes of the specified
file.
-
getHomeDirectory()
- Returns the user's home directory, or a good alternative to
that directory on systems that are not multiuser.
-
getJavaCommand(String, String[], String)
- Returns a string that can be used to execute the specified Java
application with the specified CLASSPATH.
-
getLibraryDirectory()
- Returns the directory in which shared libraries should be
installed.
-
getLogFileDirectory()
- Returns the directory in which system logs might go.
-
getNamedFolderList(String, String)
- Gets a list of folders that are in the specified folder.
-
getPartitionFreeSpace(String)
- Returns the space available on the specified partition.
-
getPartitionNames()
- Returns an array of String representing all
partition names.
-
getStandardInstallDirectory()
- Returns the directory in which programs should be installed
by default.
-
getStaticNativeLibraryDir()
- Returns the directory where temporary native support will be written.
-
getTempDirectory()
- Returns the temporary directory.
-
main(String[])
-
-
registerComponent(ComponentDescription)
- Register the specified component.
-
removeDesktopFolder(String)
- Removes a desktop folder.
-
removeDesktopItem(String, String)
- Removes a desktop item.
-
setFileAttributes(File, String)
- Sets the attributes of the specified file.
-
setFileAttributes(File[], String[])
- Sets the attributes of the specified files.
-
unregisterComponent(ComponentDescription)
- Unregister the specified component.
SystemInterface
public SystemInterface()
- Creates an instance of the SystemInterface object.
getStaticNativeLibraryDir
public String getStaticNativeLibraryDir()
- Returns the directory where temporary native support will be written.
This call does not perform a native system call.
attach
public void attach()
- Attaches the native support to this proxy class.
detach
public void detach()
- Detaches the native support from this proxy class.
getLibraryDirectory
public String getLibraryDirectory()
- Returns the directory in which shared libraries should be
installed.
- Returns:
- The shared library directory.
getLogFileDirectory
public String getLogFileDirectory()
- Returns the directory in which system logs might go.
- Returns:
- The log file directory
getStandardInstallDirectory
public String getStandardInstallDirectory()
- Returns the directory in which programs should be installed
by default.
- Returns:
- The common program install directory.
getTempDirectory
public String getTempDirectory()
- Returns the temporary directory.
- Returns:
- The temporary directory.
getHomeDirectory
public String getHomeDirectory()
- Returns the user's home directory, or a good alternative to
that directory on systems that are not multiuser. Windows 95,
for example, does not have a good concept of a home directory,
and some versions of Java will report any random directory.
- Returns:
- The user's home directory.
getPartitionNames
public String[] getPartitionNames()
- Returns an array of String representing all
partition names.
- Returns:
- The list of partition names.
getJavaCommand
public String getJavaCommand(String applicationName,
String applicationArgs[],
String classpath)
- Returns a string that can be used to execute the specified Java
application with the specified CLASSPATH.
- Parameters:
- applicationName - The name of the Java application class.
- applicationArgs - The arguments to pass into the Java application.
- classpath - The CLASSPATH required to execute the specified application.
getPartitionFreeSpace
public long getPartitionFreeSpace(String partitionName)
- Returns the space available on the specified partition.
- Parameters:
- partitionName - The name of the partition to query.
- Returns:
- The free space on the named partition, in bytes.
getFileAttributes
public String getFileAttributes(File file)
- Returns a string representing the file attributes of the specified
file.
Attributes returned from this method are in the form of a string.
The characters within the string represent the attributes. The
supported attributes are as follows:
r This file can be read by everyone.
rU This file can be read by its owner.
rG This file can be read by the owner's group.
rO This file can be read by users outside the owner's group.
w This file can be modified by everyone.
wU This file can be modified by its owner.
wG This file can be modified by the owner's group.
wO This file can be modified by users outside the owner's group.
x This file can be executed by everyone.
xU This file can be executed by its owner.
xG This file can be executed by the owner's group.
xO This file can be executed by users outside the owner's group.
s This file is always executed as the user ID (and permissions) of the owner.
g This file is always executed as the group ID of the owner.
h This file is hidden.
t This is a text file.
a This file is marked to be included in the next backup.
- Parameters:
- file - The file to get the attributes from.
- Returns:
- A String representation of the file attributes that can be
passed in to SystemInterface.setFileAttributes().
setFileAttributes
public void setFileAttributes(File file,
String attributes)
- Sets the attributes of the specified file.
- Parameters:
- file - The file the attributes should be applied to.
- attributes - The String representation of the desired file attributes.
setFileAttributes
public void setFileAttributes(File files[],
String attributes[])
- Sets the attributes of the specified files. This does not simply call setFileAttributes(File, String)
once for each file/attribute pair.
- Parameters:
- files - The files the attributes should be applied to.
- attributes - The String representation of the desired file attributes, respective of the files list.
registerComponent
public void registerComponent(ComponentDescription component)
- Register the specified component.
- Parameters:
- component - The component description of the shared component to register.
unregisterComponent
public void unregisterComponent(ComponentDescription component)
- Unregister the specified component.
- Parameters:
- component - The component description of the shared component to unregister.
getComponent
public ComponentDescription getComponent(String guid)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getComponent
public ComponentDescription getComponent(String guid,
String installLocation)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- installLocation - The directory in which the component should be installed.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getComponent
public ComponentDescription getComponent(String guid,
String version,
int instance)
- Return an install description of the specified component.
- Parameters:
- guid - The Universal Unique Identifier of the desired component.
- version - The version of the desired component.
- instance - The installed instance of the desired component.
- Returns:
- The shared component description if the component is registered;
null otherwise.
getNamedFolderList
public String[] getNamedFolderList(String folderName,
String param)
- Gets a list of folders that are in the specified folder.
You can use the names to search recursively through the
folder tree
- Parameters:
- folderName - The name of the folder to search in.
- param - An optional param used by implementations to
specify additional parameters
- Returns:
- The list of items in this folder, or
null if the folder does not exist or is not
readable.
createDesktopItems
public boolean createDesktopItems(Vector targets)
- Creates many desktop item for the specified commands. For
example, on Microsoft Windows, an icon is placed on the
"Start" menu.
This version is useful for adding many desktop items at once, where the
act of adding something to the desktop is very expensive.
The list passed to this method should be a
Vector, with each member being a
String[] which contains (in order):
{folderName, title, target, iconName}, with
iconName being optional (as in
createDesktopItem() API).
- Parameters:
- targets - The list of desktop items to add. The list is
a
Vector, with each member being a
String[] which contains (in order):
{folderName, title, target, iconName}, with
iconName being optional (as in
createDesktopItem() API).
- Returns:
- Whether the item was able to be added or not.
createDesktopItem
public boolean createDesktopItem(String folderName,
String title,
String command,
String iconName)
- Creates a desktop item for the specified command. For
example, on Microsoft Windows, an icon is placed on the
"Start" menu.
- Parameters:
- folderName - The name of the folder to search in.
- title - The name of the item as it should appear
on-screen.
- command - The platform-specific command to activate when
this desktop item is selected by the user.
- iconPath - The absolute path To the file representing
the icon. The icon file format should be the correct one
for the platform. For example, on Sun Solaris, the icon
must be in
.xpm format. If no icon name is
supplied, none is used, or the default one is used for the
supplied command.
- Returns:
- Whether the item was able to be added or not.
removeDesktopItem
public boolean removeDesktopItem(String folderName,
String title)
- Removes a desktop item.
- Parameters:
- folderName - The name of the folder that the item to
remove is in.
- title - The name of the item as it appears on-screen.
- Returns:
- Whether the item was removed or not. If the item did
not exist in the first place,
false is returned.
createDesktopFolder
public boolean createDesktopFolder(String folderName)
- Creates a desktop folder
- Parameters:
- folderName - The name of the folder to search in.
- Returns:
- Whether the folder was created or not.
removeDesktopFolder
public boolean removeDesktopFolder(String folderName)
- Removes a desktop folder.
- Parameters:
- folderName - The name of the folder that the folder to
remove is in.
- title - The name of the folder as it appears on-screen.
- Returns:
- Whether the folder was removed or not. If the folder
did not exist in the first place,
false is
returned.
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index