[java-idp-plugin-jetty] 179/186: untabify
Rod Widdowson
rdw at steadingsoftware.com
Thu Jul 24 15:58:50 UTC 2025
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch dev/foo
in repository java-idp-plugin-jetty.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-jetty.git;a=commit;h=c14b179f1c19768ff4cdb99bc8afcd4da719ddd6
commit c14b179f1c19768ff4cdb99bc8afcd4da719ddd6
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Jul 15 10:56:21 2025 +0100
untabify
---
jetty-cli/pom.xml | 4 +-
.../jetty/cli/impl/JettyDownloadArguments.java | 116 +++++------
.../plugin/jetty/cli/impl/JettyDownloadCLI.java | 222 ++++++++++-----------
jetty-impl/pom.xml | 8 +-
4 files changed, 175 insertions(+), 175 deletions(-)
diff --git a/jetty-cli/pom.xml b/jetty-cli/pom.xml
index 4a96ca1..29ff1f4 100644
--- a/jetty-cli/pom.xml
+++ b/jetty-cli/pom.xml
@@ -80,12 +80,12 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<scope>test</scope>
diff --git a/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadArguments.java b/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadArguments.java
index c582e6e..00d9de1 100644
--- a/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadArguments.java
+++ b/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadArguments.java
@@ -28,7 +28,7 @@ import net.shibboleth.shared.primitive.LoggerFactory;
* Command line arguments for the "Download" verb.
*/
public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArguments {
-
+
/** Logger. */
@Nullable private Logger log;
@@ -39,11 +39,11 @@ public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArgum
/** The groupId. */
@Parameter(names= {"--groupId"})
@Nonnull private String groupId = "org.eclipse.jetty";
-
+
/** The version. */
@Parameter(names= {"-v", "--downloadVersion"})
@Nullable private String version;
-
+
/** The type. */
@Parameter(names= {"--type"})
@Nonnull private String type = "tar.gz";
@@ -51,7 +51,7 @@ public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArgum
/** The classifier. */
@Parameter(names= {"--classifier"})
@Nonnull private String classifier="";
-
+
/** Base of the repo. */
@Parameter(names= {"--mavenbase"})
@Nonnull private String mavenbase="https://repo1.maven.org/maven2";
@@ -59,33 +59,33 @@ public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArgum
/** keystore Location. */
@Parameter(names= {"--keystore"})
@Nonnull private String keystore="credentials/jetty-base-download-keystore.gpg";
-
+
/** The BaseURL of the download base artifact.
* If not set, the command line initializes this from the maven coordinates. */
@Parameter(names= {"--baseURL"})
@Nonnull private String baseURL;
-
+
/** Whether to download the signature file. */
@Parameter(names= {"--noascfile"})
@Nonnull private boolean noAscFile;
-
+
/** Whether to do a signature check. */
@Parameter(names= {"--nosigcheck"})
@Nonnull private boolean noSigCheck;
-
+
/** Whether to unpack. */
@Parameter(names= {"--nounpack"})
@Nonnull private boolean noUnpack;
- /** {@inheritDoc} */
- @Override
- public Logger getLog() {
+ /** {@inheritDoc} */
+ @Override
+ public Logger getLog() {
if (log == null) {
log = LoggerFactory.getLogger(JettyDownloadArguments.class);
}
assert log != null;
return log;
- }
+ }
/**
* Get the group ID (maven coordinate).
@@ -97,14 +97,14 @@ public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArgum
/**
* Get the artifact ID (maven coordinate).
- * @return the artifactId
- */
- @Nonnull public String getArtifactId() {
+ * @return the artifactId
+ */
+ @Nonnull public String getArtifactId() {
return artifactId;
}
- /**
- * Get the classifier (maven coordinate).
+ /**
+ * Get the classifier (maven coordinate).
* @return the classifier
*/
@Nonnull public String getClassifier() {
@@ -118,68 +118,68 @@ public class JettyDownloadArguments extends AbstractIdPHomeAwareCommandLineArgum
@Nonnull public String getType() {
return type;
}
-
+
/**
* Get the version (maven coordinate).
* @return the version
*/
- @Nullable public String getVersion() {
+ @Nullable public String getVersion() {
return version;
}
-
- /**
- * Get the URL that anchors the maven repository.
- * @return the base of the URL.
- */
- @Nonnull public String getMavenbase() {
+
+ /**
+ * Get the URL that anchors the maven repository.
+ * @return the base of the URL.
+ */
+ @Nonnull public String getMavenbase() {
return mavenbase;
}
-
- /**
- * Are we downloading the asc file?
- * @return what to do
- */
- public boolean isNoAscFile() {
+
+ /**
+ * Are we downloading the asc file?
+ * @return what to do
+ */
+ public boolean isNoAscFile() {
return noAscFile;
}
-
- /**
- * Have we suppressed signature checking - either explicitly or
- * by saying "no asc file".
- * @return what to do
- */
- public boolean isNoSigCheck() {
+
+ /**
+ * Have we suppressed signature checking - either explicitly or
+ * by saying "no asc file".
+ * @return what to do
+ */
+ public boolean isNoSigCheck() {
return noAscFile || noSigCheck;
}
-
- /**
- * Are we just downloading?
- * @return what to do
- */
- public boolean isNoUnpack() {
+
+ /**
+ * Are we just downloading?
+ * @return what to do
+ */
+ public boolean isNoUnpack() {
return noUnpack;
}
-
- /**
- * Set the BaseURL we are to download from.
- * @param what the path
- */
- public void setBaseUrl(@Nonnull String what) {
+
+ /**
+ * Set the BaseURL we are to download from.
+ * @param what the path
+ */
+ public void setBaseUrl(@Nonnull String what) {
baseURL = Constraint.isNotNull(what, "injected FPQ must be non null");
}
/**
* What is the base URL we are to download from? (the artifact name and appropriate garnish is added)
- * @return the path
- */
- @Nullable public String getBaseURL() {
+ * @return the path
+ */
+ @Nullable public String getBaseURL() {
return baseURL;
}
-
- /** get keystore location (relative to idp home).
- * @return the location
- */
- public String getKeystore() {
+
+ /** get keystore location (relative to idp home).
+ * @return the location
+ */
+ public String getKeystore() {
return keystore;
}
}
diff --git a/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadCLI.java b/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadCLI.java
index 0e6e2ca..6d44c4e 100644
--- a/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadCLI.java
+++ b/jetty-cli/src/main/java/net/shibboleth/idp/plugin/jetty/cli/impl/JettyDownloadCLI.java
@@ -56,13 +56,13 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
/** Logger. */
@Nullable private final Logger log = LoggerFactory.getLogger(JettyDownloadCLI.class);
-
+
/** the keystore (if provided). */
@Nullable private Path keyStore;
-
+
/** Where we are downloading to. */
private Path downloadsDir;
-
+
/** The name we will download to (including type). */
private String downloadFileName;
@@ -72,34 +72,34 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
/** The securityParams for the module context. */
@Nullable private HttpClientSecurityParameters securityParams;
- /** {@inheritDoc} */
- @Override
- protected Class<JettyDownloadArguments> getArgumentClass() {
- return JettyDownloadArguments.class;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Class<JettyDownloadArguments> getArgumentClass() {
+ return JettyDownloadArguments.class;
+ }
- /** {@inheritDoc} */
- @Override
- protected String getVersion() {
+ /** {@inheritDoc} */
+ @Override
+ protected String getVersion() {
final String result = Version.getVersion();
assert result != null;
- return result; }
+ return result; }
- /** {@inheritDoc} */
- @Override
- protected Logger getLogger() {
+ /** {@inheritDoc} */
+ @Override
+ protected Logger getLogger() {
return log;
- }
-
+ }
+
/** {@inheritDoc} */
@Nonnull protected List<Resource> getAdditionalSpringResources() {
return CollectionSupport.singletonList(
- new ClassPathResource("net/shibboleth/idp/conf/http-client.xml"));
+ new ClassPathResource("net/shibboleth/idp/conf/http-client.xml"));
}
- @Override
- protected int doRun(@Nonnull final JettyDownloadArguments args) {
-
+ @Override
+ protected int doRun(@Nonnull final JettyDownloadArguments args) {
+
if (args.getHttpClientName() == null) {
args.setHttpClientName("shibboleth.InternalHttpClient");
}
@@ -109,45 +109,45 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
}
-
- if (args.getBaseURL() == null) {
- //
- // Calculate the address
- //
- if (args.getVersion() == null) {
- log.error("No version and no FQP supplied");
- return RC_IO;
- }
- //
- // Root of request
- // https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/12.0.23/jetty-home-12.0.23/
- // https://repo1.maven.org/maven2/commons-daemon/commons-daemon/1.4.1/commons-daemon-1.4.1/
- //
- final StringBuilder fqpBuilder = new StringBuilder(args.getMavenbase())
- .append('/')
- .append(args.getGroupId().replaceAll("\\.", "/"))
- .append('/')
- .append(args.getArtifactId())
- .append('/')
- .append(args.getVersion())
- .append('/');
-
- args.setBaseUrl(fqpBuilder.toString());
- }
-
- //
- // jetty-home
- // commons-daemon
- //
- downloadDirName = args.getArtifactId();
+
+ if (args.getBaseURL() == null) {
+ //
+ // Calculate the address
+ //
+ if (args.getVersion() == null) {
+ log.error("No version and no FQP supplied");
+ return RC_IO;
+ }
+ //
+ // Root of request
+ // https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/12.0.23/jetty-home-12.0.23/
+ // https://repo1.maven.org/maven2/commons-daemon/commons-daemon/1.4.1/commons-daemon-1.4.1/
+ //
+ final StringBuilder fqpBuilder = new StringBuilder(args.getMavenbase())
+ .append('/')
+ .append(args.getGroupId().replaceAll("\\.", "/"))
+ .append('/')
+ .append(args.getArtifactId())
+ .append('/')
+ .append(args.getVersion())
+ .append('/');
+
+ args.setBaseUrl(fqpBuilder.toString());
+ }
+
+ //
+ // jetty-home
+ // commons-daemon
+ //
+ downloadDirName = args.getArtifactId();
if (args.getVersion() != null) {
//
// jetty-home-12.0.23
// commons-daemon-1.4.1
//
downloadDirName += "-" + args.getVersion();
- }
-
+ }
+
final StringBuilder nameBuilder = new StringBuilder(downloadDirName);
final String classifier = args.getClassifier();
if (classifier != null && !classifier.isEmpty()) {
@@ -165,58 +165,58 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
// commons-daemon-1.4.1-bin-windows.zip
//
downloadFileName = nameBuilder
- .append('.')
- .append(args.getType())
- .toString();
+ .append('.')
+ .append(args.getType())
+ .toString();
final String pathString = Constraint.isNotNull(
- getApplicationContext().getEnvironment().getProperty("idp.home"), "idp home must be specified");
+ getApplicationContext().getEnvironment().getProperty("idp.home"), "idp home must be specified");
final Path idpHome;
try {
idpHome = Path.of(pathString);
} catch (final Exception ex) {
log.error("Could not find idp home at {}", pathString, ex);
- return RC_IO;
+ return RC_IO;
}
-
- if (!args.isNoSigCheck()) {
-
- keyStore = idpHome.resolve(args.getKeystore());
-
- if (!Files.exists(keyStore)) {
+
+ if (!args.isNoSigCheck()) {
+
+ keyStore = idpHome.resolve(args.getKeystore());
+
+ if (!Files.exists(keyStore)) {
log.error("keystore file {} does not exist", keyStore);
return RC_IO;
- }
- }
- downloadsDir = idpHome.resolve("jetty-downloads");
-
- if (Files.exists(downloadsDir)) {
- if (!Files.isDirectory(downloadsDir)) {
- getLogger().error("{} is not a directory", downloadsDir);
- }
- } else {
- try {
- Files.createDirectory(downloadsDir);
+ }
+ }
+ downloadsDir = idpHome.resolve("jetty-downloads");
+
+ if (Files.exists(downloadsDir)) {
+ if (!Files.isDirectory(downloadsDir)) {
+ getLogger().error("{} is not a directory", downloadsDir);
+ }
+ } else {
+ try {
+ Files.createDirectory(downloadsDir);
} catch (final IOException e) {
log.error("Could not create {}", downloadsDir, e);
- return RC_IO;
+ return RC_IO;
}
- }
-
- int result = download(args);
- if (result != RC_OK) {
- return result;
- }
- result = sigCheck(args);
+ }
+
+ int result = download(args);
if (result != RC_OK) {
return result;
}
- result = unpack(args);
+ result = sigCheck(args);
+ if (result != RC_OK) {
+ return result;
+ }
+ result = unpack(args);
if (result != RC_OK) {
return result;
}
return RC_OK;
- }
+ }
/** Download the files from the remote server.
* @param args the {@link JettyDownloadArguments} we were given.
@@ -250,9 +250,9 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
return RC_OK;
}
try (final InputStream sigStream = new BufferedInputStream(
- new FileInputStream(downloadsDir.resolve(downloadFileName + ".asc").toFile()));
- final InputStream dataStream = new BufferedInputStream(
- new FileInputStream(downloadsDir.resolve(downloadFileName).toFile())); ) {
+ new FileInputStream(downloadsDir.resolve(downloadFileName + ".asc").toFile()));
+ final InputStream dataStream = new BufferedInputStream(
+ new FileInputStream(downloadsDir.resolve(downloadFileName).toFile())); ) {
final TrustStore trust = new TrustStore();
trust.setTrustStore(keyStore.toAbsolutePath().toString());
@@ -280,7 +280,7 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
* @throws IOException if badness occurrs
*/
private static ArchiveInputStream<?> getStreamFor(@Nonnull final Path fullName, final boolean isZip)
- throws IOException {
+ throws IOException {
final InputStream inStream = new BufferedInputStream(new FileInputStream(fullName.toFile()));
if (isZip) {
return new ZipArchiveInputStream(inStream);
@@ -353,27 +353,27 @@ public class JettyDownloadCLI extends AbstractIdPHomeAwareCommandLine<JettyDownl
return RC_OK;
}
-
+
/** Shim for CLI entry point: Allows the code to be run from a test.
- *
- * @return one of the predefines {@link AbstractCommandLine#RC_INIT},
- * {@link AbstractCommandLine#RC_IO}, {@link AbstractCommandLine#RC_OK}
- * or {@link AbstractCommandLine#RC_UNKNOWN}
- *
- * @param args arguments
- */
- public static int runMain(@Nonnull final String[] args) {
- final JettyDownloadCLI cli = new JettyDownloadCLI();
-
- return cli.run(args);
- }
-
- /**
- * CLI entry point.
- * @param args arguments
- */
- public static void main(@Nonnull final String[] args) {
- System.exit(runMain(args));
- }
+ *
+ * @return one of the predefines {@link AbstractCommandLine#RC_INIT},
+ * {@link AbstractCommandLine#RC_IO}, {@link AbstractCommandLine#RC_OK}
+ * or {@link AbstractCommandLine#RC_UNKNOWN}
+ *
+ * @param args arguments
+ */
+ public static int runMain(@Nonnull final String[] args) {
+ final JettyDownloadCLI cli = new JettyDownloadCLI();
+
+ return cli.run(args);
+ }
+
+ /**
+ * CLI entry point.
+ * @param args arguments
+ */
+ public static void main(@Nonnull final String[] args) {
+ System.exit(runMain(args));
+ }
}
diff --git a/jetty-impl/pom.xml b/jetty-impl/pom.xml
index 99894bc..99c532b 100644
--- a/jetty-impl/pom.xml
+++ b/jetty-impl/pom.xml
@@ -13,7 +13,7 @@
<name>Jettty: Plugin and Module implementation </name>
<description>
Project with the code for the Jetty plugin.
- Also constructs a zip and tarball of jetty-base.
+ Also constructs a zip and tarball of jetty-base.
</description>
<artifactId>jetty-plugin-impl</artifactId>
<packaging>jar</packaging>
@@ -78,8 +78,8 @@
</archive>
</configuration>
</plugin>
- <!-- Copy (linux) files to the jetty base we will create (for use outside the plugin -->
- <plugin>
+ <!-- Copy (linux) files to the jetty base we will create (for use outside the plugin -->
+ <plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
@@ -97,7 +97,7 @@
<excludes>
<exclude>**/.gitkeep</exclude>
</excludes>
- <filtering>false</filtering>
+ <filtering>false</filtering>
</resource>
</resources>
</configuration>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list