mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-06 16:17:31 +00:00
updated dependencies
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.cryptomator.ui.model;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@@ -9,6 +10,7 @@ import org.cryptomator.common.settings.VaultSettings;
|
||||
import org.cryptomator.cryptofs.CryptoFileSystem;
|
||||
import org.cryptomator.frontend.dokany.Mount;
|
||||
import org.cryptomator.frontend.dokany.MountFactory;
|
||||
import org.cryptomator.frontend.dokany.MountFailedException;
|
||||
|
||||
public class DokanyVolume implements Volume {
|
||||
|
||||
@@ -50,7 +52,11 @@ public class DokanyVolume implements Volume {
|
||||
}
|
||||
}
|
||||
String mountName = vaultSettings.mountName().get();
|
||||
this.mount = mountFactory.mount(fs.getPath("/"), driveLetter, mountName, FS_TYPE_NAME);
|
||||
try {
|
||||
this.mount = mountFactory.mount(fs.getPath("/"), Paths.get(driveLetter + ":\\") , mountName, FS_TYPE_NAME);
|
||||
} catch (MountFailedException e) {
|
||||
throw new VolumeException("Unable to mount Filesystem", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
*******************************************************************************/
|
||||
package org.cryptomator.ui.model;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.nio.file.FileVisitResult;
|
||||
@@ -19,11 +19,7 @@ import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.apache.commons.codec.binary.Base32;
|
||||
import org.apache.commons.codec.binary.BaseNCodec;
|
||||
import com.google.common.io.BaseEncoding;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.cryptomator.cryptolib.Cryptors;
|
||||
import org.cryptomator.cryptolib.api.Cryptor;
|
||||
@@ -32,6 +28,8 @@ import org.cryptomator.ui.l10n.Localization;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* Contains the collective knowledge of all creatures who were alive during the development of vault format 3.
|
||||
* This class uses no external classes from the crypto or shortening layer by purpose, so we don't need legacy code inside these.
|
||||
@@ -50,7 +48,7 @@ class UpgradeVersion3to4 extends UpgradeStrategy {
|
||||
private static final String NEW_FOLDER_PREFIX = "0";
|
||||
|
||||
private final MessageDigest sha1 = MessageDigestSupplier.SHA1.get();
|
||||
private final BaseNCodec base32 = new Base32();
|
||||
private final BaseEncoding base32 = BaseEncoding.base32();
|
||||
|
||||
@Inject
|
||||
public UpgradeVersion3to4(Localization localization) {
|
||||
@@ -155,7 +153,7 @@ class UpgradeVersion3to4 extends UpgradeStrategy {
|
||||
String oldLongName = new String(Files.readAllBytes(oldMetadataFile), UTF_8);
|
||||
if (oldLongName.endsWith(OLD_FOLDER_SUFFIX)) {
|
||||
String newLongName = NEW_FOLDER_PREFIX + StringUtils.removeEnd(oldLongName, OLD_FOLDER_SUFFIX);
|
||||
String newCanonicalBase32 = base32.encodeAsString(sha1.digest(newLongName.getBytes(UTF_8)));
|
||||
String newCanonicalBase32 = base32.encode(sha1.digest(newLongName.getBytes(UTF_8)));
|
||||
String newCanonicalName = newCanonicalBase32 + LONG_FILENAME_EXT;
|
||||
Path newMetadataFile = metadataDir.resolve(newCanonicalName.substring(0, 2)).resolve(newCanonicalName.substring(2, 4)).resolve(newCanonicalName);
|
||||
String newName = newCanonicalBase32 + oldNameSuffix + LONG_FILENAME_EXT;
|
||||
|
||||
Reference in New Issue
Block a user