本文整理汇总了Java中org.gudy.azureus2.core3.util.SystemProperties类的典型用法代码示例。如果您正苦于以下问题:Java SystemProperties类的具体用法?Java SystemProperties怎么用?Java SystemProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemProperties类属于org.gudy.azureus2.core3.util包,在下文中一共展示了SystemProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTorrentFile
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public File getTorrentFile(final Item item) {
File torrentFile;
try {
torrentFile = (File) RetryUtils.retry(new RetryUtils.Task() {
File file;
@Override
public void performAction() throws Exception {
String URL = !item.torrent_URL.contains("http") ? item.torrent_URL.replace("//", "http://") : item.torrent_URL;
String filePath = new File(SystemProperties.getUserPath()).getAbsolutePath() + "/"
+ item.title_clean;
file = HttpUtils.saveToFile(URL, filePath);
}
@Override
public Object getReturnValue() {
return file;
}
}, 4, 0);
} catch (RuntimeException e) {
throw e;
}
return torrentFile;
}
示例2: getPList
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
protected PListEditor
getPList()
throws IOException
{
String plist = SystemProperties.getApplicationPath() +
SystemProperties.getApplicationName() + ".app/Contents/Info.plist";
File plist_file = new File( plist );
// since 4800 the plist is read-only (as we sign it to play niceley with OSX and
// updating it breaks the sig)
if ( !plist_file.canWrite()){
return( null );
}
PListEditor editor = new PListEditor( plist );
return( editor );
}
示例3: main
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public static void
main(
String[] args )
{
try{
SystemProperties.setApplicationName( "Vuze" );
// System.out.println( new PlatformManagerImpl().getMaxOpenFiles());
PlatformManagerImpl pm = new PlatformManagerImpl();
pm.getRunAtLogin();
pm.setRunAtLogin( false );
}catch( Throwable e ){
e.printStackTrace();
}
}
示例4: getUserDataDirectory
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String getUserDataDirectory()
throws PlatformManagerException
{
String userhome = System.getProperty("user.home");
String temp_user_path = userhome + SystemProperties.SEP + "."
+ SystemProperties.APPLICATION_NAME.toLowerCase()
+ SystemProperties.SEP;
synchronized (migrate_lock) {
File home = new File(temp_user_path);
if (!home.exists()) { //might be a fresh install or might be an old non-migrated install
String old_home_path = userhome + SystemProperties.SEP + "."
+ SystemProperties.APPLICATION_NAME + SystemProperties.SEP;
File old_home = new File(old_home_path);
if (old_home.exists()) { //migrate
String msg = "Migrating unix user config dir [" + old_home_path
+ "] ===> [" + temp_user_path + "]";
System.out.println(msg);
Logger.log(new LogEvent(LOGID,
"SystemProperties::getUserPath(Unix): " + msg));
try {
old_home.renameTo(home);
} catch (Throwable t) {
t.printStackTrace();
Logger.log(new LogEvent(LOGID, "migration rename failed:", t));
}
}
}
}
return temp_user_path;
}
示例5: getUserDataDirectory
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getUserDataDirectory()
throws PlatformManagerException
{
return( SystemProperties.getApplicationPath());
}
示例6: getUserDataDirectory
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.gudy.azureus2.core3.util.SystemProperties#getUserPath()
*/
public String getUserDataDirectory() throws PlatformManagerException
{
return new File(System.getProperty("user.home")
+ "/Library/Application Support/"
+ SystemProperties.APPLICATION_NAME).getPath()
+ SystemProperties.SEP;
}
示例7: addV2HelpMenu
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
/**
* Creates the Help menu and all its children
* @param parent
*/
private void addV2HelpMenu(final Shell parent) {
MenuItem helpItem = MenuFactory.createHelpMenuItem(menuBar);
Menu helpMenu = helpItem.getMenu();
if (false == Constants.isOSX) {
MenuFactory.addAboutMenuItem(helpMenu);
MenuFactory.addSeparatorMenuItem(helpMenu);
}
MenuFactory.addHealthMenuItem(helpMenu);
MenuFactory.addReleaseNotesMenuItem(helpMenu);
MenuFactory.addWhatsNewMenuItem(helpMenu);
MenuFactory.addWikiMenuItem(helpMenu);
MenuFactory.addGetPluginsMenuItem(helpMenu);
MenuFactory.addSeparatorMenuItem(helpMenu);
if (false == SystemProperties.isJavaWebStartInstance()) {
MenuFactory.addCheckUpdateMenuItem(helpMenu);
MenuFactory.addBetaMenuItem(helpMenu);
}
MenuFactory.addDonationMenuItem(helpMenu);
MenuFactory.addSeparatorMenuItem(helpMenu);
MenuFactory.addAdvancedHelpMenuItem(helpMenu);
MenuFactory.addDebugHelpMenuItem(helpMenu);
}
示例8: getAzureusUserDir
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getAzureusUserDir()
{
String res = SystemProperties.getUserPath();
if ( res.endsWith(File.separator )){
res = res.substring(0,res.length()-1);
}
return( res );
}
示例9: getAzureusProgramDir
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getAzureusProgramDir()
{
String res = SystemProperties.getApplicationPath();
if ( res.endsWith(File.separator )){
res = res.substring(0,res.length()-1);
}
return( res );
}
示例10: getInstallDir
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getInstallDir()
{
String str = SystemProperties.getApplicationPath();
if ( str.endsWith(File.separator)){
str = str.substring(0,str.length()-1);
}
return( str );
}
示例11: getUserDir
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getUserDir()
{
String str = SystemProperties.getUserPath();
if ( str.endsWith(File.separator)){
str = str.substring(0,str.length()-1);
}
return( str );
}
示例12: printwelcome
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public void printwelcome()
{
out.println("Running " + Constants.APP_NAME + " " + Constants.AZUREUS_VERSION + "...");
out.println("Using configuration settings from:");
out.println(" " + SystemProperties.getUserPath());
}
示例13: registerDefaults
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public static void registerDefaults() {
HashMap def =new HashMap();
if (defaultsNotRegistered) {
defaultsNotRegistered = false;
/** Headless Server settings **/
// Server Name
def.put("Server_sName", "Azureus2 WebInterface");
// IP to bind to
def.put("Server_sBindIP", "");
// Port the server runs on
def.put("Server_iPort", new Long(8088));
// Connection Timeout in seconds.
def.put("Server_iTimeout", new Long(10));
// Path to the html templates.
def.put("Server_sTemplate_Directory", SystemProperties.getUserPath()+"template");
// Maximal simultaneous connections
def.put("Server_iMaxHTTPConnections", new Long(5));
// Auto-refresh torrents every (seconds, 0 = off);
def.put("Server_iRefresh", new Long(20));
// Allowed static ips (space separated list)
def.put("Server_sAllowStatic", "127.0.0.1");
// Allowed dynamic hosts (space separated list)
def.put("Server_sAllowDynamic", "");
// Recheck dynamic hosts every (minutes)
def.put("Server_iRecheckDynamic", new Long(30));
// Be not JavaScript-dependant
def.put("Server_bNoJavaScript", new Long(0));
// Relevant for the proxy part
// Fake hostname to access the webinterface when used in proxy mode
def.put("Server_sAccessHost", "torrent");
// Enable Cookies
def.put("Server_bProxyEnableCookies", new Long(1));
// Block certain URLs
def.put("Server_bProxyBlockURLs", new Long(0));
// Filter HTTP Headers (Referer and User Agent)
def.put("Server_bProxyFilterHTTP", new Long(0));
// User agent for outgoing connections
def.put("Server_sProxyUserAgent", "Mozilla/4.0 (compatible; MSIE 4.0; WindowsNT 5.0)");
// Use a downstream proxy
def.put("Server_bUseDownstreamProxy", new Long(0));
// Server Host Name
def.put("Server_sDownstreamProxyHost", "127.0.0.1");
// Port of a downstream proxy
def.put("Server_iDownstreamProxyPort", new Long(0));
// Grab Torrents in Proxy mode
def.put("Server_bProxyGrabTorrents", new Long(1));
// Page to redirect to if torrent download was successful
def.put("Server_sProxySuccessRedirect", "torrents");
// Logging relevant Stuff
// Log levels:
// 50000 Fatal
// 40000 Error
// 30000 Warn
// 20000 Info
// 12000 HTTP (SLevel)
// 11101 Torrent Received (SLevel)
// 11100 Torrent Sent (SLevel)
// 11000 Core info (SLevel)
// 10001 Thread (SLevel)
// 10000 Debug
// Log to file
def.put("Server_bLogFile", new Long(0));
// Logfile
def.put("Server_sLogFile", SystemProperties.getUserPath()+"webinterface.log");
// Log Level for web interface
def.put("Server_iLogLevelWebinterface", new Long(20000));
// Log Level for core
def.put("Server_iLogLevelCore", new Long(20000));
// Number of remembered log entries
def.put("Server_iLogCount", new Long(200));
COConfigurationManager.registerExternalDefaults(def);
}
}
示例14: setApplicationName
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public void
setApplicationName(
String name )
{
SystemProperties.setApplicationName( name );
}
示例15: getApplicationName
import org.gudy.azureus2.core3.util.SystemProperties; //导入依赖的package包/类
public String
getApplicationName()
{
return( SystemProperties.getApplicationName());
}