Class FMFileAccessController
- java.lang.Object
-
- com.biglybt.core.diskmanager.file.impl.FMFileAccessController
-
- All Implemented Interfaces:
FMFileAccess
public class FMFileAccessController extends java.lang.Object implements FMFileAccess
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FMFileAccessController.FileAccessorFileChannel
static class
FMFileAccessController.FileAccessorRAF
-
Nested classes/interfaces inherited from interface com.biglybt.core.diskmanager.file.impl.FMFileAccess
FMFileAccess.FileAccessor
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
control_dir
private java.lang.String
controlFileName
private static boolean
enable_sparse_files
private FMFileAccess
file_access
private FMFileImpl
owner
private static java.lang.String
REORDER_SUFFIX
private static boolean
TEST_PIECE_REORDER
private int
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
FMFileAccessController(FMFileImpl _file, int _target_type, boolean _force)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aboutToOpen()
private void
convert(int target_type, boolean force)
private void
convertSupport(int target_type, boolean force)
void
flush()
FMFileImpl
getFile()
long
getLength(FMFileAccess.FileAccessor fa)
int
getStorageType()
java.lang.String
getString()
boolean
isPieceCompleteProcessingNeeded(int piece_number)
void
read(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long offset)
protected void
setControlFile()
void
setLength(FMFileAccess.FileAccessor fa, long length)
void
setPieceComplete(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data)
void
setStorageType(int new_type, boolean force)
void
write(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position)
-
-
-
Field Detail
-
REORDER_SUFFIX
private static final java.lang.String REORDER_SUFFIX
- See Also:
- Constant Field Values
-
TEST_PIECE_REORDER
private static final boolean TEST_PIECE_REORDER
-
enable_sparse_files
private static boolean enable_sparse_files
-
owner
private final FMFileImpl owner
-
type
private int type
-
control_dir
private java.io.File control_dir
-
controlFileName
private java.lang.String controlFileName
-
file_access
private FMFileAccess file_access
-
-
Constructor Detail
-
FMFileAccessController
protected FMFileAccessController(FMFileImpl _file, int _target_type, boolean _force) throws FMFileManagerException
- Throws:
FMFileManagerException
-
-
Method Detail
-
convert
private void convert(int target_type, boolean force) throws FMFileManagerException
- Throws:
FMFileManagerException
-
convertSupport
private void convertSupport(int target_type, boolean force) throws FMFileManagerException
- Throws:
FMFileManagerException
-
setControlFile
protected void setControlFile()
-
setStorageType
public void setStorageType(int new_type, boolean force) throws FMFileManagerException
- Throws:
FMFileManagerException
-
getStorageType
public int getStorageType()
-
aboutToOpen
public void aboutToOpen() throws FMFileManagerException
- Specified by:
aboutToOpen
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
getLength
public long getLength(FMFileAccess.FileAccessor fa) throws FMFileManagerException
- Specified by:
getLength
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
setLength
public void setLength(FMFileAccess.FileAccessor fa, long length) throws FMFileManagerException
- Specified by:
setLength
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
isPieceCompleteProcessingNeeded
public boolean isPieceCompleteProcessingNeeded(int piece_number)
- Specified by:
isPieceCompleteProcessingNeeded
in interfaceFMFileAccess
-
setPieceComplete
public void setPieceComplete(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException
- Specified by:
setPieceComplete
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
read
public void read(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long offset) throws FMFileManagerException
- Specified by:
read
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
write
public void write(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) throws FMFileManagerException
- Specified by:
write
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
flush
public void flush() throws FMFileManagerException
- Specified by:
flush
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
getFile
public FMFileImpl getFile()
- Specified by:
getFile
in interfaceFMFileAccess
-
getString
public java.lang.String getString()
- Specified by:
getString
in interfaceFMFileAccess
-
-