Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WASdev/tool.lars
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.4
Choose a base ref
...
head repository: WASdev/tool.lars
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 9 commits
  • 18 files changed
  • 5 contributors

Commits on Oct 30, 2020

  1. Update INSTALL.md

    rickettmwork authored Oct 30, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    941ee6e View commit details
  2. Add download links

    rickettmwork authored Oct 30, 2020
    Copy the full SHA
    b8deb7f View commit details

Commits on Nov 19, 2020

  1. Add missing fields to ESA

    pnickoll committed Nov 19, 2020
    Copy the full SHA
    4a7c22f View commit details
  2. Copy the full SHA
    b83845e View commit details

Commits on Dec 18, 2020

  1. Merge pull request #208 from phl1x/LocalMaster

    Add missing fields to ESAs
    pnickoll authored Dec 18, 2020
    Copy the full SHA
    4f0c35e View commit details

Commits on Feb 6, 2024

  1. removing calls to library that is not included in java any longer

    adding gradle wrapper to project
    jacobwdv committed Feb 6, 2024
    Copy the full SHA
    4f3ad2b View commit details

Commits on Feb 15, 2024

  1. Merge pull request #209 from jacobwdv/JD_larsupdate

    Updating LARS Client code to be compatible with JDK8+
    pnickoll authored Feb 15, 2024
    Copy the full SHA
    ec82e4e View commit details

Commits on Nov 20, 2024

  1. Copy the full SHA
    2bc7a90 View commit details
  2. Merge pull request #210 from WASdev/dev_bd-2

    Update web.xml default to only allow needed HTTP connections
    BillyD73 authored Nov 20, 2024
    Copy the full SHA
    f78d01d View commit details
Original file line number Diff line number Diff line change
@@ -105,4 +105,26 @@ public interface EsaResource extends RepositoryResource, ApplicableToProduct {
*/
public Visibility getVisibility();

/**
* Checks if this feature is a singleton
*
* @return the singleton value (which can be "true", "false" or null)
*/
public String getSingleton();

/**
* Checks if this feature is a singleton. This is a helper function
* that calls getSingleton and converts it from a String value to
* a boolean
*
* @return true if this feature is a singleton and false otherwise
*/
public boolean isSingleton();

/**
* Gets the IBM install too property from the feature.
*
* @return The IBM-InstallTo header property
*/
public String getIBMInstallTo();
}
Original file line number Diff line number Diff line change
@@ -237,28 +237,27 @@ private void addVersionDisplayString() {
return;
}

String requiresJava8 = "Java SE 8";
String requiresJava7or8 = "Java SE 7, Java SE 8";
String requiresJava6or7or8 = "Java SE 6, Java SE 7, Java SE 8";
String minJava11 = "Java SE 11, Java SE 15";
String minJava8 = "Java SE 8, Java SE 11, Java SE 15";

