Class FMFileImpl
java.lang.Object
com.biglybt.core.diskmanager.file.impl.FMFileImpl
- All Implemented Interfaces:
FMFile
- Direct Known Subclasses:
FMFileLimited
,FMFileUnlimited
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private StringInterner.FileKey
private boolean
private File
private FMFileAccess.FileAccessor
private FMFileAccessController
private static final Map
<StringInterner.FileKey, List<Object[]>> private static final AEMonitor
private long
private long
private StringInterner.FileKey
private final FMFileManagerImpl
private static final boolean
private final FMFileOwner
protected static final String
(package private) static boolean
protected final AEMonitor
protected static final String
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
ConstructorsModifierConstructorDescriptionprotected
FMFileImpl
(FMFileOwner _owner, FMFileManagerImpl _manager, StringInterner.FileKey _file, int _type, boolean _force) protected
FMFileImpl
(FMFileImpl basis) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeSupport
(boolean explicit) protected void
createDirs
(File target) void
delete()
protected void
void
ensureOpen
(String reason) boolean
exists()
void
flush()
protected static void
generateEvidence
(IndentWriter writer) int
protected File
getFile()
private void
long
protected long
protected long
protected File
protected FMFileManagerImpl
getName()
getOwner()
int
protected String
boolean
isClone()
boolean
isOpen()
protected boolean
isPieceCompleteProcessingNeeded
(int piece_number) void
moveFile
(File new_linked_file, FileUtil.ProgressListener pl) protected void
openSupport
(String reason) protected void
readSupport
(DirectByteBuffer[] buffers, long position) protected void
readSupport
(DirectByteBuffer buffer, long position) private void
void
renameFile
(String new_name) protected void
reopen
(FMFileManagerException cause) private void
reserveAccess
(String reason) private void
protected void
setAccessModeSupport
(int mode) protected void
setLengthSupport
(long length) protected void
setPieceCompleteSupport
(int piece_number, DirectByteBuffer piece_data) void
setStorageType
(int new_type, boolean force) protected void
writeSupport
(DirectByteBuffer[] buffers, long position) protected void
writeSupport
(DirectByteBuffer buffer, long position) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.diskmanager.file.FMFile
close, createClone, getLength, read, read, setAccessMode, setLength, setPieceComplete, write, write
-
Field Details
-
READ_ACCESS_MODE
- See Also:
-
WRITE_ACCESS_MODE
- See Also:
-
file_map
-
file_map_mon
-
OUTPUT_REOPEN_RELATED_ERRORS
private static final boolean OUTPUT_REOPEN_RELATED_ERRORS- See Also:
-
switch_to_upload_only_enable
static volatile boolean switch_to_upload_only_enable -
manager
-
owner
-
access_mode
private int access_mode -
linked_file
-
last_modified
private long last_modified -
canonical_path
-
fa
-
file_access
-
created_dirs_leaf
-
created_dirs
-
this_mon
-
length_cache
private volatile long length_cache -
clone
private boolean clone
-
-
Constructor Details
-
FMFileImpl
protected FMFileImpl(FMFileOwner _owner, FMFileManagerImpl _manager, StringInterner.FileKey _file, int _type, boolean _force) throws FMFileManagerException - Throws:
FMFileManagerException
-
FMFileImpl
- Throws:
FMFileManagerException
-
-
Method Details
-
getManager
-
getName
-
exists
public boolean exists() -
getFile
-
getOwner
-
isClone
public boolean isClone() -
setStorageType
- Specified by:
setStorageType
in interfaceFMFile
- Throws:
FMFileManagerException
-
getStorageType
public int getStorageType()- Specified by:
getStorageType
in interfaceFMFile
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessMode
in interfaceFMFile
-
setAccessModeSupport
protected void setAccessModeSupport(int mode) -
getLinkedFile
-
moveFile
public void moveFile(File new_linked_file, FileUtil.ProgressListener pl) throws FMFileManagerException - Specified by:
moveFile
in interfaceFMFile
- Throws:
FMFileManagerException
-
renameFile
- Specified by:
renameFile
in interfaceFMFile
- Throws:
FMFileManagerException
-
ensureOpen
- Specified by:
ensureOpen
in interfaceFMFile
- Throws:
FMFileManagerException
-
getLengthCache
protected long getLengthCache() -
getLengthSupport
- Throws:
FMFileManagerException
-
setLengthSupport
- Throws:
FMFileManagerException
-
getFileAccessor
- Throws:
FileNotFoundException
-
reopen
- Throws:
Throwable
-
openSupport
- Throws:
FMFileManagerException
-
closeSupport
- Throws:
FMFileManagerException
-
flush
- Specified by:
flush
in interfaceFMFile
- Throws:
FMFileManagerException
-
isPieceCompleteProcessingNeeded
- Throws:
FMFileManagerException
-
setPieceCompleteSupport
protected void setPieceCompleteSupport(int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException - Throws:
FMFileManagerException
-
delete
- Specified by:
delete
in interfaceFMFile
- Throws:
FMFileManagerException
-
readSupport
- Throws:
FMFileManagerException
-
readSupport
- Throws:
FMFileManagerException
-
writeSupport
- Throws:
FMFileManagerException
-
writeSupport
protected void writeSupport(DirectByteBuffer[] buffers, long position) throws FMFileManagerException - Throws:
FMFileManagerException
-
isOpen
public boolean isOpen() -
getLastModified
public long getLastModified()- Specified by:
getLastModified
in interfaceFMFile
-
reserveFile
- Throws:
FMFileManagerException
-
reserveAccess
- Throws:
FMFileManagerException
-
releaseFile
private void releaseFile() -
createDirs
- Throws:
FMFileManagerException
-
deleteDirs
protected void deleteDirs() -
getString
-
generateEvidence
-