📄 diskmanagerfileinfosetimpl.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: DiskManagerFileInfoSetImpl.java
package org.gudy.azureus2.core3.disk.impl;
import com.aelitis.azureus.core.diskmanager.cache.CacheFile;
import java.util.Arrays;
import org.gudy.azureus2.core3.disk.DiskManagerFileInfo;
import org.gudy.azureus2.core3.disk.DiskManagerFileInfoSet;
import org.gudy.azureus2.core3.download.DownloadManagerState;
import org.gudy.azureus2.core3.util.Debug;
// Referenced classes of package org.gudy.azureus2.core3.disk.impl:
// DiskManagerFileInfoImpl, DiskManagerHelper, DiskManagerUtil
public class DiskManagerFileInfoSetImpl
implements DiskManagerFileInfoSet
{
final DiskManagerFileInfoImpl files[];
final DiskManagerHelper diskManager;
public DiskManagerFileInfoSetImpl(DiskManagerFileInfoImpl files[], DiskManagerHelper dm)
{
this.files = files;
diskManager = dm;
}
public DiskManagerFileInfo[] getFiles()
{
return files;
}
public int nbFiles()
{
return files.length;
}
public void setPriority(boolean toChange[], boolean setPriority)
{
DownloadManagerState dmState;
if (toChange.length != files.length)
throw new IllegalArgumentException("array length mismatches the number of files");
dmState = diskManager.getDownloadState();
dmState.suppressStateSave(true);
for (int i = 0; i < files.length; i++)
if (toChange[i])
files[i].setPriority(setPriority);
dmState.suppressStateSave(false);
break MISSING_BLOCK_LABEL_96;
Exception exception;
exception;
dmState.suppressStateSave(false);
throw exception;
}
public void setSkipped(boolean toChange[], boolean setSkipped)
{
DownloadManagerState dmState;
if (toChange.length != files.length)
throw new IllegalArgumentException("array length mismatches the number of files");
dmState = diskManager.getDownloadState();
dmState.suppressStateSave(true);
if (!setSkipped && !Arrays.equals(toChange, setStorageTypes(toChange, 1)))
{
dmState.suppressStateSave(false);
return;
}
for (int i = 0; i < files.length; i++)
if (toChange[i])
{
files[i].skipped = setSkipped;
diskManager.skippedFileSetChanged(files[i]);
}
if (!setSkipped)
DiskManagerUtil.doFileExistenceChecks(this, toChange, diskManager.getDownloadState().getDownloadManager(), true);
dmState.suppressStateSave(false);
break MISSING_BLOCK_LABEL_161;
Exception exception;
exception;
dmState.suppressStateSave(false);
throw exception;
}
public boolean[] setStorageTypes(boolean toChange[], int newStroageType)
{
String types[];
boolean modified[];
DownloadManagerState dm_state;
if (toChange.length != files.length)
throw new IllegalArgumentException("array length mismatches the number of files");
if (files.length == 0)
return new boolean[0];
types = diskManager.getStorageTypes();
modified = new boolean[files.length];
dm_state = diskManager.getDownloadState();
if (newStroageType == 2)
{
Debug.out("Download must be stopped for linear -> compact conversion");
return modified;
}
int i;
dm_state.suppressStateSave(true);
i = 0;
_L3:
if (i >= files.length) goto _L2; else goto _L1
_L1:
DiskManagerFileInfoImpl file;
if (!toChange[i])
continue; /* Loop/switch isn't completed */
int old_type = types[i].equals("L") ? 1 : 2;
if (newStroageType == old_type)
{
modified[i] = true;
continue; /* Loop/switch isn't completed */
}
file = files[i];
file.getCacheFile().setStorageType(newStroageType != 1 ? 2 : 1);
modified[i] = true;
types[i] = file.getCacheFile().getStorageType() != 1 ? "C" : "L";
continue; /* Loop/switch isn't completed */
Throwable e;
e;
Debug.printStackTrace(e);
diskManager.setFailed(file, (new StringBuilder()).append("Failed to change storage type for '").append(file.getFile(true)).append("': ").append(Debug.getNestedExceptionMessage(e)).toString());
types[i] = file.getCacheFile().getStorageType() != 1 ? "C" : "L";
break; /* Loop/switch isn't completed */
Exception exception;
exception;
types[i] = file.getCacheFile().getStorageType() != 1 ? "C" : "L";
throw exception;
i++;
goto _L3
_L2:
dm_state.setListAttribute("storetypes", types);
DiskManagerUtil.doFileExistenceChecks(this, toChange, dm_state.getDownloadManager(), true);
dm_state.suppressStateSave(false);
dm_state.save();
break MISSING_BLOCK_LABEL_383;
Exception exception1;
exception1;
dm_state.suppressStateSave(false);
dm_state.save();
throw exception1;
return modified;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -