当前位置: 首页>>代码示例>>Java>>正文


Java PlatformManagerCapabilities类代码示例

本文整理汇总了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 );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:21,代码来源:PlatformManagerImpl.java

示例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 ));
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:20,代码来源:PlatformManagerImpl.java

示例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 ));
	}	
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:22,代码来源:PlatformManagerImpl.java

示例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 ));
	}	
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:22,代码来源:PlatformManagerImpl.java

示例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());
	}
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:25,代码来源:ManagerUtils.java

示例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 );
	}
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:23,代码来源:AssociationChecker.java

示例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);
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:36,代码来源:PlatformManagerImpl.java

示例8: hasCapability

import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public boolean
hasCapability(
        PlatformManagerCapabilities capability)
{
    return capabilitySet.contains(capability);
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:10,代码来源:PlatformManagerImpl.java

示例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" ));
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:12,代码来源:PlatformManagerImpl.java

示例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());
	}
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:30,代码来源:FileUtil.java

示例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 );
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:12,代码来源:UtilitiesImpl.java

示例12: canTraceRoute

import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
canTraceRoute()
{
	PlatformManager	pm = PlatformManagerFactory.getPlatformManager();

	return( pm.hasCapability( PlatformManagerCapabilities.TraceRouteAvailability ));
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:8,代码来源:NetworkAdminImpl.java

示例13: canPing

import org.gudy.azureus2.platform.PlatformManagerCapabilities; //导入依赖的package包/类
public boolean
canPing()
{
	PlatformManager	pm = PlatformManagerFactory.getPlatformManager();

	return( pm.hasCapability( PlatformManagerCapabilities.PingAvailability ));
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:8,代码来源:NetworkAdminImpl.java

示例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);
		}
	}
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:20,代码来源:UserAlerts.java


注:本文中的org.gudy.azureus2.platform.PlatformManagerCapabilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。