From c8ba81acf25adc363699b1d2ecaa7d561fa6bab7 Mon Sep 17 00:00:00 2001 From: Hans Schulz Date: Thu, 24 Aug 2023 14:11:01 +0200 Subject: [PATCH 1/2] mask off non-permission bits --- .../applications/DefaultApplicationsTest.java | 108 +++++++++--------- .../java/org/cloudfoundry/util/FileUtils.java | 5 +- 2 files changed, 58 insertions(+), 55 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 d8494294c1..e5a46ca724 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 @@ -1493,12 +1493,12 @@ void pushDomainNotFound() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); this.applications @@ -1546,12 +1546,12 @@ void pushExistingApplication() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -1617,12 +1617,12 @@ void pushExistingApplicationWithEnvironmentVariables() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -1690,12 +1690,12 @@ void pushExistingApplicationWithNullEnvironment() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -1769,12 +1769,12 @@ void pushExistingRouteWithHost() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestAssociateRoute(this.cloudFoundryClient, "test-application-id", "test-route-id"); requestUpload( @@ -1828,12 +1828,12 @@ void pushExistingRouteWithNoHost() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestAssociateRoute(this.cloudFoundryClient, "test-application-id", "test-route-id"); requestUpload( @@ -1910,12 +1910,12 @@ void pushMultipleRoutes() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestRoutesEmpty(this.cloudFoundryClient, "test-shared-domain-id", "test1", null, null); requestCreateRoute( @@ -1993,12 +1993,12 @@ void pushNewApplication() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestPrivateDomainsEmpty(this.cloudFoundryClient, TEST_ORGANIZATION_ID); requestSharedDomains( @@ -2061,12 +2061,12 @@ void pushNewApplicationWithEnvironmentVariables() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestPrivateDomainsEmpty(this.cloudFoundryClient, TEST_ORGANIZATION_ID); requestSharedDomains( @@ -2138,12 +2138,12 @@ void pushNewRouteWithHost() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2204,12 +2204,12 @@ void pushNewRouteWithNoHost() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2262,12 +2262,12 @@ void pushNoDomainNoneFound() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); @@ -2307,12 +2307,12 @@ void pushNoDomainPrivate() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); @@ -2354,12 +2354,12 @@ void pushNoDomainShared() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); requestCreateRoute( @@ -2416,12 +2416,12 @@ void pushNoHostnameFlag() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); requestRoutesEmpty(this.cloudFoundryClient, "test-shared-domain-id", "", null, null); @@ -2485,12 +2485,12 @@ void pushNoInstances() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); requestCreateRoute( @@ -2545,12 +2545,12 @@ void pushNoRoute() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); requestUpload( @@ -2599,12 +2599,12 @@ void pushNoRouteFlag() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutes(this.cloudFoundryClient, "test-application-id", "test-route-id"); requestRemoveApplicationRoute( @@ -2656,12 +2656,12 @@ void pushNoStart() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutesEmpty(this.cloudFoundryClient, "test-application-id"); requestCreateRoute( @@ -2719,12 +2719,12 @@ void pushPrivateDomain() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2790,12 +2790,12 @@ void pushRandomRoute() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2856,12 +2856,12 @@ void pushSharedDomain() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2921,12 +2921,12 @@ void pushStartFailsRunning() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -2991,12 +2991,12 @@ void pushStartFailsStaging() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, @@ -3055,12 +3055,12 @@ void pushTcpRandomRoute() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutes(this.cloudFoundryClient, "test-application-id", "test-route-id"); requestRoutesEmpty(this.cloudFoundryClient, "test-tcp-domain-id", null, null, null); @@ -3118,12 +3118,12 @@ void pushTcpRoute() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestApplicationRoutes(this.cloudFoundryClient, "test-application-id", "test-route-id"); requestRoutesEmpty(this.cloudFoundryClient, "test-tcp-domain-id", null, 61001, null); @@ -3191,12 +3191,12 @@ void pushUploadFails() throws IOException { new ResourceMatchingUtils.ArtifactMetadata( "da39a3ee5e6b4b0d3255bfef95601890afd80709", "Staticfile", - "100644", + "644", 0), new ResourceMatchingUtils.ArtifactMetadata( "45044a6ddbfe11415a8f8a6219de68a2c66b496b", "index.html", - "100644", + "644", 178))); requestCreateRoute( this.cloudFoundryClient, 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 9d40833e7d..60e5ead73d 100644 --- a/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java +++ b/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java @@ -179,7 +179,10 @@ 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); + return Integer.toOctalString(mode == 0 ? + DEFAULT_PERMISSIONS : + mode & 07777 // only use permission bits, not the file type + ); } /** From 5c19b6b7ff2a6b387758096828243e36196dbd1f Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Mon, 12 Feb 2024 17:44:49 -0500 Subject: [PATCH 2/2] 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 + ); } /**