GH Hosted: correct aws s3 commands. Green e429 build
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2020 Pivotal, Inc.
|
||||
* Copyright (c) 2020, 2023 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -10,6 +10,7 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.eclipse.boot.dash.docker.runtarget;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -21,6 +22,7 @@ import org.springsource.ide.eclipse.commons.livexp.core.AbstractDisposable;
|
||||
import org.springsource.ide.eclipse.commons.livexp.core.LiveCounter;
|
||||
import org.springsource.ide.eclipse.commons.livexp.core.OnDispose;
|
||||
import org.springsource.ide.eclipse.commons.livexp.util.Log;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
|
||||
|
||||
@@ -73,7 +75,18 @@ public class DockerDeployments extends AbstractDisposable {
|
||||
}
|
||||
|
||||
private Yaml yaml() {
|
||||
return new Yaml(new CustomClassLoaderConstructor(DockerDeploymentList.class, DockerDeployments.class.getClassLoader()));
|
||||
// e429 is based on snakeyaml 2.0 which has a non-backward compatible change in CustomClassLoaderConstructor cosntrcutors
|
||||
try {
|
||||
CustomClassLoaderConstructor cclc = CustomClassLoaderConstructor.class.getConstructor(Class.class, ClassLoader.class).newInstance(DockerDeploymentList.class, DockerDeployments.class.getClassLoader());
|
||||
return new Yaml(cclc);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
CustomClassLoaderConstructor cclc = CustomClassLoaderConstructor.class.getConstructor(Class.class, ClassLoader.class, LoaderOptions.class).newInstance(DockerDeploymentList.class, DockerDeployments.class.getClassLoader(), new LoaderOptions());
|
||||
return new Yaml(cclc);
|
||||
} catch (Exception e1) {
|
||||
throw new IllegalStateException(e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void createOrUpdate(DockerDeployment deployment) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2017 Spring IDE Developers
|
||||
* Copyright (c) 2017, 2023 Spring IDE Developers
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -24,6 +24,7 @@ import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPath;
|
||||
import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPathSegment;
|
||||
import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPathSegment.AtIndex;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
@@ -161,7 +162,7 @@ public class PropertiesToYamlConverter {
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
options.setPrettyFlow(true);
|
||||
|
||||
Yaml yaml = new Yaml(new SafeConstructor(), new Representer(options), options);
|
||||
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()), new Representer(options), options);
|
||||
this.output = yaml.dump(object);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.eclipse.boot.wizard.starters.eclipse;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -466,7 +468,29 @@ public class ResourceCompareInput extends CompareEditorInput {
|
||||
}
|
||||
|
||||
byte[] initialContent() throws CoreException {
|
||||
return Utilities.readBytes(createStream());
|
||||
InputStream in = createStream();
|
||||
ByteArrayOutputStream bos= new ByteArrayOutputStream();
|
||||
try {
|
||||
while (true) {
|
||||
int c= in.read();
|
||||
if (c == -1)
|
||||
break;
|
||||
bos.write(c);
|
||||
}
|
||||
|
||||
} catch (IOException ex) {
|
||||
return null;
|
||||
|
||||
} finally {
|
||||
Utilities.close(in);
|
||||
try {
|
||||
bos.close();
|
||||
} catch (IOException x) {
|
||||
// silently ignored
|
||||
}
|
||||
}
|
||||
|
||||
return bos.toByteArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user