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 intprivate Stringprivate booleanprivate Fileprivate FMFileAccess.FileAccessorprivate FMFileAccessControllerprivate static final AEMonitorprivate longprivate longprivate Fileprivate final FMFileManagerImplprivate static final booleanprivate final FMFileOwnerprotected static final Stringprotected final AEMonitorprotected static final StringFields 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
ConstructorsModifierConstructorDescriptionprotectedFMFileImpl(FMFileOwner _owner, FMFileManagerImpl _manager, File _file, int _type, boolean _force) protectedFMFileImpl(FMFileImpl basis) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseSupport(boolean explicit) protected voidcreateDirs(File target) voiddelete()protected voidvoidensureOpen(String reason) booleanexists()voidflush()protected static voidgenerateEvidence(IndentWriter writer) intlongprotected longprotected longprotected Fileprotected FMFileManagerImplgetName()getOwner()intprotected StringbooleanisClone()booleanisOpen()protected booleanisPieceCompleteProcessingNeeded(int piece_number) voidmoveFile(File new_unlinked_file, FileUtil.ProgressListener pl) protected voidopenSupport(String reason) protected voidreadSupport(DirectByteBuffer[] buffers, long position) protected voidreadSupport(DirectByteBuffer buffer, long position) private voidvoidrenameFile(String new_name) protected voidreopen(FMFileManagerException cause) private voidreserveAccess(String reason) private voidprotected voidsetAccessModeSupport(int mode) protected voidsetLengthSupport(long length) protected voidsetPieceCompleteSupport(int piece_number, DirectByteBuffer piece_data) voidsetStorageType(int new_type, boolean force) protected voidwriteSupport(DirectByteBuffer[] buffers, long position) protected voidwriteSupport(DirectByteBuffer buffer, long position) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
-
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, File _file, int _type, boolean _force) throws FMFileManagerException - Throws:
FMFileManagerException
-
FMFileImpl
- Throws:
FMFileManagerException
-
-
Method Details
-
getManager
-
getName
-
exists
public boolean exists() -
getOwner
-
isClone
public boolean isClone() -
setStorageType
- Specified by:
setStorageTypein interfaceFMFile- Throws:
FMFileManagerException
-
getStorageType
public int getStorageType()- Specified by:
getStorageTypein interfaceFMFile
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessModein interfaceFMFile
-
setAccessModeSupport
protected void setAccessModeSupport(int mode) -
getLinkedFile
-
moveFile
public void moveFile(File new_unlinked_file, FileUtil.ProgressListener pl) throws FMFileManagerException - Specified by:
moveFilein interfaceFMFile- Throws:
FMFileManagerException
-
renameFile
- Specified by:
renameFilein interfaceFMFile- Throws:
FMFileManagerException
-
ensureOpen
- Specified by:
ensureOpenin interfaceFMFile- Throws:
FMFileManagerException
-
getLengthCache
protected long getLengthCache() -
getLengthSupport
- Throws:
FMFileManagerException
-
setLengthSupport
- Throws:
FMFileManagerException
-
reopen
- Throws:
Throwable
-
openSupport
- Throws:
FMFileManagerException
-
closeSupport
- Throws:
FMFileManagerException
-
flush
- Specified by:
flushin interfaceFMFile- Throws:
FMFileManagerException
-
isPieceCompleteProcessingNeeded
- Throws:
FMFileManagerException
-
setPieceCompleteSupport
protected void setPieceCompleteSupport(int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException - Throws:
FMFileManagerException
-
delete
- Specified by:
deletein 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:
getLastModifiedin interfaceFMFile
-
reserveFile
- Throws:
FMFileManagerException
-
reserveAccess
- Throws:
FMFileManagerException
-
releaseFile
private void releaseFile() -
createDirs
- Throws:
FMFileManagerException
-
deleteDirs
protected void deleteDirs() -
getString
-
generateEvidence
-