-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
2,991 additions
and
1,719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/org/cryptomator/cryptofs/CiphertextFilePath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.cryptomator.cryptofs; | ||
|
||
import org.cryptomator.cryptofs.common.Constants; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
||
public class CiphertextFilePath { | ||
|
||
private final Path path; | ||
private final Optional<LongFileNameProvider.DeflatedFileName> deflatedFileName; | ||
|
||
CiphertextFilePath(Path path, Optional<LongFileNameProvider.DeflatedFileName> deflatedFileName) { | ||
this.path = Objects.requireNonNull(path); | ||
this.deflatedFileName = Objects.requireNonNull(deflatedFileName); | ||
} | ||
|
||
public Path getRawPath() { | ||
return path; | ||
} | ||
|
||
public boolean isShortened() { | ||
return deflatedFileName.isPresent(); | ||
} | ||
|
||
public Path getFilePath() { | ||
return isShortened() ? path.resolve(Constants.CONTENTS_FILE_NAME) : path; | ||
} | ||
|
||
public Path getDirFilePath() { | ||
return path.resolve(Constants.DIR_FILE_NAME); | ||
} | ||
|
||
public Path getSymlinkFilePath() { | ||
return path.resolve(Constants.SYMLINK_FILE_NAME); | ||
} | ||
|
||
public Path getInflatedNamePath() { | ||
return path.resolve(Constants.INFLATED_FILE_NAME); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(path, deflatedFileName); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj instanceof CiphertextFilePath) { | ||
CiphertextFilePath other = (CiphertextFilePath) obj; | ||
return this.path.equals(other.path) && this.deflatedFileName.equals(other.deflatedFileName); | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return path.toString(); | ||
} | ||
|
||
public void persistLongFileName() { | ||
deflatedFileName.ifPresent(LongFileNameProvider.DeflatedFileName::persist); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/org/cryptomator/cryptofs/CiphertextFileType.java
This file was deleted.
Oops, something went wrong.
175 changes: 0 additions & 175 deletions
175
src/main/java/org/cryptomator/cryptofs/ConflictResolver.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.