📄 shareconfigimpl.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: ShareConfigImpl.java
package org.gudy.azureus2.pluginsimpl.local.sharing;
import java.util.*;
import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.sharing.ShareException;
// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.sharing:
// ShareManagerImpl, ShareResourceImpl
public class ShareConfigImpl
{
protected ShareManagerImpl manager;
protected int suspend_level;
protected boolean save_outstanding;
protected AEMonitor this_mon;
public ShareConfigImpl()
{
this_mon = new AEMonitor("ShareConfig");
}
protected void loadConfig(ShareManagerImpl _manager)
{
manager = _manager;
List resources;
Map map = FileUtil.readResilientConfigFile("sharing.config");
resources = (List)map.get("resources");
if (resources == null)
return;
try
{
Map r_map;
for (Iterator iter = resources.iterator(); iter.hasNext(); manager.deserialiseResource(r_map))
r_map = (Map)iter.next();
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
return;
}
protected void saveConfig()
throws ShareException
{
this_mon.enter();
if (suspend_level <= 0)
break MISSING_BLOCK_LABEL_27;
save_outstanding = true;
this_mon.exit();
return;
Map map = new HashMap();
List list = new ArrayList();
map.put("resources", list);
org.gudy.azureus2.plugins.sharing.ShareResource shares[] = manager.getShares();
for (int i = 0; i < shares.length; i++)
{
Map m = new HashMap();
((ShareResourceImpl)shares[i]).serialiseResource(m);
list.add(m);
}
FileUtil.writeResilientConfigFile("sharing.config", map);
this_mon.exit();
break MISSING_BLOCK_LABEL_135;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
protected void suspendSaving()
{
this_mon.enter();
suspend_level++;
this_mon.exit();
break MISSING_BLOCK_LABEL_37;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
protected void resumeSaving()
throws ShareException
{
this_mon.enter();
suspend_level--;
if (suspend_level == 0 && save_outstanding)
{
save_outstanding = false;
saveConfig();
}
this_mon.exit();
break MISSING_BLOCK_LABEL_60;
Exception exception;
exception;
this_mon.exit();
throw exception;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -