Class DeleteFileSystemAction
- java.lang.Object
-
- org.syncany.operations.down.actions.FileSystemAction
-
- org.syncany.operations.down.actions.DeleteFileSystemAction
-
public class DeleteFileSystemAction extends FileSystemAction
-
-
Field Summary
-
Fields inherited from class org.syncany.operations.down.actions.FileSystemAction
config, fileVersion1, fileVersion2, fileVersionHelper, logger, winningDatabase
-
-
Constructor Summary
Constructors Constructor Description DeleteFileSystemAction(Config config, FileVersion fromFileVersion, FileVersion toDeleteFileVersion, MemoryDatabase winningDatabase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemActionResult
execute()
Deletes a file locally and/or creates a conflicting file if the file does not match the expectations.java.lang.String
toString()
-
Methods inherited from class org.syncany.operations.down.actions.FileSystemAction
createFolder, createSymlink, deleteFile, fileAsExpected, fileAsExpected, fileChanges, fileExists, getAbsolutePathFile, getFile1, getFile2, getType, moveFileToFinalLocation, moveToConflictFile, moveToConflictFile, setFileAttributes, setFileAttributes, setLastModified, setLastModified
-
-
-
-
Constructor Detail
-
DeleteFileSystemAction
public DeleteFileSystemAction(Config config, FileVersion fromFileVersion, FileVersion toDeleteFileVersion, MemoryDatabase winningDatabase)
-
-
Method Detail
-
execute
public FileSystemActionResult execute() throws java.lang.Exception
Deletes a file locally and/or creates a conflicting file if the file does not match the expectations. There are two major cases:Normal case: The file version of the to-be-deleted file is known. If the file is as expected, it is deleted; if not and the file exists, a conflict file is created.
Special case: The file version of the to-be-deleted file in unknown. In case to-be-deleted-file exists locally, we need to compare it to the local file (especially its checksum!). The
FileVersionComparator
does, however, perform a cancelling test in whichFileVersion
s marked as 'DELETED' are not compared in detail (no checksum/attribute/etc. comparisons). To circumvent this behavior, we pretend the file has just changed and do the comparison. If the to-be-deleted file and file version are equal, the local file is deleted. Otherwise, a conflict file is created.- Specified by:
execute
in classFileSystemAction
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-