Class FMFilePadding
- java.lang.Object
-
- com.biglybt.core.diskmanager.file.impl.FMFilePadding
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
file
private boolean
is_clone
private boolean
is_open
private long
length
private int
mode
private FMFileOwner
owner
private static byte[]
ZERO_BYTES
-
Fields inherited from interface com.biglybt.core.diskmanager.file.FMFile
FM_READ, FM_WRITE, FT_COMPACT, FT_LINEAR, FT_PIECE_REORDER, FT_PIECE_REORDER_COMPACT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FMFilePadding(FMFileOwner _owner, java.io.File _file, boolean _is_clone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
FMFile
createClone()
void
delete()
void
ensureOpen(java.lang.String reason)
boolean
exists()
void
flush()
int
getAccessMode()
long
getLastModified()
long
getLength()
java.lang.String
getName()
FMFileOwner
getOwner()
int
getStorageType()
boolean
isClone()
boolean
isOpen()
void
moveFile(java.io.File new_file, FileUtil.ProgressListener pl)
void
read(DirectByteBuffer[] buffers, long offset)
void
read(DirectByteBuffer buffer, long offset)
void
renameFile(java.lang.String new_name)
void
setAccessMode(int _mode)
void
setLength(long length)
void
setPieceComplete(int piece_number, DirectByteBuffer piece_data)
void
setStorageType(int type, boolean force)
void
write(DirectByteBuffer[] buffers, long position)
void
write(DirectByteBuffer buffer, long position)
-
-
-
Field Detail
-
ZERO_BYTES
private static byte[] ZERO_BYTES
-
owner
private final FMFileOwner owner
-
length
private final long length
-
is_clone
private final boolean is_clone
-
file
private java.io.File file
-
mode
private int mode
-
is_open
private boolean is_open
-
-
Constructor Detail
-
FMFilePadding
protected FMFilePadding(FMFileOwner _owner, java.io.File _file, boolean _is_clone)
-
-
Method Detail
-
getOwner
public FMFileOwner getOwner()
-
moveFile
public void moveFile(java.io.File new_file, FileUtil.ProgressListener pl) throws FMFileManagerException
- Specified by:
moveFile
in interfaceFMFile
- Throws:
FMFileManagerException
-
renameFile
public void renameFile(java.lang.String new_name) throws FMFileManagerException
- Specified by:
renameFile
in interfaceFMFile
- Throws:
FMFileManagerException
-
setAccessMode
public void setAccessMode(int _mode) throws FMFileManagerException
- Specified by:
setAccessMode
in interfaceFMFile
- Throws:
FMFileManagerException
-
getAccessMode
public int getAccessMode()
- Specified by:
getAccessMode
in interfaceFMFile
-
setStorageType
public void setStorageType(int type, boolean force) throws FMFileManagerException
- Specified by:
setStorageType
in interfaceFMFile
- Throws:
FMFileManagerException
-
getStorageType
public int getStorageType()
- Specified by:
getStorageType
in interfaceFMFile
-
ensureOpen
public void ensureOpen(java.lang.String reason) throws FMFileManagerException
- Specified by:
ensureOpen
in interfaceFMFile
- Throws:
FMFileManagerException
-
getLength
public long getLength() throws FMFileManagerException
- Specified by:
getLength
in interfaceFMFile
- Throws:
FMFileManagerException
-
setLength
public void setLength(long length) throws FMFileManagerException
- Specified by:
setLength
in interfaceFMFile
- Throws:
FMFileManagerException
-
setPieceComplete
public void setPieceComplete(int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException
- Specified by:
setPieceComplete
in interfaceFMFile
- Throws:
FMFileManagerException
-
read
public void read(DirectByteBuffer buffer, long offset) throws FMFileManagerException
- Specified by:
read
in interfaceFMFile
- Throws:
FMFileManagerException
-
read
public void read(DirectByteBuffer[] buffers, long offset) throws FMFileManagerException
- Specified by:
read
in interfaceFMFile
- Throws:
FMFileManagerException
-
write
public void write(DirectByteBuffer buffer, long position) throws FMFileManagerException
- Specified by:
write
in interfaceFMFile
- Throws:
FMFileManagerException
-
write
public void write(DirectByteBuffer[] buffers, long position) throws FMFileManagerException
- Specified by:
write
in interfaceFMFile
- Throws:
FMFileManagerException
-
flush
public void flush() throws FMFileManagerException
- Specified by:
flush
in interfaceFMFile
- Throws:
FMFileManagerException
-
close
public void close() throws FMFileManagerException
- Specified by:
close
in interfaceFMFile
- Throws:
FMFileManagerException
-
delete
public void delete() throws FMFileManagerException
- Specified by:
delete
in interfaceFMFile
- Throws:
FMFileManagerException
-
createClone
public FMFile createClone() throws FMFileManagerException
- Specified by:
createClone
in interfaceFMFile
- Throws:
FMFileManagerException
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceFMFile
-
-