Package com.killcoding.file
Class DiskFile
java.lang.Object
com.killcoding.file.BaseFile
com.killcoding.file.DiskFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileChannelprotected booleanprivate FileLockprotected static Integerprivate longstatic final intprivate static ExecutorServiceFields inherited from class com.killcoding.file.BaseFile
CACHE_ARRAY_FILTER_TIMER, CHARSET, LOGIC_ACCESS_TIMEOUT_MS, LOGIC_CHECK_TIMEOUT_MS, LOGIC_TIMEOUT_MS, origin, stopSync, SYNC_PATH_ALLOWED, SYNC_PATH_IGNORED, syncRoot, TEMP_DIR, TMP_EXT_ACCESS_FILE, TMP_EXT_CHECK_FILE, TMP_EXT_MODIFY_FILE, TMP_MATCHES_EDIT, TMP_MATCHES_VI_SWP, TMP_WRITING_FILE, TMP_WRITING_FOR_REPLACE, TMP_WRITING_SWP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanaddQueuePathMapping(String path) voidafterCreateLink(String target) voidafterDelete(boolean realDeleted) voidvoidbooleanbeforeCreateLink(String target) booleanbeforeDelete(boolean realDeleted) booleanbooleanstatic booleanprotected booleancheckSyncPathAvailable(String path) private voidclose()booleancomplete()protected static DiskFilevoidbooleancreateLink(String target) private static voiddebugLog(String point, RemoteFile rf, CacheArrayFilter filter) booleandelete()private booleanbooleanexists()private CacheArrayFiltergetFullAsyncFilter(DiskFile the, long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback) private CacheArrayFiltergetScanDeleteFilter(RemoteFile rootDir, Integer filePartDataTable, long timerMs, String replaceTo, String replaceRootPath, Runnable completedCallback) private static voidstatic voidinitPool(int poolSize) booleanbooleanbooleanisFile()booleanisLink()protected booleanprotected booleanprotected booleanprivate booleanisViEditSwp(String fileName) protected DiskFileprotected DiskFilelogicAccess(String msg) protected DiskFilelogicCheck(String msg) protected DiskFileprotected DiskFilelogicModify(String msg) voidbooleanmanualOpen(boolean append) voidmanualWrite(byte[] data) voidmanualWrite(String data) booleanmkdirs()voidbyte[]private byte[]readAllString(String charset) readLink()protected voidprotected voidprotected voidprotected static voidremoveQueuePathMapping(String path) voidsetCopyStructureOnly(boolean copyStructureOnly) voidsetModifyTime(Timestamp modifyTime) voidsetModifyTimeFromClock(Timestamp modifyTimeFromClock) voidsetModifyTimeMs(long modifyTimeMs) voidsetModifyTimeMsFromClock(long modifyTimeMsFromClock) longsize()voidvoidstartFullAsync(long timerMs, String replaceTo) voidstartFullAsync(long timerMs, String replaceTo, Runnable completedCallback) voidstartFullAsync(long timerMs, String replaceTo, Runnable completedCallback, Runnable checkDeleteCompletedCallback) private voidstartFullAsync(long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback, Runnable checkDeleteCompletedCallback) private voidstartFullAsyncThread(long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback) private voidstartFullSyncForDelete(Integer filePartDataTable, long timerMs, String replaceTo, String replaceRootPath, Runnable completedCallback) booleanwrite(byte[] data) booleanwrite(byte[] data, boolean append) booleanbooleanbooleanbooleanwriteToRemote(RemoteFile remoteFile) writeToRemote(RemoteFile remoteFile, Runnable completedCallback) Methods inherited from class com.killcoding.file.BaseFile
checkSyncPathAvailable, checkUsage, debugLog, getOrigin, getParent, getParents, getPath, isDebug, isDir, isHidden, isStopSync, memoryUsage, memoryUsage, memoryUsing, parsePath, replacePath, setTmpDir, stopSync, timeZoneConver, toAccessTmpFilePath, toCheckTmpFilePath, toModifyTmpFilePath, write
-
Field Details
-
RETRY_OPEN_LIMITED
- See Also:
-
MAX_POOL_SIZE
-
QUEUE_PATH_MAPPING
-
splitPool
-
copyStructureOnly
-
channel
-
lock
-
modifyTimeMs
-
-
Constructor Details
-
DiskFile
-
DiskFile
-
-
Method Details
-
initPool
-
initDefaultPool
-
split
- Throws:
IOException
-
copyTo
- Specified by:
copyToin classBaseFile- Throws:
IOException
-
moveTo
- Specified by:
moveToin classBaseFile- Throws:
IOException
-
writeToRemote
- Throws:
IOException
-
writeToRemote
public RemoteFile writeToRemote(RemoteFile remoteFile, Runnable completedCallback) throws IOException - Throws:
IOException
-
isLogicModify
- Throws:
Exception
-
logicModify
- Throws:
Exception
-
logicModify
- Throws:
Exception
-
removeLogicModify
-
isLogicAccess
- Throws:
Exception
-
logicAccess
- Throws:
Exception
-
logicAccess
- Throws:
Exception
-
removeLogicAccess
-
isLogicCheck
- Throws:
Exception
-
logicCheck
- Throws:
Exception
-
logicCheck
- Throws:
Exception
-
removeLogicCheck
-
beforeDelete
- Specified by:
beforeDeletein classBaseFile
-
afterDelete
- Specified by:
afterDeletein classBaseFile
-
beforeMkdirs
- Specified by:
beforeMkdirsin classBaseFile
-
afterMkdirs
- Specified by:
afterMkdirsin classBaseFile
-
beforeCreateLink
- Specified by:
beforeCreateLinkin classBaseFile
-
afterCreateLink
- Specified by:
afterCreateLinkin classBaseFile
-
beforeWrite
- Specified by:
beforeWritein classBaseFile
-
afterWrite
- Specified by:
afterWritein classBaseFile
-
delete
- Specified by:
deletein classBaseFile- Throws:
IOException
-
deleteFrom
- Throws:
IOException
-
isFile
- Specified by:
isFilein classBaseFile- Throws:
IOException
-
isDirectory
- Specified by:
isDirectoryin classBaseFile- Throws:
IOException
-
isLink
- Specified by:
isLinkin classBaseFile- Throws:
IOException
-
exists
- Specified by:
existsin classBaseFile- Throws:
IOException
-
mkdirs
- Specified by:
mkdirsin classBaseFile- Throws:
IOException
-
write
- Specified by:
writein classBaseFile- Throws:
IOException
-
manualOpen
-
manualWrite
- Throws:
IOException
-
manualWrite
- Throws:
IOException
-
manualClose
- Throws:
IOException
-
write
- Specified by:
writein classBaseFile- Throws:
IOException
-
write
- Specified by:
writein classBaseFile- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Specified by:
writein classBaseFile- Throws:
IOException
-
write
- Throws:
IOException
-
createLink
- Specified by:
createLinkin classBaseFile- Throws:
IOException
-
readLink
- Specified by:
readLinkin classBaseFile- Throws:
IOException
-
readAllBytes
- Specified by:
readAllBytesin classBaseFile- Throws:
IOException
-
readAllBytesFrom
- Throws:
IOException
-
readAllString
- Specified by:
readAllStringin classBaseFile- Throws:
IOException
-
readAllString
- Throws:
IOException
-
size
- Specified by:
sizein classBaseFile- Throws:
IOException
-
close
-
complete
- Specified by:
completein classBaseFile- Throws:
IOException
-
setModifyTimeMs
- Throws:
IOException
-
setModifyTimeMsFromClock
- Throws:
IOException
-
setModifyTime
- Specified by:
setModifyTimein classBaseFile- Throws:
IOException
-
setModifyTimeFromClock
- Throws:
IOException
-
getModifyTime
- Specified by:
getModifyTimein classBaseFile- Throws:
IOException
-
getModifyTimeForClock
- Throws:
IOException
-
startFullAsync
- Throws:
IOException
-
startFullAsync
public void startFullAsync(long timerMs, String replaceTo, Runnable completedCallback) throws IOException - Throws:
IOException
-
startFullAsync
public void startFullAsync(long timerMs, String replaceTo, Runnable completedCallback, Runnable checkDeleteCompletedCallback) throws IOException - Throws:
IOException
-
startFullAsync
private void startFullAsync(long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback, Runnable checkDeleteCompletedCallback) throws IOException - Throws:
IOException
-
startFullSyncForDelete
private void startFullSyncForDelete(Integer filePartDataTable, long timerMs, String replaceTo, String replaceRootPath, Runnable completedCallback) throws IOException - Throws:
IOException
-
getScanDeleteFilter
private CacheArrayFilter getScanDeleteFilter(RemoteFile rootDir, Integer filePartDataTable, long timerMs, String replaceTo, String replaceRootPath, Runnable completedCallback) -
startFullAsyncThread
private void startFullAsyncThread(long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback) -
getFullAsyncFilter
private CacheArrayFilter getFullAsyncFilter(DiskFile the, long timerMs, String replaceRootPath, String replaceTo, Runnable completedCallback) -
setCopyStructureOnly
-
isCopyStructureOnly
-
isViEditSwp
-
copyAttrs
-
getParentFile
-
checkSyncPathAvailable
-
addQueuePathMapping
-
checkQueuePathMapping
-
removeQueuePathMapping
-
getQueuePathMapping
-
debugLog
-