public class LocalRepoSync extends Object
Modifier and Type | Field and Description |
---|---|
protected DeleteModificationDao |
deleteModificationDao |
protected File |
localRoot |
protected ModificationDao |
modificationDao |
protected NormalFileDao |
normalFileDao |
protected RemoteRepositoryDao |
remoteRepositoryDao |
protected RepoFileDao |
repoFileDao |
protected LocalRepoTransaction |
transaction |
Modifier | Constructor and Description |
---|---|
protected |
LocalRepoSync(LocalRepoTransaction transaction) |
Modifier and Type | Method and Description |
---|---|
protected RepoFile |
_createRepoFile(RepoFile parentRepoFile,
File file,
ProgressMonitor monitor) |
static LocalRepoSync |
create(LocalRepoTransaction transaction) |
protected void |
createCopyModificationsIfPossible(NormalFile newNormalFile) |
protected DeleteModification |
createDeleteModification(RepoFile repoFile,
RemoteRepository remoteRepository) |
protected void |
createDeleteModifications(RepoFile repoFile) |
protected RepoFile |
createRepoFile(RepoFile parentRepoFile,
File file,
ProgressMonitor monitor) |
void |
deleteRepoFile(RepoFile repoFile) |
void |
deleteRepoFile(RepoFile repoFile,
boolean createDeleteModifications) |
protected void |
deleteRepoFileWithAllChildrenRecursively(RepoFile repoFile) |
LocalRepoSync |
ignoreRulesEnabled(boolean ignoreRulesEnabled) |
boolean |
isIgnoreRulesEnabled() |
boolean |
isModified(RepoFile repoFile,
File file) |
boolean |
isRepoFileTypeCorrect(RepoFile repoFile,
File file)
Determines, if the type of the given
repoFile matches the type
of the file in the file system referenced by the given file . |
protected void |
onFinalizeFileChunk(FileChunk fileChunk) |
protected void |
populateDeleteModification(DeleteModification modification,
RepoFile repoFile,
RemoteRepository remoteRepository) |
protected void |
putIntoSha1AndLength2PathsIfNormalFile(RepoFile repoFile) |
void |
setIgnoreRulesEnabled(boolean ignoreRulesEnabled) |
protected void |
sha(NormalFile normalFile,
File file,
ProgressMonitor monitor) |
RepoFile |
sync(File file,
ProgressMonitor monitor,
boolean recursiveChildren) |
void |
sync(ProgressMonitor monitor) |
protected RepoFile |
sync(RepoFile parentRepoFile,
File file,
ProgressMonitor monitor,
boolean recursiveChildren)
Sync the single given
file . |
void |
updateRepoFile(RepoFile repoFile,
File file,
ProgressMonitor monitor) |
protected final LocalRepoTransaction transaction
protected final RepoFileDao repoFileDao
protected final NormalFileDao normalFileDao
protected final RemoteRepositoryDao remoteRepositoryDao
protected final ModificationDao modificationDao
protected final DeleteModificationDao deleteModificationDao
protected LocalRepoSync(LocalRepoTransaction transaction)
public static LocalRepoSync create(LocalRepoTransaction transaction)
public void sync(ProgressMonitor monitor)
public RepoFile sync(File file, ProgressMonitor monitor, boolean recursiveChildren)
protected RepoFile sync(RepoFile parentRepoFile, File file, ProgressMonitor monitor, boolean recursiveChildren)
file
.
If file
is a directory, it recursively syncs all its children.
parentRepoFile
- the parent. May be null
, if the file is the repository's root-directory.
For non-root files, this must not be null
!file
- the file to be synced. Must not be null
.monitor
- the progress-monitor. Must not be null
.recursiveChildren
- TODORepoFile
corresponding to the given file
. Is null
, if the given
file
does not exist; otherwise it is never null
.public boolean isRepoFileTypeCorrect(RepoFile repoFile, File file)
repoFile
matches the type
of the file in the file system referenced by the given file
.repoFile
- the RepoFile
currently representing the given file
in the database.
Must not be null
.file
- the file in the file system. Must not be null
.true
, if both types correspond to each other; false
otherwise. If
the file does not exist (anymore) in the file system, false
is returned, too.public boolean isModified(RepoFile repoFile, File file)
protected RepoFile createRepoFile(RepoFile parentRepoFile, File file, ProgressMonitor monitor)
protected RepoFile _createRepoFile(RepoFile parentRepoFile, File file, ProgressMonitor monitor)
public void updateRepoFile(RepoFile repoFile, File file, ProgressMonitor monitor)
public void deleteRepoFile(RepoFile repoFile)
public void deleteRepoFile(RepoFile repoFile, boolean createDeleteModifications)
protected void createCopyModificationsIfPossible(NormalFile newNormalFile)
protected void createDeleteModifications(RepoFile repoFile)
protected DeleteModification createDeleteModification(RepoFile repoFile, RemoteRepository remoteRepository)
protected void populateDeleteModification(DeleteModification modification, RepoFile repoFile, RemoteRepository remoteRepository)
protected void deleteRepoFileWithAllChildrenRecursively(RepoFile repoFile)
protected void putIntoSha1AndLength2PathsIfNormalFile(RepoFile repoFile)
protected void sha(NormalFile normalFile, File file, ProgressMonitor monitor)
protected void onFinalizeFileChunk(FileChunk fileChunk)
public boolean isIgnoreRulesEnabled()
public void setIgnoreRulesEnabled(boolean ignoreRulesEnabled)
public LocalRepoSync ignoreRulesEnabled(boolean ignoreRulesEnabled)
Copyright © 2013–2019. All rights reserved.