Код: Выделить всё
import com.azure.core.util.*;
import com.azure.storage.file.share.*;
import com.azure.storage.file.share.models.*;
//Create connexion string
String connectStr ="DefaultEndpointsProtocol=https;AccountName=" + accountName + ";AccountKey=" + accountKey + ";EndpointSuffix=" + endpoint;
//ShareDirectoryClient
ShareDirectoryClient dirClient = new ShareFileClientBuilder().connectionString(connectStr).shareName(shareName).resourcePath(directoryName).configuration(proxyOptions).buildDirectoryClient();
// Create empty file
dirClient.createFile(fileName, body.length());
"Не удалось запустить sendFileInDirectoryProxyTest"
Reactor.core.Exceptions$ReactiveException: io.netty.channel.AbstractChannel$AnnotatedConnectException: время ожидания соединения истекло: нет дополнительной информации: «
Я не могу установить/использовать глобальную настройку.Чтобы установить прокси в коде Java, я попробовал несколько вещей, например, используя класс конфигурации:
Код: Выделить всё
Configuration configuration = new Configuration();
configuration.put("java.net.useSystemProxies", "true");
configuration.put("https.proxyHost", "xxxxxxxxx");
configuration.put("https.proxyPort", "xxxx");
ShareDirectoryClient dirClient = new ShareFileClientBuilder().connectionString(connectStr).shareName(shareName).resourcePath(directoryName).configuration(configuration).buildDirectoryClient();
Я уверен, что это довольно просто, любая помощь будет оценена по достоинству.
Спасибо. Шарль де Сен-Андре.
Подробнее здесь: https://stackoverflow.com/questions/728 ... -java-code