From 5c19b6b7ff2a6b387758096828243e36196dbd1f Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Mon, 12 Feb 2024 17:44:49 -0500 Subject: [PATCH] apply spotless formatting * on top of Hans Schulz "mask off non-permission bits" --- .../applications/DefaultApplicationsTest.java | 135 ++++-------------- .../java/org/cloudfoundry/util/FileUtils.java | 9 +- 2 files changed, 32 insertions(+), 112 deletions(-) diff --git a/cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java b/cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java index e5a46ca724..cd28078c7b 100644 --- a/cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java +++ b/cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/DefaultApplicationsTest.java @@ -1491,10 +1491,7 @@ void pushDomainNotFound() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1544,10 +1541,7 @@ void pushExistingApplication() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1615,10 +1609,7 @@ void pushExistingApplicationWithEnvironmentVariables() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1688,10 +1679,7 @@ void pushExistingApplicationWithNullEnvironment() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1767,10 +1755,7 @@ void pushExistingRouteWithHost() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1826,10 +1811,7 @@ void pushExistingRouteWithNoHost() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1908,10 +1890,7 @@ void pushMultipleRoutes() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -1991,10 +1970,7 @@ void pushNewApplication() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2059,10 +2035,7 @@ void pushNewApplicationWithEnvironmentVariables() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2136,10 +2109,7 @@ void pushNewRouteWithHost() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2202,10 +2172,7 @@ void pushNewRouteWithNoHost() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2260,10 +2227,7 @@ void pushNoDomainNoneFound() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2305,10 +2269,7 @@ void pushNoDomainPrivate() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2352,10 +2313,7 @@ void pushNoDomainShared() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2414,10 +2372,7 @@ void pushNoHostnameFlag() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2483,10 +2438,7 @@ void pushNoInstances() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2543,10 +2495,7 @@ void pushNoRoute() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2597,10 +2546,7 @@ void pushNoRouteFlag() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2654,10 +2600,7 @@ void pushNoStart() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2717,10 +2660,7 @@ void pushPrivateDomain() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2788,10 +2728,7 @@ void pushRandomRoute() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2854,10 +2791,7 @@ void pushSharedDomain() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2919,10 +2853,7 @@ void pushStartFailsRunning() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -2989,10 +2920,7 @@ void pushStartFailsStaging() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -3053,10 +2981,7 @@ void pushTcpRandomRoute() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -3116,10 +3041,7 @@ void pushTcpRoute() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", @@ -3189,10 +3111,7 @@ void pushUploadFails() throws IOException { this.cloudFoundryClient, Arrays.asList( new ResourceMatchingUtils.ArtifactMetadata( - "da39a3ee5e6b4b0d3255bfef95601890afd80709", - "Staticfile", - "644", - 0), + "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", diff --git a/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java b/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java index 60e5ead73d..5bf9a5c0f7 100644 --- a/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java +++ b/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java @@ -179,10 +179,11 @@ public static String permissions(Path path) { * @return a {@link String} representation of the permissions */ public static String permissions(int mode) { - return Integer.toOctalString(mode == 0 ? - DEFAULT_PERMISSIONS : - mode & 07777 // only use permission bits, not the file type - ); + return Integer.toOctalString( + mode == 0 + ? DEFAULT_PERMISSIONS + : mode & 07777 // only use permission bits, not the file type + ); } /**