@Override
    public String toEncrypted(final Session<?> session, final String directoryId, final String filename, final EnumSet<Path.Type> type) throws BackgroundException {
        final String ciphertextName = cryptomator.getFileNameCryptor().encryptFilename(BaseEncoding.base64Url(),
            filename, directoryId.getBytes(StandardCharsets.UTF_8)) + EXTENSION_REGULAR;
        if(log.isDebugEnabled()) {
            log.debug(String.format("Encrypted filename %s to %s", filename, ciphertextName));
        }
        return cryptomator.getFilenameProvider().deflate(session, ciphertextName);
    }
@Test(expected = NotfoundException.class)
    public void testToEncryptedInvalidPath() throws Exception {
        final Path home = new Path("/vault", EnumSet.of(Path.Type.directory));
        final CryptoVault vault = new CryptoVault(home);
        final CryptoDirectory provider = new CryptoDirectoryV7Provider(home, vault);
        provider.toEncrypted(new NullSession(new Host(new TestProtocol())), null, new Path("/", EnumSet.of(Path.Type.directory)));
    }