本文整理汇总了Java中org.gudy.azureus2.platform.PlatformManagerCapabilities类的典型用法代码示例。如果您正苦于以下问题:Java PlatformManagerCapabilities类的具体用法?Java PlatformManagerCapabilities怎么用?Java PlatformManagerCapabilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlatformManagerCapabilities类属于org.gudy.azureus2.platform包,在下文中一共展示了PlatformManagerCapabilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVMOptionFile
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public File
getVMOptionFile()
throws PlatformManagerException
{
checkCapability( PlatformManagerCapabilities.AccessExplicitVMOptions );
File local_options = checkAndGetLocalVMOptionFile();
if ( !local_options.exists()){
try{
local_options.createNewFile();
}catch( Throwable e ){
}
}
return( local_options );
}
示例2: testNativeAvailability
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
testNativeAvailability(
String name )
throws PlatformManagerException
{
if ( !hasCapability( PlatformManagerCapabilities.TestNativeAvailability )){
throw new PlatformManagerException("Unsupported capability called on platform manager");
}
try{
return( access.testNativeAvailability( name ));
}catch( Throwable e ){
throw( new PlatformManagerException( "Failed to test availability", e ));
}
}
示例3: traceRoute
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public void
traceRoute(
InetAddress interface_address,
InetAddress target,
PlatformManagerPingCallback callback )
throws PlatformManagerException
{
if ( !hasCapability( PlatformManagerCapabilities.TraceRouteAvailability )){
throw new PlatformManagerException("Unsupported capability called on platform manager");
}
try{
access.traceRoute( interface_address, target, callback );
}catch( Throwable e ){
throw( new PlatformManagerException( "Failed to trace route", e ));
}
}
示例4: ping
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public void
ping(
InetAddress interface_address,
InetAddress target,
PlatformManagerPingCallback callback )
throws PlatformManagerException
{
if ( !hasCapability( PlatformManagerCapabilities.PingAvailability )){
throw new PlatformManagerException("Unsupported capability called on platform manager");
}
try{
access.ping( interface_address, target, callback );
}catch( Throwable e ){
throw( new PlatformManagerException( "Failed to trace route", e ));
}
}
示例5: open
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public static void open(File f) {
while (f != null && !f.exists())
f = f.getParentFile();
if (f == null)
return;
PlatformManager mgr = PlatformManagerFactory.getPlatformManager();
if (mgr.hasCapability(PlatformManagerCapabilities.ShowFileInBrowser)) {
try {
PlatformManagerFactory.getPlatformManager().showFile(f.toString());
return;
} catch (PlatformManagerException e) {
Debug.printStackTrace(e);
}
}
if (f.isDirectory()) {
Utils.launch(f.toString()); // default launcher
} else {
Utils.launch(f.getParent().toString());
}
}
示例6: checkAssociations
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public static void
checkAssociations()
{
try{
PlatformManager platform = PlatformManagerFactory.getPlatformManager();
if ( platform.hasCapability(PlatformManagerCapabilities.RegisterFileAssociations) ){
if ( COConfigurationManager.getBooleanParameter( "config.interface.checkassoc")){
if ( !platform.isApplicationRegistered()){
new AssociationChecker( platform );
}
}
}
}catch( Throwable e ){
// Debug.printStackTrace( e );
}
}
示例7: PlatformManagerImpl
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
/**
* Creates a new PlatformManager and initializes its capabilities
*/
public PlatformManagerImpl()
{
capabilitySet.add(PlatformManagerCapabilities.RecoverableFileDelete);
capabilitySet.add(PlatformManagerCapabilities.ShowFileInBrowser);
capabilitySet.add(PlatformManagerCapabilities.ShowPathInCommandLine);
capabilitySet.add(PlatformManagerCapabilities.CreateCommandLineProcess);
capabilitySet.add(PlatformManagerCapabilities.GetUserDataDirectory);
capabilitySet.add(PlatformManagerCapabilities.UseNativeScripting);
capabilitySet.add(PlatformManagerCapabilities.PlaySystemAlert);
capabilitySet.add(PlatformManagerCapabilities.RequestUserAttention);
if (OSXAccess.isLoaded()) {
capabilitySet.add(PlatformManagerCapabilities.GetVersion);
}
if ( checkPList()){
// one day soon...
// capabilitySet.add(PlatformManagerCapabilities.AccessExplicitVMOptions);
}
capabilitySet.add(PlatformManagerCapabilities.RunAtLogin);
capabilitySet.add(PlatformManagerCapabilities.GetMaxOpenFiles);
if ( new File( "/usr/bin/pmset" ).canRead() ||
new File( "/usr/bin/caffeinate" ).canRead()){
capabilitySet.add( PlatformManagerCapabilities.PreventComputerSleep );
}
AEDiagnostics.addEvidenceGenerator(this);
}
示例8: hasCapability
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public boolean
hasCapability(
PlatformManagerCapabilities capability)
{
return capabilitySet.contains(capability);
}
示例9: checkCapability
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
private void
checkCapability(
PlatformManagerCapabilities capability )
throws PlatformManagerException
{
if ( !hasCapability(capability)){
throw( new PlatformManagerException( "Capability " + capability + " not supported" ));
}
}
示例10: deleteWithRecycle
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public static boolean
deleteWithRecycle(
File file,
boolean force_no_recycle )
{
if ( COConfigurationManager.getBooleanParameter("Move Deleted Data To Recycle Bin" ) && !force_no_recycle ){
try{
final PlatformManager platform = PlatformManagerFactory.getPlatformManager();
if (platform.hasCapability(PlatformManagerCapabilities.RecoverableFileDelete)){
platform.performRecoverableFileDelete( file.getAbsolutePath());
return( true );
}else{
return( file.delete());
}
}catch( PlatformManagerException e ){
return( file.delete());
}
}else{
return( file.delete());
}
}
示例11: supportsPowerStateControl
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
supportsPowerStateControl(
int state )
{
if ( state == PowerManagementListener.ST_SLEEP ){
return( PlatformManagerFactory.getPlatformManager().hasCapability( PlatformManagerCapabilities.PreventComputerSleep ));
}
return( false );
}
示例12: canTraceRoute
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
canTraceRoute()
{
PlatformManager pm = PlatformManagerFactory.getPlatformManager();
return( pm.hasCapability( PlatformManagerCapabilities.TraceRouteAvailability ));
}
示例13: canPing
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
canPing()
{
PlatformManager pm = PlatformManagerFactory.getPlatformManager();
return( pm.hasCapability( PlatformManagerCapabilities.PingAvailability ));
}
示例14: enableTOSRegistrySetting
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
private void enableTOSRegistrySetting(boolean enable) {
PlatformManager mgr = PlatformManagerFactory.getPlatformManager();
if (mgr.hasCapability(PlatformManagerCapabilities.SetTCPTOSEnabled)) {
//see http://wiki.vuze.com/w/AdvancedNetworkSettings
try {
mgr.setTCPTOSEnabled(enable);
} catch (PlatformManagerException pe) {
Debug.printStackTrace(pe);
}
}
}
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:13,代码来源:ConfigSectionConnectionAdvanced.java
示例15: requestUserAttention
import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
/**
* Grab the user's attention in a platform dependent way
* @param type one of <code>PlatformManager.USER_REQUEST_INFO</code>,
* <code>PlatformManager.USER_REQUEST_WARNING</code>, OR
* <code>PlatformManager.USER_REQUEST_QUESTION</code>
* @param data user-defined data object;
* see the platform-specific <code>PlatformManager</code> for what may be supported
*/
public static void requestUserAttention(int type, Object data) {
PlatformManager pm = PlatformManagerFactory.getPlatformManager();
if (true == pm.hasCapability(PlatformManagerCapabilities.RequestUserAttention)) {
try {
pm.requestUserAttention(type, data);
} catch (PlatformManagerException e) {
Debug.printStackTrace(e);
}
}
}