Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mgmt Appplatform: custom domain, certificate and samples #13127

Merged
merged 12 commits into from
Jul 16, 2020
Prev Previous commit
Next Next commit
fix checkstyle
  • Loading branch information
ChenTanyi committed Jul 14, 2020
commit 94c202dc4eca189e34afdc83d42e26c3e22187bd
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ private void extraTarGzSource(File folder, URL url) throws IOException {
}
File file = new File(folder, entry.getName());
File parent = file.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
try (OutputStream outputStream = new FileOutputStream(file)) {
IOUtils.copy(inputStream, outputStream);
if (parent.exists() || parent.mkdirs()) {
try (OutputStream outputStream = new FileOutputStream(file)) {
IOUtils.copy(inputStream, outputStream);
}
} else {
throw new IllegalStateException("Cannot create directory: " + parent.getAbsolutePath());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class ManageSpringCloud {
* @param azure instance of the azure client
* @param clientId the aad client id in azure instance
* @return true if sample runs successfully
* @throws IllegalStateException unexcepted state
*/
public static boolean runSample(Azure azure, String clientId) {
final String rgName = azure.sdkContext().randomResourceName("rg", 24);
Expand Down Expand Up @@ -299,11 +300,12 @@ private static void extraTarGzSource(File folder, URL url) throws IOException {
}
File file = new File(folder, entry.getName());
File parent = file.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
try (OutputStream outputStream = new FileOutputStream(file)) {
IOUtils.copy(inputStream, outputStream);
if (parent.exists() || parent.mkdirs()) {
try (OutputStream outputStream = new FileOutputStream(file)) {
IOUtils.copy(inputStream, outputStream);
}
} else {
throw new IllegalStateException("Cannot create directory: " + parent.getAbsolutePath());
}
}
}
Expand Down