|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.platform.macosx.PlatformManagerImpl
public class PlatformManagerImpl
Performs platform-specific operations with Mac OS X
PlatformManager
Field Summary | |
---|---|
protected static AEMonitor |
class_mon
|
protected static PlatformManagerImpl |
singleton
|
Fields inherited from interface org.gudy.azureus2.platform.PlatformManager |
---|
PT_MACOSX, PT_OTHER, PT_UNIX, PT_WINDOWS, SD_ALL, SD_HIBERNATE, SD_SHUTDOWN, SD_SLEEP, USER_REQUEST_INFO, USER_REQUEST_QUESTION, USER_REQUEST_WARNING |
Fields inherited from interface org.gudy.azureus2.plugins.platform.PlatformManager |
---|
LOC_DOCUMENTS, LOC_MUSIC, LOC_USER_DATA, LOC_VIDEO |
Constructor Summary | |
---|---|
PlatformManagerImpl()
Creates a new PlatformManager and initializes its capabilities |
Method Summary | |
---|---|
void |
addListener(PlatformManagerListener listener)
|
protected boolean |
checkPList()
|
protected static boolean |
compileOSAScript(CharSequence[] cmds,
File destination)
Compiles a new AppleScript instance to the specified location |
protected static boolean |
compileOSAScript(CharSequence cmd,
File destination)
Compiles a new AppleScript instance to the specified location |
void |
copyFilePermissions(String from_file_name,
String to_file_name)
|
void |
createProcess(String cmd,
boolean inheritsHandles)
|
void |
dispose()
Disposes system resources. |
void |
generate(IndentWriter writer)
|
String |
getApplicationCommandLine()
command to launch Vuze |
String |
getAzComputerID()
|
String |
getComputerName()
|
String[] |
getExplicitVMOptions()
|
File |
getLocation(long location_id)
Get a well-known location, if defined for the platform |
int |
getMaxOpenFiles()
This max-open-files concept here is from linux/osx where network connections are treated as 'files' |
int |
getPlatformType()
|
protected PListEditor |
getPList()
|
boolean |
getPreventComputerSleep()
|
boolean |
getRunAtLogin()
|
int |
getShutdownTypes()
|
static PlatformManagerImpl |
getSingleton()
Gets the platform manager singleton, which was already initialized |
String |
getUserDataDirectory()
|
String |
getVersion()
|
File |
getVMOptionFile()
|
boolean |
hasCapability(PlatformManagerCapabilities capability)
Gets whether the platform manager supports a capability |
boolean |
isAdditionalFileTypeRegistered(String name,
String type)
Checks to see if the supplied file type is registered with this application |
boolean |
isApplicationRegistered()
|
Class<?> |
loadClass(ClassLoader loader,
String class_name)
Gives a particular platform the ability to alter the class-loading method |
static void |
main(String[] args)
|
protected static String |
performOSAScript(CharSequence cmd)
Compiles a new AppleScript instance and runs it |
protected static String |
performOSAScript(CharSequence[] cmds)
Compiles a new AppleScript instance and runs it |
protected static String |
performOSAScript(File script)
Compiles a new AppleScript instance and runs it |
void |
performRecoverableFileDelete(String path)
|
protected static Process |
performRuntimeExec(String[] cmdargs)
|
void |
ping(InetAddress interface_address,
InetAddress target,
PlatformManagerPingCallback callback)
|
void |
playSystemAlert()
Plays the system alert (the jingle is specified by the user in System Preferences) |
void |
registerAdditionalFileType(String name,
String description,
String type,
String content_type)
Registers a file type with this application |
void |
registerApplication()
|
void |
removeListener(PlatformManagerListener listener)
|
void |
requestUserAttention(int type,
Object data)
If the application is not active causes the application icon at the bottom to bounce until the application becomes active If the application is already active then this method does nothing. |
void |
setExplicitVMOptions(String[] options)
|
void |
setPreventComputerSleep(boolean prevent_it)
|
void |
setRunAtLogin(boolean run)
|
void |
setTCPTOSEnabled(boolean enabled)
enable or disable the platforms support for TCP TOS |
void |
showFile(String path)
Reveals the file or directory with the platform's default browser |
void |
showInFinder(File path)
Shows the given file or directory in Finder |
void |
showInTerminal(File path)
Shows the given file or directory in Terminal by executing cd /absolute/path/to |
void |
showInTerminal(String path)
Shows the given file or directory in Terminal by executing cd /absolute/path/to |
void |
shutdown(int type)
|
void |
startup(AzureusCore _azureus_core)
|
boolean |
testNativeAvailability(String name)
|
protected void |
touchPList()
|
void |
traceRoute(InetAddress interface_address,
InetAddress target,
PlatformManagerPingCallback callback)
|
void |
unregisterAdditionalFileType(String name,
String type)
Removes a file-type registration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static PlatformManagerImpl singleton
protected static AEMonitor class_mon
Constructor Detail |
---|
public PlatformManagerImpl()
Method Detail |
---|
public static PlatformManagerImpl getSingleton()
public int getPlatformType()
public String getVersion() throws PlatformManagerException
PlatformManagerException
protected PListEditor getPList() throws IOException
IOException
protected boolean checkPList()
protected void touchPList()
public File getVMOptionFile() throws PlatformManagerException
PlatformManagerException
public String[] getExplicitVMOptions() throws PlatformManagerException
PlatformManagerException
public void setExplicitVMOptions(String[] options) throws PlatformManagerException
PlatformManagerException
public void startup(AzureusCore _azureus_core) throws PlatformManagerException
PlatformManagerException
public int getShutdownTypes()
public void shutdown(int type) throws PlatformManagerException
PlatformManagerException
public void setPreventComputerSleep(boolean prevent_it) throws PlatformManagerException
PlatformManagerException
public boolean getPreventComputerSleep()
public boolean getRunAtLogin() throws PlatformManagerException
PlatformManagerException
public void setRunAtLogin(boolean run) throws PlatformManagerException
PlatformManagerException
public String getUserDataDirectory() throws PlatformManagerException
PlatformManagerException
SystemProperties.getUserPath()
public String getComputerName()
getComputerName
in interface PlatformManager
public File getLocation(long location_id) throws PlatformManagerException
PlatformManager
getLocation
in interface PlatformManager
location_id
- from above LOC_constants
PlatformManagerException
public boolean isApplicationRegistered() throws PlatformManagerException
PlatformManagerException
public String getApplicationCommandLine() throws PlatformManagerException
PlatformManagerException
public boolean isAdditionalFileTypeRegistered(String name, String type) throws PlatformManagerException
PlatformManager
isAdditionalFileTypeRegistered
in interface PlatformManager
PlatformManagerException
public void unregisterAdditionalFileType(String name, String type) throws PlatformManagerException
PlatformManager
unregisterAdditionalFileType
in interface PlatformManager
PlatformManagerException
public void registerAdditionalFileType(String name, String description, String type, String content_type) throws PlatformManagerException
PlatformManager
registerAdditionalFileType
in interface PlatformManager
PlatformManagerException
public void registerApplication() throws PlatformManagerException
PlatformManagerException
public void createProcess(String cmd, boolean inheritsHandles) throws PlatformManagerException
PlatformManagerException
public void performRecoverableFileDelete(String path) throws PlatformManagerException
PlatformManagerException
public boolean hasCapability(PlatformManagerCapabilities capability)
Gets whether the platform manager supports a capability
Users of PlatformManager should check for supported capabilities before calling the corresponding methods
Note that support for a particular capability may change arbitrarily in the duration of the application session, but the manager will cache where necessary.
capability
- A platform manager capability
public void dispose()
public void setTCPTOSEnabled(boolean enabled) throws PlatformManagerException
PlatformManagerException
public void copyFilePermissions(String from_file_name, String to_file_name) throws PlatformManagerException
PlatformManagerException
public void showFile(String path) throws PlatformManagerException
showFile
in interface PlatformManager
path
- The full path to a file or directory
PlatformManagerException
- If this operation failspublic void playSystemAlert()
public void showInFinder(File path)
Shows the given file or directory in Finder
path
- Absolute path to the file or directorypublic void showInTerminal(String path)
Shows the given file or directory in Terminal by executing cd /absolute/path/to
path
- Absolute path to the file or directorypublic void showInTerminal(File path)
Shows the given file or directory in Terminal by executing cd /absolute/path/to
path
- Absolute path to the file or directoryprotected static String performOSAScript(CharSequence cmd) throws IOException
cmd
- AppleScript command to execute; do not surround command with extra quotation marks
IOException
- If the script failed to executeprotected static String performOSAScript(CharSequence[] cmds) throws IOException
cmds
- AppleScript Sequence of commands to execute; do not surround command with extra quotation marks
IOException
- If the script failed to executeprotected static String performOSAScript(File script) throws IOException
script
- AppleScript file (.scpt) to execute
IOException
- If the script failed to executeprotected static boolean compileOSAScript(CharSequence cmd, File destination)
cmd
- Command to compile; do not surround command with extra quotation marksdestination
- Destination location of the AppleScript file
protected static boolean compileOSAScript(CharSequence[] cmds, File destination)
cmds
- Sequence of commands to compile; do not surround command with extra quotation marksdestination
- Destination location of the AppleScript file
protected static Process performRuntimeExec(String[] cmdargs) throws IOException
IOException
Runtime.exec(String[])
public boolean testNativeAvailability(String name) throws PlatformManagerException
PlatformManagerException
public void traceRoute(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) throws PlatformManagerException
PlatformManagerException
public void ping(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) throws PlatformManagerException
PlatformManagerException
public int getMaxOpenFiles() throws PlatformManagerException
PlatformManager
PlatformManagerException
public void addListener(PlatformManagerListener listener)
public void removeListener(PlatformManagerListener listener)
public void generate(IndentWriter writer)
generate
in interface AEDiagnosticsEvidenceGenerator
public String getAzComputerID() throws PlatformManagerException
PlatformManagerException
public void requestUserAttention(int type, Object data) throws PlatformManagerException
type
- one of USER_REQUEST_INFO, USER_REQUEST_WARNING
PlatformManagerException
public Class<?> loadClass(ClassLoader loader, String class_name) throws PlatformManagerException
PlatformManager
PlatformManagerException
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |