@@ -578,35 +578,35 @@ public void loadFromReadOnlyDirectory() throws GeoWebCacheException {
578578 }
579579 }
580580
581- @ Test
582- public void loadFromEmptyReadOnlyDirectoryFails () throws GeoWebCacheException , IOException {
583- File roEmptyDir = this .temp .newFolder ();
584-
585- // Try to make it read-only
586- roEmptyDir .setWritable (false );
587-
588- // Actively probe whether the directory is still writable (for gwc-release Docker on Windows)
589- File probe = new File (roEmptyDir , "probe" );
590- boolean canWrite ;
591- try {
592- canWrite = probe .createNewFile ();
593- if (canWrite ) {
594- probe .delete ();
595- }
596- } catch (IOException e ) {
597- canWrite = false ;
598- }
599-
600- // Skip if we can still write, this may happen on Windows
601- Assume .assumeTrue ("Skipping: directory is still writable" , !canWrite );
602-
603- try {
604- config = new XMLConfiguration (null , roEmptyDir .getAbsolutePath ());
605- config .setGridSetBroker (gridSetBroker );
606-
607- assertThrows (ConfigurationException .class , () -> config .afterPropertiesSet ());
608- } finally {
609- roEmptyDir .setWritable (true );
610- }
611- }
581+ @ Test
582+ public void loadFromEmptyReadOnlyDirectoryFails () throws GeoWebCacheException , IOException {
583+ File roEmptyDir = this .temp .newFolder ();
584+
585+ // Try to make it read-only
586+ roEmptyDir .setWritable (false );
587+
588+ // Actively probe whether the directory is still writable (for gwc-release Docker on Windows)
589+ File probe = new File (roEmptyDir , "probe" );
590+ boolean canWrite ;
591+ try {
592+ canWrite = probe .createNewFile ();
593+ if (canWrite ) {
594+ probe .delete ();
595+ }
596+ } catch (IOException e ) {
597+ canWrite = false ;
598+ }
599+
600+ // Skip if we can still write, this may happen on Windows
601+ Assume .assumeTrue ("Skipping: directory is still writable" , !canWrite );
602+
603+ try {
604+ config = new XMLConfiguration (null , roEmptyDir .getAbsolutePath ());
605+ config .setGridSetBroker (gridSetBroker );
606+
607+ assertThrows (ConfigurationException .class , () -> config .afterPropertiesSet ());
608+ } finally {
609+ roEmptyDir .setWritable (true );
610+ }
611+ }
612612}
0 commit comments