// The min version should have been validated when the ESA was constructed
// so checking for the version string should be safe
if (minVersion.equals("1.6.0")) {
reqs.setVersionDisplayString(requiresJava6or7or8);
if (minVersion.equals("1.6.0") || minVersion.equals("1.7.0") || minVersion.equals("1.8.0")) {
reqs.setVersionDisplayString(minJava8);
return;
}
if (minVersion.equals("1.7.0")) {
reqs.setVersionDisplayString(requiresJava7or8);
return;
}
if (minVersion.equals("1.8.0")) {
reqs.setVersionDisplayString(requiresJava8);
if (minVersion.startsWith("9.") ||
minVersion.startsWith("10.") ||
minVersion.startsWith("11.")) {
// If a feature requires a min of Java 9/10/11, state Java 11 is required because
// Liberty does not officially support Java 9 or 10
reqs.setVersionDisplayString(minJava11);
return;
}

// The min version string has been generated/validated incorrectly
// Can't recover from this, it is a bug in EsaUploader
throw new AssertionError();
throw new AssertionError("Unrecognized java version: " + minVersion);

}

@@ -396,6 +395,12 @@ protected void copyFieldsFrom(RepositoryResourceImpl fromResource, boolean inclu
setVisibility(esaRes.getVisibility());
setShortName(esaRes.getShortName());
setVanityURL(esaRes.getVanityURL());
setIBMInstallTo(esaRes.getIBMInstallTo());
setSingleton(esaRes.getSingleton());
JavaSEVersionRequirements reqs = esaRes.getJavaSEVersionRequirements();
if (reqs != null) {
setJavaSEVersionRequirements(reqs.getMinVersion(), reqs.getMaxVersion(), reqs.getRawRequirements());
}
}

@Override
@@ -776,4 +781,33 @@ public JavaSEVersionRequirements getJavaSEVersionRequirements() {
return _asset.getWlpInformation().getJavaSEVersionRequirements();
}

/** {@inheritDoc} */

@Override
public String getSingleton() {
return _asset.getWlpInformation().getSingleton();
}

@Override
public boolean isSingleton() {
return Boolean.valueOf(getSingleton());
}

/** {@inheritDoc} */
@Override
public void setSingleton(String singleton) {
_asset.getWlpInformation().setSingleton(singleton);
}

/** {@inheritDoc} */
@Override
public String getIBMInstallTo() {
return _asset.getWlpInformation().getIbmInstallTo();
}

/** {@inheritDoc} */
@Override
public void setIBMInstallTo(String ibmInstallTo) {
_asset.getWlpInformation().setIbmInstallTo(ibmInstallTo);
}
}
Original file line number Diff line number Diff line change
@@ -1887,12 +1887,12 @@ public void downloadToFile(final File fileToWriteTo) throws RepositoryBackendExc
try {
try {
fos = AccessController.doPrivileged(
new PrivilegedExceptionAction<FileOutputStream>() {
@Override
public FileOutputStream run() throws FileNotFoundException {
return new FileOutputStream(fileToWriteTo);
}
});
new PrivilegedExceptionAction<FileOutputStream>() {
@Override
public FileOutputStream run() throws FileNotFoundException {
return new FileOutputStream(fileToWriteTo);
}
});
} catch (PrivilegedActionException e) {
// Creating a FileInputStream can only return a FileNotFoundException
throw (FileNotFoundException) e.getCause();
@@ -1935,12 +1935,12 @@ private long calculateCRC() throws RepositoryException {
InputStream is = null;
try {
is = AccessController.doPrivileged(
new PrivilegedExceptionAction<FileInputStream>() {
@Override
public FileInputStream run() throws FileNotFoundException {
return new FileInputStream(_file);
}
});
new PrivilegedExceptionAction<FileInputStream>() {
@Override
public FileInputStream run() throws FileNotFoundException {
return new FileInputStream(_file);
}
});
return RepositoryResourceImpl.getCRC(is);
} catch (PrivilegedActionException e) {
// Creating a FileInputStream can only return a FileNotFoundException or NPE
Original file line number Diff line number Diff line change
@@ -154,4 +154,16 @@ public interface EsaResourceWritable extends WebDisplayable, ApplicableToProduct
* @param rawBundleRequirements The Require-Capability headers from all the bundles contained in this ESA
*/
public void setJavaSEVersionRequirements(String minimum, String maximum, Collection<String> rawBundleRequirements);

/**
* See whether the feature is a singleton or not
*
* @param singleton
*/
public void setSingleton(String singleton);

/**
* @param header
*/
public void setIBMInstallTo(String header);
}
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
@@ -484,7 +485,7 @@ public InputStream getAttachment(final Asset asset, final Attachment attachment)
if (attachment.getLinkType() == AttachmentLinkType.DIRECT) {
if ((loginInfo.getAttachmentBasicAuthUserId() != null) && (loginInfo.getAttachmentBasicAuthPassword() != null)) {
String userpass = loginInfo.getAttachmentBasicAuthUserId() + ":" + loginInfo.getAttachmentBasicAuthPassword();
String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes(Charset.forName("UTF-8")));
String basicAuth = "Basic " + encode(userpass.getBytes(Charset.forName("UTF-8")));
connection.setRequestProperty("Authorization", basicAuth);
}
}
@@ -744,7 +745,7 @@ private void addAuthToConnection(HttpURLConnection connection) {
}

if (basicAuthUserPass != null) {
String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(basicAuthUserPass.getBytes(Charset.forName("UTF-8")));
String basicAuth = "Basic " + encode(basicAuthUserPass.getBytes(Charset.forName("UTF-8")));
connection.setRequestProperty("Authorization", basicAuth);
}

@@ -1053,4 +1054,24 @@ private String parseErrorObject(String errorObject) {
return errorObject;
}
}
/**
* Print the base 64 string differently depending on JDK level because
* on JDK 7/8 we have JAX-B, and on JDK 8+ we have java.util.Base64
*/
private static String encode(byte[] bytes) {
try {
if (System.getProperty("java.version").startsWith("1.")) {
// return DatatypeConverter.printBase64Binary(str);
Class<?> DatatypeConverter = Class.forName("javax.xml.bind.DatatypeConverter");
return (String) DatatypeConverter.getMethod("printBase64Binary", byte[].class).invoke(null, bytes);
} else {
// return Base64.getEncoder().encode();
Class<?> Base64 = Class.forName("java.util.Base64");
Object encodeObject = Base64.getMethod("getEncoder").invoke(null);
return (String) encodeObject.getClass().getMethod("encodeToString", byte[].class).invoke(encodeObject, bytes);
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException | ClassNotFoundException e){
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -72,6 +72,8 @@ public class WlpInformation extends AbstractJSON implements VersionableContent,
private String packagedJava;
private Collection<RequireFeatureWithTolerates> requireFeatureWithTolerates;
private String mavenCoordinates;
private String singleton;
private String ibmInstallTo;

public String getFeaturedWeight() {
return featuredWeight;
@@ -726,6 +728,22 @@ boolean equivalent(Object obj) {
return false;
}

if (ibmInstallTo == null) {
if (other.ibmInstallTo != null) {
return false;
}
} else if (!ibmInstallTo.equals(other.ibmInstallTo)) {
return false;
}

if (singleton == null) {
if (other.singleton != null) {
return false;
}
} else if (!singleton.equals(other.singleton)) {
return false;
}

return true;
}

@@ -753,4 +771,20 @@ public Collection<String> attributesThatCauseBreakingChanges() {
return Collections.emptySet();
}

public String getSingleton() {
return singleton;
}

public void setSingleton(String singleton) {
this.singleton = singleton;
}

public String getIbmInstallTo() {
return ibmInstallTo;
}

public void setIbmInstallTo(String ibmInstallTo) {
this.ibmInstallTo = ibmInstallTo;
}

}
2 changes: 1 addition & 1 deletion doc/INSTALL.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ it creates a new Liberty server called `larsServer`.

## Download or Build larsServer.zip

Either download `larsServer.zip` from [GitHub](https://github.com/WASdev/tool.lars/releases) or build it yourself following the instructions in [Building LARS](BUILDING.md)
Either download `larsServer.zip` from [IBM](http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/LARS/larsServer.zip) or build it yourself following the instructions in [Building LARS](BUILDING.md)

Download and install the [Prerequisites](PREREQS.md)

2 changes: 2 additions & 0 deletions doc/LARSCLIENT.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

`larsClient` allows you to add assets to LARS, to list assets and to delete assets. Like Liberty itself, `larsClient` requires Java. For full details of command line parameters, run `bin/larsClient help`.

Either download `larsCient.zip` from [IBM](http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/LARS/larsClient.zip) or build it yourself following the instructions in [Building LARS](BUILDING.md)

### Adding assets

Unzip `larsClient.zip` and then run `larsClient` to upload an asset. You can add an asset by specifying the file containing that asset:
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading